linux-stable/drivers/net/ethernet/microchip/lan966x
Horatiu Vultur 4a4b6848d1 net: lan966x: Stop replacing tx dcbs and dcbs_buf when changing MTU
When a frame is sent using FDMA, the skb is mapped and then the mapped
address is given to an tx dcb that is different than the last used tx
dcb. Once the HW finish with this frame, it would generate an interrupt
and then the dcb can be reused and memory can be freed. For each dcb
there is an dcb buf that contains some meta-data(is used by PTP, is
it free). There is 1 to 1 relationship between dcb and dcb_buf.
The following issue was observed. That sometimes after changing the MTU
to allocate new tx dcbs and dcbs_buf, two frames were not
transmitted. The frames were not transmitted because when reloading the
tx dcbs, it was always presuming to use the first dcb but that was not
always happening. Because it could be that the last tx dcb used before
changing MTU was first dcb and then when it tried to get the next dcb it
would take dcb 1 instead of 0. Because it is supposed to take a
different dcb than the last used one. This can be fixed simply by
changing tx->last_in_use to -1 when the fdma is disabled to reload the
new dcb and dcbs_buff.
But there could be a different issue. For example, right after the frame
is sent, the MTU is changed. Now all the dcbs and dcbs_buf will be
cleared. And now get the interrupt from HW that it finished with the
frame. So when we try to clear the skb, it is not possible because we
lost all the dcbs_buf.
The solution here is to stop replacing the tx dcbs and dcbs_buf when
changing MTU because the TX doesn't care what is the MTU size, it is
only the RX that needs this information.

Fixes: 2ea1cbac26 ("net: lan966x: Update FDMA to change MTU.")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Link: https://lore.kernel.org/r/20221021090711.3749009-1-horatiu.vultur@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-10-24 21:04:51 -07:00
..
Kconfig net: lan966x: Add lag support for lan966x 2022-08-22 14:00:54 +01:00
lan966x_cbs.c net: lan966x: Add offload support for cbs 2022-09-28 09:36:28 +01:00
lan966x_ethtool.c net: lan966x: Fix the rx drop counter 2022-10-20 21:08:54 -07:00
lan966x_ets.c net: lan966x: Add offload support for ets 2022-09-28 09:36:28 +01:00
lan966x_fdb.c net: lan966x: Extend FDB to support also lag 2022-08-22 14:00:54 +01:00
lan966x_fdma.c net: lan966x: Stop replacing tx dcbs and dcbs_buf when changing MTU 2022-10-24 21:04:51 -07:00
lan966x_ifh.h
lan966x_lag.c net: lan966x: Extend MAC to support also lag interfaces. 2022-08-22 14:00:54 +01:00
lan966x_mac.c net: lan966x: Extend MAC to support also lag interfaces. 2022-08-22 14:00:54 +01:00
lan966x_main.c net: lan966x: Fix return type of lan966x_port_xmit 2022-10-03 16:40:16 -07:00
lan966x_main.h net: lan966x: Add port mirroring support using tc-matchall 2022-10-03 12:46:46 +01:00
lan966x_mdb.c net: lan966x: Update mdb when enabling/disabling mcast_snooping 2022-02-05 15:00:43 +00:00
lan966x_mirror.c net: lan966x: Add port mirroring support using tc-matchall 2022-10-03 12:46:46 +01:00
lan966x_mqprio.c net: lan966x: Fix spelling mistake "tarffic" -> "traffic" 2022-09-30 12:34:01 +01:00
lan966x_phylink.c net: lan966x: Extend lan966x with RGMII support 2022-09-06 10:00:28 +02:00
lan966x_police.c net: lan966x: Add port police support using tc-matchall 2022-10-03 12:46:46 +01:00
lan966x_port.c net: lan966x: Add offload support for taprio 2022-09-23 12:31:27 +01:00
lan966x_ptp.c net: lan966x: Add offload support for taprio 2022-09-23 12:31:27 +01:00
lan966x_regs.h net: lan966x: Add port mirroring support using tc-matchall 2022-10-03 12:46:46 +01:00
lan966x_switchdev.c net: lan966x: Extend FDB to support also lag 2022-08-22 14:00:54 +01:00
lan966x_taprio.c net: lan966x: Add offload support for taprio 2022-09-23 12:31:27 +01:00
lan966x_tbf.c net: lan966x: Add offload support for tbf 2022-09-28 09:36:28 +01:00
lan966x_tc.c net: lan966x: Add port police support using tc-matchall 2022-10-03 12:46:46 +01:00
lan966x_tc_matchall.c net: lan966x: Add port mirroring support using tc-matchall 2022-10-03 12:46:46 +01:00
lan966x_vlan.c
Makefile net: lan966x: Add port mirroring support using tc-matchall 2022-10-03 12:46:46 +01:00