Patch "amd-xgbe: Fix jumbo MTU processing on newer hardware" has been added to the 4.9-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
amd-xgbe: Fix jumbo MTU processing on newer hardware
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
amd-xgbe-fix-jumbo-mtu-processing-on-newer-hardware.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Mon Mar 27 18:17:54 CEST 2017
From: "Lendacky, Thomas" <[email protected]>
Date: Wed, 15 Mar 2017 15:11:23 -0500
Subject: amd-xgbe: Fix jumbo MTU processing on newer hardware
From: "Lendacky, Thomas" <[email protected]>
[ Upstream commit 622c36f143fc9566ba49d7cec994c2da1182d9e2 ]
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.
--- drivers/net/ethernet/amd/xgbe/xgbe-common.h | 6 + drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 20 +++-- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 102 +++++++++++++++++----------- 3 files changed, 78 insertions(+), 50 deletions(-)
drivers/net/ethernet/amd/xgbe/xgbe-common.h +4 -2
@@ -917,8 +917,8 @@#define RX_PACKET_ATTRIBUTES_CSUM_DONE_WIDTH 1#define RX_PACKET_ATTRIBUTES_VLAN_CTAG_INDEX 1#define RX_PACKET_ATTRIBUTES_VLAN_CTAG_WIDTH 1 -#define RX_PACKET_ATTRIBUTES_INCOMPLETE_INDEX 2 -#define RX_PACKET_ATTRIBUTES_INCOMPLETE_WIDTH 1 +#define RX_PACKET_ATTRIBUTES_LAST_INDEX 2 +#define RX_PACKET_ATTRIBUTES_LAST_WIDTH 1#define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_INDEX 3#define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_WIDTH 1#define RX_PACKET_ATTRIBUTES_CONTEXT_INDEX 4
@@ -927,6 +927,8 @@#define RX_PACKET_ATTRIBUTES_RX_TSTAMP_WIDTH 1#define RX_PACKET_ATTRIBUTES_RSS_HASH_INDEX 6#define RX_PACKET_ATTRIBUTES_RSS_HASH_WIDTH 1 +#define RX_PACKET_ATTRIBUTES_FIRST_INDEX 7 +#define RX_PACKET_ATTRIBUTES_FIRST_WIDTH 1#define RX_NORMAL_DESC0_OVT_INDEX 0#define RX_NORMAL_DESC0_OVT_WIDTH 16
drivers/net/ethernet/amd/xgbe/xgbe-dev.c +11 -9
@@ -1721,10 +1721,15 @@ static int xgbe_dev_read(struct xgbe_cha/* Get the header length */ if (XGMAC_GET_BITS_LE (rdesc->desc3,RX_NORMAL_DESC3 ,FD )) { +XGMAC_SET_BITS (packet->attributes,RX_PACKET_ATTRIBUTES , +FIRST ,1 ); rdata->rx.hdr_len =XGMAC_GET_BITS_LE (rdesc->desc2,RX_NORMAL_DESC2 ,HL );if (rdata->rx.hdr_len) pdata->ext_stats.rx_split_header_packets++; + }else { +XGMAC_SET_BITS (packet->attributes,RX_PACKET_ATTRIBUTES , +FIRST ,0 ); }/* Get the RSS hash */
@@ -1747,19 +1752,16 @@ static int xgbe_dev_read(struct xgbe_cha } } -/* Get the packet length */ - rdata->rx.len =XGMAC_GET_BITS_LE (rdesc->desc3,RX_NORMAL_DESC3 ,PL ); - -if (!XGMAC_GET_BITS_LE (rdesc->desc3,RX_NORMAL_DESC3 ,LD )) { -/* Not all the data has been transferred for this packet */ -XGMAC_SET_BITS (packet->attributes,RX_PACKET_ATTRIBUTES , -INCOMPLETE ,1 ); +/* Not all the data has been transferred for this packet */ +if (!XGMAC_GET_BITS_LE (rdesc->desc3,RX_NORMAL_DESC3 ,LD ))return 0 ; - }/* This is the last of the data for this packet */ XGMAC_SET_BITS (packet->attributes,RX_PACKET_ATTRIBUTES , -INCOMPLETE ,0 ); +LAST ,1 ); + +/* Get the packet length */ + rdata->rx.len =XGMAC_GET_BITS_LE (rdesc->desc3,RX_NORMAL_DESC3 ,PL );/* Set checksum done indicator as appropriate */ if (netdev->features &NETIF_F_RXCSUM )
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +63 -39
173 lines not on this page · raw message
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/amd-xgbe-fix-jumbo-mtu-processing-on-newer-hardware.patch