archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <>
Cc: Toshiaki Makita <>,,,,, Jeff Kirsher <>
Subject: [net 1/2] igb: Fix oops on changing number of rings
Date: Thu,  7 May 2015 05:21:32 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

From: Toshiaki Makita <>

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 <>
Tested-by: Aaron Brown <>
Signed-off-by: Jeff Kirsher <>
 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;

  reply	other threads:[~2015-05-07 12:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).