netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net 0/2][pull request] Intel Wired LAN Driver Updates 2015-05-07
@ 2015-05-07 12:21 Jeff Kirsher
  2015-05-07 12:21 ` [net 1/2] igb: Fix oops on changing number of rings Jeff Kirsher
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jeff Kirsher @ 2015-05-07 12:21 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene

This series contains updates to igb only.

Toshiaki provides two fixes for igb, first fixes an issue when changing
the number of rings by ethtool which causes oops because of uninitialized
pointers.  The second fix resolves a typo where tx_ring was used instead
of the desired rx_ring.

The following are changes since commit 31ccd0e66d41f73cfc21a8de976e713455205228:
  tcp_westwood: fix tcp_westwood_info()
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue master

Toshiaki Makita (2):
  igb: Fix oops on changing number of rings
  igb: Fix NULL assignment to incorrect variable in igb_reset_q_vector

 drivers/net/ethernet/intel/igb/igb_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.1.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [net 1/2] igb: Fix oops on changing number of rings
  2015-05-07 12:21 [net 0/2][pull request] Intel Wired LAN Driver Updates 2015-05-07 Jeff Kirsher
@ 2015-05-07 12:21 ` Jeff Kirsher
  2015-05-07 12:21 ` [net 2/2] igb: Fix NULL assignment to incorrect variable in igb_reset_q_vector Jeff Kirsher
  2015-05-10  2:24 ` [net 0/2][pull request] Intel Wired LAN Driver Updates 2015-05-07 David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2015-05-07 12:21 UTC (permalink / raw)
  To: davem; +Cc: Toshiaki Makita, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>

When changing the number of rings by ethtool -L, q_vectors are reused,
which causes oops because of uninitialized pointers.

- When an rx is reused as a tx, q_vector->rx.ring is not set to NULL, which
  misleads igb_poll() to determine that it has an rx ring although it
  actually points to the tx ring.
- When a tx is reused as an rx, q_vector->rx.ring->skb
  (q_vector->ring[0].skb) has a value that was used as tx_stats before.

Fix these problems by zeroing it out on reuseing it.

Fixes: 02ef6e1d0b00 ("igb: Fix queue allocation method to accommodate changing during runtime")
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 8457d03..783d60ea 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1207,6 +1207,8 @@ static int igb_alloc_q_vector(struct igb_adapter *adapter,
 	q_vector = adapter->q_vector[v_idx];
 	if (!q_vector)
 		q_vector = kzalloc(size, GFP_KERNEL);
+	else
+		memset(q_vector, 0, size);
 	if (!q_vector)
 		return -ENOMEM;
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [net 2/2] igb: Fix NULL assignment to incorrect variable in igb_reset_q_vector
  2015-05-07 12:21 [net 0/2][pull request] Intel Wired LAN Driver Updates 2015-05-07 Jeff Kirsher
  2015-05-07 12:21 ` [net 1/2] igb: Fix oops on changing number of rings Jeff Kirsher
@ 2015-05-07 12:21 ` Jeff Kirsher
  2015-05-10  2:24 ` [net 0/2][pull request] Intel Wired LAN Driver Updates 2015-05-07 David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2015-05-07 12:21 UTC (permalink / raw)
  To: davem; +Cc: Toshiaki Makita, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>

adapter->tx_ring is set to NULL where rx_ring should be.

Fixes: 5536d2102a2d ("igb: Combine q_vector and ring allocation into a single function")
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 783d60ea..a0a9b1f 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1036,7 +1036,7 @@ static void igb_reset_q_vector(struct igb_adapter *adapter, int v_idx)
 		adapter->tx_ring[q_vector->tx.ring->queue_index] = NULL;
 
 	if (q_vector->rx.ring)
-		adapter->tx_ring[q_vector->rx.ring->queue_index] = NULL;
+		adapter->rx_ring[q_vector->rx.ring->queue_index] = NULL;
 
 	netif_napi_del(&q_vector->napi);
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [net 0/2][pull request] Intel Wired LAN Driver Updates 2015-05-07
  2015-05-07 12:21 [net 0/2][pull request] Intel Wired LAN Driver Updates 2015-05-07 Jeff Kirsher
  2015-05-07 12:21 ` [net 1/2] igb: Fix oops on changing number of rings Jeff Kirsher
  2015-05-07 12:21 ` [net 2/2] igb: Fix NULL assignment to incorrect variable in igb_reset_q_vector Jeff Kirsher
@ 2015-05-10  2:24 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-05-10  2:24 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu,  7 May 2015 05:21:31 -0700

> This series contains updates to igb only.
> 
> Toshiaki provides two fixes for igb, first fixes an issue when changing
> the number of rings by ethtool which causes oops because of uninitialized
> pointers.  The second fix resolves a typo where tx_ring was used instead
> of the desired rx_ring.

Pulled, thanks Jeff.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-10  2:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-07 12:21 [net 0/2][pull request] Intel Wired LAN Driver Updates 2015-05-07 Jeff Kirsher
2015-05-07 12:21 ` [net 1/2] igb: Fix oops on changing number of rings Jeff Kirsher
2015-05-07 12:21 ` [net 2/2] igb: Fix NULL assignment to incorrect variable in igb_reset_q_vector Jeff Kirsher
2015-05-10  2:24 ` [net 0/2][pull request] Intel Wired LAN Driver Updates 2015-05-07 David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).