]> git.baikalelectronics.ru Git - kernel.git/commit
amd-xgbe: Fix jumbo MTU processing on newer hardware
authorLendacky, Thomas <Thomas.Lendacky@amd.com>
Wed, 15 Mar 2017 20:11:23 +0000 (15:11 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Mar 2017 22:36:59 +0000 (15:36 -0700)
commite4ecd2e3f69fa8442bcdd46dd07aad82b1dc1f95
treeec226a79b715c42196585b48f8e9ada57a7054ce
parentc4173eabd50250b80ffe36845a9e7f96f5219941
amd-xgbe: Fix jumbo MTU processing on newer hardware

Newer hardware does not provide a cumulative payload length when multiple
descriptors are needed to handle the data. Once the MTU increases beyond
the size that can be handled by a single descriptor, the SKB does not get
built properly by the driver.

The driver will now calculate the size of the data buffers used by the
hardware.  The first buffer of the first descriptor is for packet headers
or packet headers and data when the headers can't be split. Subsequent
descriptors in a multi-descriptor chain will not use the first buffer. The
second buffer is used by all the descriptors in the chain for payload data.
Based on whether the driver is processing the first, intermediate, or last
descriptor it can calculate the buffer usage and build the SKB properly.

Tested and verified on both old and new hardware.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/xgbe/xgbe-common.h
drivers/net/ethernet/amd/xgbe/xgbe-dev.c
drivers/net/ethernet/amd/xgbe/xgbe-drv.c