be2net: set maximal number of default RSS queues
authorYuval Mintz <[email protected]>
Sun, 1 Jul 2012 03:19:00 +0000 (03:19 +0000)
committerDavid S. Miller <[email protected]>
Thu, 5 Jul 2012 10:06:45 +0000 (03:06 -0700)
Signed-off-by: Yuval Mintz <[email protected]>
Signed-off-by: Eilon Greenstein <[email protected]>
Cc: Sathya Perla <[email protected]>
Cc: Subbu Seetharaman <[email protected]>
Cc: Ajit Khaparde <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/ethernet/emulex/benet/be_main.c

index edce7af97c873b51dbff9dbef4f91d740bd45a21..2141bd78475106f8c7d05b570229aa727edb0b67 100644 (file)
@@ -2172,12 +2172,14 @@ static void be_msix_disable(struct be_adapter *adapter)
 
 static uint be_num_rss_want(struct be_adapter *adapter)
 {
+       u32 num = 0;
        if ((adapter->function_caps & BE_FUNCTION_CAPS_RSS) &&
             !sriov_want(adapter) && be_physfn(adapter) &&
-            !be_is_mc(adapter))
-               return (adapter->be3_native) ? BE3_MAX_RSS_QS : BE2_MAX_RSS_QS;
-       else
-               return 0;
+            !be_is_mc(adapter)) {
+               num = (adapter->be3_native) ? BE3_MAX_RSS_QS : BE2_MAX_RSS_QS;
+               num = min_t(u32, num, (u32)netif_get_num_default_rss_queues());
+       }
+       return num;
 }
 
 static void be_msix_enable(struct be_adapter *adapter)