linux_dsm_epyc7002/drivers/net/ethernet/freescale
Fugang Duan 1d304c7ddd net: fec: add ndo_select_queue to fix TX bandwidth fluctuations
[ Upstream commit 52c4a1a85f4b346c39c896c0168f4a843b3385ff ]

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>
2021-07-19 09:44:51 +02:00
..
dpaa dpaa_eth: copy timestamp fields to new skb in A-050385 workaround 2020-12-02 11:51:45 -08:00
dpaa2 dpaa2-eth: fix memory leak in XDP_REDIRECT 2021-03-04 11:37:31 +01:00
enetc net: enetc: set MAC RX FIFO to recommended value 2021-03-30 14:31:50 +02:00
fman ethernet: select CONFIG_CRC32 as needed 2020-12-04 14:42:21 -08:00
fs_enet net: ethernet: fs_enet: Add missing MODULE_LICENSE 2021-01-19 18:27:26 +01:00
fec_main.c net: fec: add ndo_select_queue to fix TX bandwidth fluctuations 2021-07-19 09:44:51 +02:00
fec_mpc52xx_phy.c
fec_mpc52xx.c net: fec_mpc52xx: Replace in_interrupt() usage 2020-09-29 14:02:54 -07:00
fec_mpc52xx.h
fec_ptp.c net: fec_ptp: add clock rate zero check 2021-06-23 14:42:54 +02:00
fec.h net: fec: fix MDIO probing for some FEC hardware blocks 2020-10-30 08:24:12 -07:00
fsl_pq_mdio.c
gianfar_ethtool.c net: gianfar: reject unsupported coalescing params 2020-03-12 11:32:35 -07:00
gianfar.c gianfar: Handle error code at MAC address change 2021-04-14 08:42:07 +02:00
gianfar.h net/freescale: Clean drivers from static versions 2020-03-03 17:54:55 -08:00
Kconfig ethernet: select CONFIG_CRC32 as needed 2020-12-04 14:42:21 -08:00
Makefile net: enetc: fix link error again 2021-05-14 09:50:43 +02:00
ucc_geth_ethtool.c net/freescale: Don't set zero if FW not-available in ucc_geth 2020-03-03 17:54:55 -08:00
ucc_geth.c ethernet: ucc_geth: set dev->max_mtu to 1518 2021-01-12 20:18:09 +01:00
ucc_geth.h ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram 2021-01-19 18:27:24 +01:00
xgmac_mdio.c net/fsl: quieten expected MDIO access failures 2020-09-24 20:13:26 -07:00