RE: [PATCH net] igb: Fix oops caused by missing queue pairing

From: Brown, Aaron F
Date: Fri Aug 14 2015 - 21:42:53 EST

> From: netdev-owner@xxxxxxxxxxxxxxx [mailto:netdev-owner@xxxxxxxxxxxxxxx]
> On Behalf Of Shota Suzuki
> Sent: Tuesday, June 30, 2015 5:26 PM
> To: Kirsher, Jeffrey T; Brandeburg, Jesse; Nelson, Shannon; Wyborny,
> Carolyn; Skidmore, Donald C; Vick, Matthew; Ronciak, John; Williams, Mitch
> A; intel-wired-lan@xxxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Cc: Shota Suzuki
> Subject: [PATCH net] igb: Fix oops caused by missing queue pairing
> When initializing igb driver (e.g. 82576, I350), IGB_FLAG_QUEUE_PAIRS is
> set if adapter->rss_queues exceeds half of max_rss_queues in
> igb_init_queue_configuration().
> On the other hand, IGB_FLAG_QUEUE_PAIRS is not set even if the number of
> queues exceeds half of max_combined in igb_set_channels() when changing
> the number of queues by "ethtool -L".
> In this case, if numvecs is larger than MAX_MSIX_ENTRIES (10), the size
> of adapter->msix_entries[], an overflow can occur in
> igb_set_interrupt_capability(), which in turn leads to an oops.
> Fix this problem as follows:
> - When changing the number of queues by "ethtool -L", set
> IGB_FLAG_QUEUE_PAIRS in the same way as initializing igb driver.
> - When increasing the size of q_vector, reallocate it appropriately.
> (With IGB_FLAG_QUEUE_PAIRS set, the size of q_vector gets larger.)
> Another possible way to fix this problem is to cap the queues at its
> initial number, which is the number of the initial online cpus. But this
> is not the optimal way because we cannnot increase queues when another
> cpu becomes online.
> Note that before commit cd14ef54d25b ("igb: Change to use statically
> allocated array for MSIx entries"), this problem did not cause oops
> but just made the number of queues become 1 because of entering msi_only
> mode in igb_set_interrupt_capability().
> Fixes: 907b7835799f ("igb: Add ethtool support to configure number of
> channels")
> Signed-off-by: Shota Suzuki <suzuki_shota_t3@xxxxxxxxxxxxx>
> ---
> Although we might be able to additionally unset IGB_FLAG_QUEUE_PAIRS
> when it is not needed, this patch doesn't change existing behaviour
> because such a change is not a bug fix.
> drivers/net/ethernet/intel/igb/igb.h | 1 +
> drivers/net/ethernet/intel/igb/igb_ethtool.c | 5 ++++-
> drivers/net/ethernet/intel/igb/igb_main.c | 16 ++++++++++++++--
> 3 files changed, 19 insertions(+), 3 deletions(-)

Tested-by: Aaron Brown <aaron.f.brown@xxxxxxxxx>
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at