aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vmxnet3/vmxnet3_drv.c
diff options
context:
space:
mode:
authorShreyas Bhatewara <sbhatewara@vmware.com>2011-07-07 00:25:52 -0700
committerDavid S. Miller <davem@davemloft.net>2011-07-07 00:25:52 -0700
commiteebb02b1f03b3722d678bfcb560f3b26661ab0d2 (patch)
tree6a133a4faa1278c2faf93962c19269f93b076edc /drivers/net/vmxnet3/vmxnet3_drv.c
parentnet: sh_eth: fix the parameter for the ETHER of SH7757 (diff)
downloadlinux-dev-eebb02b1f03b3722d678bfcb560f3b26661ab0d2.tar.xz
linux-dev-eebb02b1f03b3722d678bfcb560f3b26661ab0d2.zip
vmxnet3: round down # of queues to power of two
vmxnet3 device supports only power-of-two number of queues. The driver therefore needs to check this and rounds down the number of queues to the nearest power of two. Signed-off-by: Yong Wang <yongwang@vmware.com> Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com> Reviewed-by: Dmitry Torokhov <dtor@vmware.com>
Diffstat (limited to 'drivers/net/vmxnet3/vmxnet3_drv.c')
-rw-r--r--drivers/net/vmxnet3/vmxnet3_drv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 45a23b2599f3..67402350d0df 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -2947,6 +2947,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
else
#endif
num_rx_queues = 1;
+ num_rx_queues = rounddown_pow_of_two(num_rx_queues);
if (enable_mq)
num_tx_queues = min(VMXNET3_DEVICE_MAX_TX_QUEUES,
@@ -2954,6 +2955,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
else
num_tx_queues = 1;
+ num_tx_queues = rounddown_pow_of_two(num_tx_queues);
netdev = alloc_etherdev_mq(sizeof(struct vmxnet3_adapter),
max(num_tx_queues, num_rx_queues));
printk(KERN_INFO "# of Tx queues : %d, # of Rx queues : %d\n",
@@ -3138,6 +3140,7 @@ vmxnet3_remove_device(struct pci_dev *pdev)
else
#endif
num_rx_queues = 1;
+ num_rx_queues = rounddown_pow_of_two(num_rx_queues);
cancel_work_sync(&adapter->work);