* [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-10-10
@ 2017-10-10 15:14 Jeff Kirsher
2017-10-10 15:14 ` [net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word() Jeff Kirsher
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jeff Kirsher @ 2017-10-10 15:14 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene
This series contains updates to i40e only.
Stefano Brivio fixes the grammar in a function header comment.
Alex fixes a memory leak where we were not correctly placing the pages
from buffers that had been used to return a filter programming status
back on the ring.
The following are changes since commit 529a86e063e9ff625c4ff247d8aa17d8072444fb:
Merge branch 'ppc-bundle' (bundle from Michael Ellerman)
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue 40GbE
Alexander Duyck (1):
i40e: Fix memory leak related filter programming status
Stefano Brivio (1):
i40e: Fix comment about locking for __i40e_read_nvm_word()
drivers/net/ethernet/intel/i40e/i40e_nvm.c | 2 +-
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 63 ++++++++++++++++-------------
2 files changed, 37 insertions(+), 28 deletions(-)
--
2.14.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word()
2017-10-10 15:14 [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-10-10 Jeff Kirsher
@ 2017-10-10 15:14 ` Jeff Kirsher
2017-10-10 15:14 ` [net 2/2] i40e: Fix memory leak related filter programming status Jeff Kirsher
2017-10-10 20:17 ` [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-10-10 David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2017-10-10 15:14 UTC (permalink / raw)
To: davem; +Cc: Stefano Brivio, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Stefano Brivio <sbrivio@redhat.com>
Caller needs to acquire the lock. Called functions will not.
Fixes: 09f79fd49d94 ("i40e: avoid NVM acquire deadlock during NVM update")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_nvm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
index 57505b1df98d..d591b3e6bd7c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
@@ -298,7 +298,7 @@ static i40e_status i40e_read_nvm_word_aq(struct i40e_hw *hw, u16 offset,
}
/**
- * __i40e_read_nvm_word - Reads nvm word, assumes called does the locking
+ * __i40e_read_nvm_word - Reads nvm word, assumes caller does the locking
* @hw: pointer to the HW structure
* @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF)
* @data: word read from the Shadow RAM
--
2.14.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [net 2/2] i40e: Fix memory leak related filter programming status
2017-10-10 15:14 [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-10-10 Jeff Kirsher
2017-10-10 15:14 ` [net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word() Jeff Kirsher
@ 2017-10-10 15:14 ` Jeff Kirsher
2017-10-10 20:17 ` [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-10-10 David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2017-10-10 15:14 UTC (permalink / raw)
To: davem; +Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
From: Alexander Duyck <alexander.h.duyck@intel.com>
It looks like we weren't correctly placing the pages from buffers that had
been used to return a filter programming status back on the ring. As a
result they were being overwritten and tracking of the pages was lost.
This change works to correct that by incorporating part of
i40e_put_rx_buffer into the programming status handler code. As a result we
should now be correctly placing the pages for those buffers on the
re-allocation list instead of letting them stay in place.
Fixes: 0e626ff7ccbf ("i40e: Fix support for flow director programming status")
Reported-by: Anders K. Pedersen <akp@cohaesio.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Anders K Pedersen <akp@cohaesio.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 63 ++++++++++++++++-------------
1 file changed, 36 insertions(+), 27 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 1519dfb851d0..2756131495f0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1037,6 +1037,32 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
return false;
}
+/**
+ * i40e_reuse_rx_page - page flip buffer and store it back on the ring
+ * @rx_ring: rx descriptor ring to store buffers on
+ * @old_buff: donor buffer to have page reused
+ *
+ * Synchronizes page for reuse by the adapter
+ **/
+static void i40e_reuse_rx_page(struct i40e_ring *rx_ring,
+ struct i40e_rx_buffer *old_buff)
+{
+ struct i40e_rx_buffer *new_buff;
+ u16 nta = rx_ring->next_to_alloc;
+
+ new_buff = &rx_ring->rx_bi[nta];
+
+ /* update, and store next to alloc */
+ nta++;
+ rx_ring->next_to_alloc = (nta < rx_ring->count) ? nta : 0;
+
+ /* transfer page from old buffer to new buffer */
+ new_buff->dma = old_buff->dma;
+ new_buff->page = old_buff->page;
+ new_buff->page_offset = old_buff->page_offset;
+ new_buff->pagecnt_bias = old_buff->pagecnt_bias;
+}
+
/**
* i40e_rx_is_programming_status - check for programming status descriptor
* @qw: qword representing status_error_len in CPU ordering
@@ -1071,15 +1097,24 @@ static void i40e_clean_programming_status(struct i40e_ring *rx_ring,
union i40e_rx_desc *rx_desc,
u64 qw)
{
- u32 ntc = rx_ring->next_to_clean + 1;
+ struct i40e_rx_buffer *rx_buffer;
+ u32 ntc = rx_ring->next_to_clean;
u8 id;
/* fetch, update, and store next to clean */
+ rx_buffer = &rx_ring->rx_bi[ntc++];
ntc = (ntc < rx_ring->count) ? ntc : 0;
rx_ring->next_to_clean = ntc;
prefetch(I40E_RX_DESC(rx_ring, ntc));
+ /* place unused page back on the ring */
+ i40e_reuse_rx_page(rx_ring, rx_buffer);
+ rx_ring->rx_stats.page_reuse_count++;
+
+ /* clear contents of buffer_info */
+ rx_buffer->page = NULL;
+
id = (qw & I40E_RX_PROG_STATUS_DESC_QW1_PROGID_MASK) >>
I40E_RX_PROG_STATUS_DESC_QW1_PROGID_SHIFT;
@@ -1638,32 +1673,6 @@ static bool i40e_cleanup_headers(struct i40e_ring *rx_ring, struct sk_buff *skb,
return false;
}
-/**
- * i40e_reuse_rx_page - page flip buffer and store it back on the ring
- * @rx_ring: rx descriptor ring to store buffers on
- * @old_buff: donor buffer to have page reused
- *
- * Synchronizes page for reuse by the adapter
- **/
-static void i40e_reuse_rx_page(struct i40e_ring *rx_ring,
- struct i40e_rx_buffer *old_buff)
-{
- struct i40e_rx_buffer *new_buff;
- u16 nta = rx_ring->next_to_alloc;
-
- new_buff = &rx_ring->rx_bi[nta];
-
- /* update, and store next to alloc */
- nta++;
- rx_ring->next_to_alloc = (nta < rx_ring->count) ? nta : 0;
-
- /* transfer page from old buffer to new buffer */
- new_buff->dma = old_buff->dma;
- new_buff->page = old_buff->page;
- new_buff->page_offset = old_buff->page_offset;
- new_buff->pagecnt_bias = old_buff->pagecnt_bias;
-}
-
/**
* i40e_page_is_reusable - check if any reuse is possible
* @page: page struct to check
--
2.14.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-10-10
2017-10-10 15:14 [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-10-10 Jeff Kirsher
2017-10-10 15:14 ` [net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word() Jeff Kirsher
2017-10-10 15:14 ` [net 2/2] i40e: Fix memory leak related filter programming status Jeff Kirsher
@ 2017-10-10 20:17 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-10-10 20:17 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 10 Oct 2017 08:14:14 -0700
> This series contains updates to i40e only.
Pulled, thanks Jeff.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-10 20:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-10 15:14 [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-10-10 Jeff Kirsher
2017-10-10 15:14 ` [net 1/2] i40e: Fix comment about locking for __i40e_read_nvm_word() Jeff Kirsher
2017-10-10 15:14 ` [net 2/2] i40e: Fix memory leak related filter programming status Jeff Kirsher
2017-10-10 20:17 ` [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-10-10 David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.