linux/drivers/net
Fugang Duan 5ad7f389f9 net: fec: add ndo_select_queue to fix TX bandwidth fluctuations
[ Upstream commit 52c4a1a85f ]

As we know that AVB is enabled by default, and the ENET IP design is
queue 0 for best effort, queue 1&2 for AVB Class A&B. Bandwidth of each
queue 1&2 set in driver is 50%, TX bandwidth fluctuated when selecting
tx queues randomly with FEC_QUIRK_HAS_AVB quirk available.

This patch adds ndo_select_queue callback to select queues for
transmitting to fix this issue. It will always return queue 0 if this is
not a vlan packet, and return queue 1 or 2 based on priority of vlan
packet.

You may complain that in fact we only use single queue for trasmitting
if we are not targeted to VLAN. Yes, but seems we have no choice, since
AVB is enabled when the driver probed, we can't switch this feature
dynamicly. After compare multiple queues to single queue, TX throughput
almost no improvement.

One way we can implemet is to configure the driver to multiple queues
with Round-robin scheme by default. Then add ndo_setup_tc callback to
enable/disable AVB feature for users. Unfortunately, ENET AVB IP seems
not follow the standard 802.1Qav spec. We only can program
DMAnCFG[IDLE_SLOPE] field to calculate bandwidth fraction. And idle
slope is restricted to certain valus (a total of 19). It's far away from
CBS QDisc implemented in Linux TC framework. If you strongly suggest to do
this, I think we only can support limited numbers of bandwidth and reject
others, but it's really urgly and wried.

With this patch, VLAN tagged packets route to queue 0/1/2 based on vlan
priority; VLAN untagged packets route to queue 0.

Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reported-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2021-07-19 10:04:42 +02:00
..
appletalk net: appletalk: cops: Fix data race in cops_probe1 2021-05-24 14:00:32 -07:00
arcnet net: arcnet: com20020 fix error handling 2021-03-14 14:17:48 -07:00
bonding bonding: init notify_work earlier to avoid uninitialized use 2021-05-17 15:24:20 -07:00
caif net: caif: fix memory leak in ldisc_open 2021-06-14 12:28:16 -07:00
can can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path 2021-07-14 17:06:10 +02:00
dsa net: mscc: ocelot: check return value after calling platform_get_resource() 2021-07-19 10:04:37 +02:00
ethernet net: fec: add ndo_select_queue to fix TX bandwidth fluctuations 2021-07-19 10:04:42 +02:00
fddi fddi/skfp: fix typo 2021-04-27 14:07:27 -07:00
fjes fjes: check return value after calling platform_get_resource() 2021-07-19 10:04:38 +02:00
hamradio net: hamradio: fix memory leak in mkiss_close 2021-06-17 11:24:54 -07:00
hippi hippi: switch from 'pci_' to 'dma_' API 2020-09-08 20:15:57 -07:00
hyperv hv_netvsc: Make netvsc/VF binding check both MAC and serial number 2021-04-25 18:19:23 -07:00
ieee802154 ieee802154: hwsim: avoid possible crash in hwsim_del_edge_nl() 2021-07-14 17:07:16 +02:00
ipa net: ipa: Add missing of_node_put() in ipa_firmware_load() 2021-07-19 10:04:41 +02:00
ipvlan ipvlan: remove h from printk format specifier 2021-01-28 17:47:33 -08:00
mdio net: mido: mdio-mux-bcm-iproc: Use devm_platform_get_and_ioremap_resource() 2021-07-19 10:04:38 +02:00
mhi net: mhi_net: Update the transmit handler prototype 2021-06-14 14:13:09 -07:00
netdevsim netdevsim: Only use sampling truncation length when valid 2021-04-22 13:23:56 -07:00
pcs net: pcs: add C37 SGMII AN support for intel mGbE controller 2021-03-15 12:53:12 -07:00
phy net: phy: nxp-c45-tja11xx: enable MDIO write access to the master/slave registers 2021-07-19 10:04:39 +02:00
plip net: plip: Fix fall-through warnings for Clang 2021-03-10 12:45:15 -08:00
ppp Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
slip tty: remove TTY_LDISC_MAGIC 2021-03-10 09:34:06 +01:00
team team: protect features update by RCU to avoid deadlock 2021-01-26 17:08:59 -08:00
usb net: cdc_eem: fix tx fixup skb leak 2021-06-17 11:30:25 -07:00
vmxnet3 vmxnet3: Update driver to use ethtool_sprintf 2021-03-17 11:42:31 -07:00
wan Revert "drivers/net/wan/hdlc_fr: Fix a double free in pvc_xmit" 2021-05-03 13:37:58 -07:00
wireguard wireguard: allowedips: free empty intermediate nodes when removing single node 2021-06-04 14:25:14 -07:00
wireless rtl8xxxu: Fix device info for RTL8192EU devices 2021-07-19 10:04:42 +02:00
wwan net: wwan: Fix WWAN config symbols 2021-07-14 17:07:04 +02:00
xen-netback xen-netback: take a reference to the RX task thread 2021-06-07 15:13:15 +02:00
bareudp.c bareudp: allow UDP L4 GRO passthrou 2021-03-30 17:06:50 -07:00
dummy.c net: bonding, dummy, ifb, team: advertise NETIF_F_GSO_SOFTWARE 2020-11-03 16:53:55 -08:00
eql.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
geneve.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-04-26 12:00:00 -07:00
gtp.c net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-02-23 11:29:52 -08:00
ifb.c ifb: use new tasklet API 2021-02-02 15:51:18 -08:00
Kconfig net: wwan: Fix WWAN config symbols 2021-07-14 17:07:04 +02:00
LICENSE.SRC Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
loopback.c Revert "net-loopback: set lo dev initial state to UP" 2021-02-11 13:10:44 -08:00
macsec.c net: macsec: fix the length used to copy the key for offloading 2021-07-14 17:07:19 +02:00
macvlan.c macvlan: Use 'hash' iterators to simplify code 2021-04-27 14:03:11 -07:00
macvtap.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
Makefile net: Add a WWAN subsystem 2021-04-16 15:31:02 -07:00
mdio.c net: mdio: Correct function name mdio45_links_ok() in comment 2021-03-29 13:42:44 -07:00
mii.c net: mii: Report advertised link capabilities when autonegotiation is off 2020-10-29 19:00:46 -07:00
net_failover.c net: net_failover: Correct parameter name 'standby_dev' 2020-11-03 16:40:23 -08:00
netconsole.c net: netconsole: Add description for 'netconsole_target's extended attribute 2020-11-03 16:40:09 -08:00
nlmon.c net: don't include ethtool.h from netdevice.h 2020-11-23 17:27:04 -08:00
ntb_netdev.c ntb_netdev: Simplify remove with client device drvdata 2018-10-31 21:20:05 -04:00
rionet.c rionet: Fix use correct return type for ndo_start_xmit() 2020-04-30 12:15:13 -07:00
sb1000.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
Space.c net: Space: remove hp100 probe 2021-04-13 15:13:13 -07:00
sungem_phy.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
tap.c net: fix dev_ifsioc_locked() race condition 2021-02-11 18:14:19 -08:00
thunderbolt.c net: thunderbolt: Align the driver to the USB4 networking spec 2021-03-18 18:25:31 +03:00
tun.c net: tun: Remove redundant assignment to ret 2021-04-28 13:58:58 -07:00
veth.c veth: check for NAPI instead of xdp_prog before xmit of XDP frame 2021-04-16 15:42:07 -07:00
virtio_net.c virtio_net: Remove BUG() to avoid machine dead 2021-07-19 10:04:37 +02:00
vrf.c vrf: do not push non-ND strict packets with a source LLA through packet taps again 2021-07-14 17:07:12 +02:00
vsockmon.c net: don't include ethtool.h from netdevice.h 2020-11-23 17:27:04 -08:00
vxlan.c vxlan: add missing rcu_read_lock() in neigh_reduce() 2021-07-14 17:07:14 +02:00
xen-netfront.c bpf, devmap: Move drop error path to devmap for XDP_REDIRECT 2021-03-18 16:38:51 +01:00