Skip to contentSkip to conversation

vmxnet3: fix ethtool ring buffer size setting

PATCH Applied Neil Horman 2 participants 2 messages Feb 22, 2013 – Feb 25, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vmxnet3: fix ethtool ring buffer size setting

Noticed that vmxnet3's get_ringparam function was returning the summation of all ring buffers on a NIC, rather than just the size of any one ring. This causes problems when a vmxnet3 instance has multiple queues, as ethtool, when setting ring parameters, first gets the current ring parameters to set the existing values in the set_ringparm commannd. The result is, that unless both rx and tx ring sizes are set in a single operation, which ever ring is not set will silently have its ring count multiplied by the number of queues on the NIC until it reaches a driver defined maxiumum value.

Fix it by not multiplying the rx and tx ring sizes by the number of queues in the system, like every other driver. Tested by myself successfully.

CC Shreyas Bhatewara <[email protected]>
CC "VMware, Inc." <[email protected]>
CC "David S. Miller" <[email protected]>
---
 drivers/net/vmxnet3/vmxnet3_ethtool.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethtool.c +2 -4
index 9bc542b..a0feb17 100644
@@ -448,10 +448,8 @@ vmxnet3_get_ringparam(struct net_device *netdev,
 	param->rx_mini_max_pending = 0;
 	param->rx_jumbo_max_pending = 0;
 
-	param->rx_pending = adapter->rx_queue[0].rx_ring[0].size *
-			    adapter->num_rx_queues;
-	param->tx_pending = adapter->tx_queue[0].tx_ring.size *
-			    adapter->num_tx_queues;
+	param->rx_pending = adapter->rx_queue[0].rx_ring[0].size;
+	param->tx_pending = adapter->tx_queue[0].tx_ring.size;
 	param->rx_mini_pending = 0;
 	param->rx_jumbo_pending = 0;
 }
Signature · 1 line
1.7.11.7
maintainer Applied
#1 lore raw

From: Neil Horman <[email protected]>
Date: Fri, 22 Feb 2013 15:32:24 -0500

Quoted 9 lines

Noticed that vmxnet3's get_ringparam function was returning the summation of all ring buffers on a NIC, rather than just the size of any one ring. This causes problems when a vmxnet3 instance has multiple queues, as ethtool, when setting ring parameters, first gets the current ring parameters to set the existing values in the set_ringparm commannd. The result is, that unless both rx and tx ring sizes are set in a single operation, which ever ring is not set will silently have its ring count multiplied by the number of queues on the NIC until it reaches a driver defined maxiumum value.

Quoted 4 lines

Fix it by not multiplying the rx and tx ring sizes by the number of queues in the system, like every other driver. Tested by myself successfully.

Applied.