mirror_ubuntu-kernels/drivers/net/ethernet
Vladimir Oltean 33cb0ff30c net: mscc: ocelot: don't let phylink re-enable TX PAUSE on the NPI port
Since commit b39648079d ("net: mscc: ocelot: disable flow control on
NPI interface"), flow control should be disabled on the DSA CPU port
when used in NPI mode.

However, the commit blamed in the Fixes: tag below broke this, because
it allowed felix_phylink_mac_link_up() to overwrite SYS_PAUSE_CFG_PAUSE_ENA
for the DSA CPU port.

This issue became noticeable since the device tree update from commit
8fcea7be57 ("arm64: dts: ls1028a: mark internal links between Felix
and ENETC as capable of flow control").

The solution is to check whether this is the currently configured NPI
port from ocelot_phylink_mac_link_up(), and to not modify the statically
disabled PAUSE frame transmission if it is.

When the port is configured for lossless mode as opposed to tail drop
mode, but the link partner (DSA master) doesn't observe the transmitted
PAUSE frames, the switch termination throughput is much worse, as can be
seen below.

Before:

root@debian:~# iperf3 -c 192.168.100.2
Connecting to host 192.168.100.2, port 5201
[  5] local 192.168.100.1 port 37504 connected to 192.168.100.2 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  28.4 MBytes   238 Mbits/sec  357   22.6 KBytes
[  5]   1.00-2.00   sec  33.6 MBytes   282 Mbits/sec  426   19.8 KBytes
[  5]   2.00-3.00   sec  34.0 MBytes   285 Mbits/sec  343   21.2 KBytes
[  5]   3.00-4.00   sec  32.9 MBytes   276 Mbits/sec  354   22.6 KBytes
[  5]   4.00-5.00   sec  32.3 MBytes   271 Mbits/sec  297   18.4 KBytes
^C[  5]   5.00-5.06   sec  2.05 MBytes   270 Mbits/sec   45   19.8 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.06   sec   163 MBytes   271 Mbits/sec  1822             sender
[  5]   0.00-5.06   sec  0.00 Bytes  0.00 bits/sec                  receiver

After:

root@debian:~# iperf3 -c 192.168.100.2
Connecting to host 192.168.100.2, port 5201
[  5] local 192.168.100.1 port 49470 connected to 192.168.100.2 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   112 MBytes   941 Mbits/sec  259    143 KBytes
[  5]   1.00-2.00   sec   110 MBytes   920 Mbits/sec  329    144 KBytes
[  5]   2.00-3.00   sec   112 MBytes   936 Mbits/sec  255    144 KBytes
[  5]   3.00-4.00   sec   110 MBytes   927 Mbits/sec  355    105 KBytes
[  5]   4.00-5.00   sec   110 MBytes   926 Mbits/sec  350    156 KBytes
[  5]   5.00-6.00   sec   110 MBytes   925 Mbits/sec  305    148 KBytes
[  5]   6.00-7.00   sec   110 MBytes   924 Mbits/sec  320    143 KBytes
[  5]   7.00-8.00   sec   110 MBytes   925 Mbits/sec  273   97.6 KBytes
[  5]   8.00-9.00   sec   109 MBytes   913 Mbits/sec  299    141 KBytes
[  5]   9.00-10.00  sec   110 MBytes   922 Mbits/sec  287    146 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.08 GBytes   926 Mbits/sec  3032             sender
[  5]   0.00-10.00  sec  1.08 GBytes   925 Mbits/sec                  receiver

Fixes: de274be32c ("net: dsa: felix: set TX flow control according to the phylink_mac_link_up resolution")
Reported-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-01-13 12:52:15 +00:00
..
3com ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
8390 8390: wd: use eth_hw_addr_set() 2021-11-19 11:05:21 +00:00
actions
adaptec
aeroflex
agere et131x: Remove useless DMA-32 fallback configuration 2022-01-09 16:52:19 -08:00
alacritech
allwinner net: ethernet: sun4i-emac: replace magic number with macro 2022-01-11 20:34:16 -08:00
alteon net: alteon: Simplify DMA setting 2022-01-09 16:52:18 -08:00
altera net: altera: set a couple error code in probe() 2021-12-03 14:23:11 +00:00
amazon net: ena: Extract recurring driver reset code into a function 2022-01-07 19:25:52 -08:00
amd net: amd-xgbe: Disable the CDR workaround path for Yellow Carp Devices 2021-12-20 18:42:40 -08:00
apm net: annotate accesses to queue->trans_start 2021-11-17 14:56:16 +00:00
apple apple: macmace: use eth_hw_addr_set() 2021-11-19 11:05:21 +00:00
aquantia Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-30 12:12:12 -08:00
arc
asix Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-11-26 13:45:19 -08:00
atheros Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-30 12:12:12 -08:00
broadcom bnx2x: Remove useless DMA-32 fallback configuration 2022-01-09 16:52:19 -08:00
brocade bna: Simplify DMA setting 2022-01-09 16:52:18 -08:00
cadence net: macb: use .mac_select_pcs() interface 2022-01-06 12:31:49 +00:00
calxeda
cavium Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-31 14:35:40 +00:00
chelsio libcxgb: Don't accidentally set RTO_ONLINK in cxgb_find_route() 2022-01-11 20:36:08 -08:00
cirrus cirrus: mac89x0: use eth_hw_addr_set() 2021-11-19 11:05:21 +00:00
cisco enic: Remove usage of the deprecated "pci-dma-compat.h" API 2022-01-02 16:14:30 +00:00
cortina net: gemini: allow any RGMII interface mode 2022-01-05 10:31:22 -08:00
davicom
dec net: ethernet: dec: tulip: de4x5: fix possible array overflows in type3_infoblock() 2021-11-18 12:03:17 +00:00
dlink
emulex be2net: Remove useless DMA-32 fallback configuration 2022-01-09 16:52:19 -08:00
engleder tsnep: Fix s390 devm_ioremap_resource warning 2021-12-17 19:22:57 -08:00
ezchip
faraday ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
freescale Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-01-09 17:00:17 -08:00
fujitsu
google gve: Correct order of processing device options 2021-12-20 18:47:56 -08:00
hisilicon net: hns3: create new common cmd code for PF and VF modules 2022-01-05 14:36:37 +00:00
huawei hinic: Remove useless DMA-32 fallback configuration 2022-01-09 16:52:21 -08:00
i825xx 82596: use eth_hw_addr_set() 2021-11-20 12:25:56 +00:00
ibm ethernet: ibmveth: use default_groups in kobj_type 2022-01-06 13:46:23 +00:00
intel iavf: remove an unneeded variable 2022-01-07 09:04:21 -08:00
litex
marvell net: marvell: prestera: Fix deinit sequence for router 2022-01-12 10:17:11 -08:00
mediatek net: ethernet: mtk_eth_soc: implement Clause 45 MDIO access 2022-01-05 11:22:17 +00:00
mellanox mlx5: Don't accidentally set RTO_ONLINK before mlx5e_route_lookup_ipv4_get() 2022-01-11 20:36:09 -08:00
micrel Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-23 16:09:58 -08:00
microchip lan743x: Remove useless DMA-32 fallback configuration 2022-01-09 16:52:21 -08:00
microsoft Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-31 14:35:40 +00:00
moxa
mscc net: mscc: ocelot: don't let phylink re-enable TX PAUSE on the NPI port 2022-01-13 12:52:15 +00:00
myricom myri10ge: Simplify DMA setting 2022-01-09 16:52:18 -08:00
natsemi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-02 11:44:56 -08:00
neterion net: vxge: Use dma_set_mask_and_coherent() and simplify code 2022-01-03 10:42:58 +00:00
netronome Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-31 14:35:40 +00:00
ni nixge: fix mac address error handling again 2021-11-22 15:05:48 +00:00
nvidia ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
nxp
oki-semi net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
packetengines
pasemi ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
pensando Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-30 12:12:12 -08:00
qlogic net/qla3xxx: Remove useless DMA-32 fallback configuration 2022-01-09 16:52:21 -08:00
qualcomm ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
rdc
realtek Power management updates for 5.17-rc1 2022-01-10 20:34:00 -08:00
renesas net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
rocker Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-01-09 17:00:17 -08:00
samsung
seeq
sfc sfc: Use swap() instead of open coding it 2022-01-06 12:39:36 +00:00
sgi
silan
sis
smsc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-23 16:09:58 -08:00
socionext Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-31 14:35:40 +00:00
stmicro net: stmmac: dwmac-oxnas: Add support for OX810SE 2022-01-12 09:05:02 -08:00
sun sun/cassini: Use dma_set_mask_and_coherent() and simplify code 2022-01-02 16:14:30 +00:00
synopsys
tehuti tehuti: Use dma_set_mask_and_coherent() and simplify code 2022-01-02 12:21:16 +00:00
ti Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-31 14:35:40 +00:00
toshiba net: spider_net: Use non-atomic bitmap API when applicable 2021-12-01 18:45:46 -08:00
tundra
vertexcom Revert "net: vertexcom: default to disabled on kbuild" 2022-01-10 21:11:07 -08:00
via
wiznet
xilinx net: xilinx: emaclite: Use platform_get_irq() to get the interrupt 2021-12-27 12:22:19 +00:00
xircom
xscale net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
dnet.c
dnet.h
ec_bhf.c
ethoc.c net: ethoc: Use platform_get_irq() to get the interrupt 2021-12-27 12:22:19 +00:00
fealnx.c
jme.c
jme.h
Kconfig net: vertexcom: Add MSE102x SPI support 2021-12-13 14:15:41 +00:00
korina.c
lantiq_etop.c net: lantiq_etop: remove unnecessary space in cast 2021-12-30 13:20:23 +00:00
lantiq_xrx200.c net: lantiq_xrx200: convert to build_skb 2022-01-05 17:18:04 -08:00
Makefile net: vertexcom: Add MSE102x SPI support 2021-12-13 14:15:41 +00:00