igb: Fix oops caused by missing queue pairing
[deliverable/linux.git] / drivers / net / ethernet / intel / igb / igb_ethtool.c
index b7b9c670bb3c7e24db5ff9d8e3437af06c27d317..74262768b09b75bd7ad267afb67e720a617bce10 100644 (file)
@@ -3008,6 +3008,7 @@ static int igb_set_channels(struct net_device *netdev,
 {
        struct igb_adapter *adapter = netdev_priv(netdev);
        unsigned int count = ch->combined_count;
+       unsigned int max_combined = 0;
 
        /* Verify they are not requesting separate vectors */
        if (!count || ch->rx_count || ch->tx_count)
@@ -3018,11 +3019,13 @@ static int igb_set_channels(struct net_device *netdev,
                return -EINVAL;
 
        /* Verify the number of channels doesn't exceed hw limits */
-       if (count > igb_max_channels(adapter))
+       max_combined = igb_max_channels(adapter);
+       if (count > max_combined)
                return -EINVAL;
 
        if (count != adapter->rss_queues) {
                adapter->rss_queues = count;
+               igb_set_flag_queue_pairs(adapter, max_combined);
 
                /* Hardware has to reinitialize queues and interrupts to
                 * match the new configuration.
This page took 0.028118 seconds and 5 git commands to generate.