diff options
author | Horatiu Vultur <horatiu.vultur@microchip.com> | 2022-10-21 11:07:11 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-10-24 21:04:51 -0700 |
commit | 4a4b6848d1e932b977e6a00cda393adf7e839ff8 (patch) | |
tree | 54bfcab393d9157814938d923cee8df22392c67a /mm/vmalloc.c | |
parent | 4fa86555d1cd338afc6e6308cc1ff890a014ec8c (diff) | |
download | linux-4a4b6848d1e932b977e6a00cda393adf7e839ff8.tar.bz2 |
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: 2ea1cbac267e ("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>
Diffstat (limited to 'mm/vmalloc.c')
0 files changed, 0 insertions, 0 deletions