qlcnic: fix initial number of msix entries in adapter.
authorSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Wed, 22 Jun 2011 02:52:20 +0000 (02:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Jun 2011 08:17:07 +0000 (01:17 -0700)
Calculation of number of MSI-X vectors was wrong on uniprocessor
systems.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/qlcnic/qlcnic.h
drivers/net/qlcnic/qlcnic_main.c

index e5bb33253f94f46ba03aa236ccba10b90f677db2..58d7616eaee2c5b0b22694e8ae008267fb8abc28 100644 (file)
@@ -900,7 +900,6 @@ struct qlcnic_ipaddr {
        ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
 
 #define QLCNIC_DEF_NUM_STS_DESC_RINGS  4
-#define QLCNIC_MIN_NUM_RSS_RINGS       2
 #define QLCNIC_MSIX_TBL_SPACE          8192
 #define QLCNIC_PCI_REG_MSIX_TBL        0x44
 #define QLCNIC_MSIX_TBL_PGSIZE         4096
index a656a12e24d1dfd0afcbdc6c182523cbe83bcd6e..a050746a51291a321eab41352f71bc991352f44d 100644 (file)
@@ -418,10 +418,8 @@ qlcnic_setup_intr(struct qlcnic_adapter *adapter)
        int num_msix;
 
        if (adapter->msix_supported) {
-               num_msix = (num_online_cpus() >=
-                       QLCNIC_DEF_NUM_STS_DESC_RINGS) ?
-                       QLCNIC_DEF_NUM_STS_DESC_RINGS :
-                       QLCNIC_MIN_NUM_RSS_RINGS;
+               num_msix = rounddown_pow_of_two(min_t(int, num_online_cpus(),
+                               QLCNIC_DEF_NUM_STS_DESC_RINGS));
        } else
                num_msix = 1;