Patch "[PATCH 010/135] i40e: Fix Rx hash reported to the stack by our driver" has been added to the 4.4-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
[PATCH 010/135] i40e: Fix Rx hash reported to the stack by our driver
to the 4.4-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:
0010-i40e-Fix-Rx-hash-reported-to-the-stack-by-our-driver.patch
and it can be found in the queue-4.4 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
c792f057b4b05e56408402204372b8e7e6eff4ecMon Sep 17 00:00:00 2001
From: Anjali Singhai Jain <[email protected]>
Date: Wed, 9 Dec 2015 15:50:21 -0800
Subject: [PATCH 010/135] i40e: Fix Rx hash reported to the stack by our driver
[ Upstream commit 857942fd1aa15edf7356a4a4bad5369c8e70a633 ]
If the driver calls skb_set_hash even with a zero hash, that indicates to the stack that the hash calculation is offloaded in hardware. So the Stack doesn't do a SW hash which is required for load balancing if the user decides to turn of rx-hashing on our device.
This patch fixes the path so that we do not call skb_set_hash if the feature is disabled.
--- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 54 +++++++++++++------------- drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 54 +++++++++++++------------- 2 files changed, 58 insertions(+), 50 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +29 -25
@@ -1425,31 +1425,12 @@ checksum_fail: }/** -* i40e_rx_hash - returns the hash value from the Rx descriptor -* @ring: descriptor ring -* @rx_desc: specific descriptor -**/ -static inline u32 i40e_rx_hash (struct i40e_ring *ring, -union i40e_rx_desc *rx_desc) -{ -const __le64 rss_mask = -cpu_to_le64 ((u64 )I40E_RX_DESC_FLTSTAT_RSS_HASH << -I40E_RX_DESC_STATUS_FLTSTAT_SHIFT ); - -if ((ring->netdev->features &NETIF_F_RXHASH ) && - (rx_desc->wb.qword1.status_error_len & rss_mask) == rss_mask) -return le32_to_cpu (rx_desc->wb.qword0.hi_dword.rss); -else -return 0 ; -} - -/** -* i40e_ptype_to_hash - get a hash type +* i40e_ptype_to_htype - get a hash type * @ptype: the ptype value from the descriptor * * Returns a hash type to be used by skb_set_hash **/ -static inline enum pkt_hash_types i40e_ptype_to_hash (u8 ptype) +static inline enum pkt_hash_types i40e_ptype_to_htype (u8 ptype) {struct i40e_rx_ptype_decoded decoded =decode_rx_desc_ptype (ptype);
@@ -1467,6 +1448,30 @@ static inline enum pkt_hash_types i40e_p }/** +* i40e_rx_hash - set the hash value in the skb +* @ring: descriptor ring +* @rx_desc: specific descriptor +**/ +static inline void i40e_rx_hash (struct i40e_ring *ring, +union i40e_rx_desc *rx_desc, +struct sk_buff *skb, +u8 rx_ptype) +{ +u32 hash; +const __le64 rss_mask = +cpu_to_le64 ((u64 )I40E_RX_DESC_FLTSTAT_RSS_HASH << +I40E_RX_DESC_STATUS_FLTSTAT_SHIFT ); + +if (ring->netdev->features &NETIF_F_RXHASH ) +return ; + +if ((rx_desc->wb.qword1.status_error_len & rss_mask) == rss_mask) { + hash =le32_to_cpu (rx_desc->wb.qword0.hi_dword.rss); +skb_set_hash (skb, hash,i40e_ptype_to_htype (rx_ptype)); + } +} + +/** * i40e_clean_rx_irq_ps - Reclaim resources after receive; packet split * @rx_ring: rx ring to clean * @budget: how many cleans we're allowed
@@ -1615,8 +1620,8 @@ static int i40e_clean_rx_irq_ps(struct icontinue ; } -skb_set_hash (skb,i40e_rx_hash (rx_ring, rx_desc), -i40e_ptype_to_hash (rx_ptype)); +i40e_rx_hash (rx_ring, rx_desc, skb, rx_ptype); +if (unlikely (rx_status &I40E_RXD_QW1_STATUS_TSYNVALID_MASK )) { i40e_ptp_rx_hwtstamp(vsi->back, skb, (rx_status & I40E_RXD_QW1_STATUS_TSYNINDX_MASK) >>
@@ -1745,8 +1750,7 @@ static int i40e_clean_rx_irq_1buf(structcontinue ; } -skb_set_hash (skb,i40e_rx_hash (rx_ring, rx_desc), -i40e_ptype_to_hash (rx_ptype)); +i40e_rx_hash (rx_ring, rx_desc, skb, rx_ptype);if (unlikely (rx_status &I40E_RXD_QW1_STATUS_TSYNVALID_MASK )) { i40e_ptp_rx_hwtstamp(vsi->back, skb, (rx_status & I40E_RXD_QW1_STATUS_TSYNINDX_MASK) >>
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +29 -25
82 lines not on this page · raw message
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/0010-i40e-Fix-Rx-hash-reported-to-the-stack-by-our-driver.patch queue-4.4/0074-i40e-i40evf-Fix-RSS-rx-flow-hash-configuration-throu.patch queue-4.4/0001-i40e-Workaround-fix-for-mss-256-issue.patch queue-4.4/0003-i40e-i40evf-Fix-RS-bit-update-in-Tx-path-and-disable.patch