linux/drivers/net/ethernet/sun
Sean Anderson 878e240571 net: sunhme: Fix packet reception for len < RX_COPY_THRESHOLD
There is a separate receive path for small packets (under 256 bytes).
Instead of allocating a new dma-capable skb to be used for the next packet,
this path allocates a skb and copies the data into it (reusing the existing
sbk for the next packet). There are two bytes of junk data at the beginning
of every packet. I believe these are inserted in order to allow aligned DMA
and IP headers. We skip over them using skb_reserve. Before copying over
the data, we must use a barrier to ensure we see the whole packet. The
current code only synchronizes len bytes, starting from the beginning of
the packet, including the junk bytes. However, this leaves off the final
two bytes in the packet. Synchronize the whole packet.

To reproduce this problem, ping a HME with a payload size between 17 and
214

	$ ping -s 17 <hme_address>

which will complain rather loudly about the data mismatch. Small packets
(below 60 bytes on the wire) do not have this issue. I suspect this is
related to the padding added to increase the minimum packet size.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220920235018.1675956-1-seanga2@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-09-22 06:44:28 -07:00
..
cassini.c ethernet/sun: fix repeated words in comments 2022-07-01 20:13:19 -07:00
cassini.h ethernet/sun: fix repeated words in comments 2022-07-01 20:13:19 -07:00
Kconfig net: sun: SUNVNET_COMMON should depend on INET 2021-09-28 13:20:21 +01:00
ldmvsw.c ethernet/sun: fix repeated words in comments 2022-07-01 20:13:19 -07:00
Makefile
niu.c niu: Silence randstruct warnings 2022-05-16 16:02:21 -07:00
niu.h
sunbmac.c ethernet: replace netdev->dev_addr assignment loops 2021-10-14 09:22:25 -07:00
sunbmac.h
sungem.c ethernet/sun: fix repeated words in comments 2022-07-01 20:13:19 -07:00
sungem.h
sunhme.c net: sunhme: Fix packet reception for len < RX_COPY_THRESHOLD 2022-09-22 06:44:28 -07:00
sunhme.h
sunqe.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
sunqe.h
sunvnet_common.c
sunvnet_common.h
sunvnet.c ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00