From patchwork Fri Feb 22 20:32:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Horman X-Patchwork-Id: 222639 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AB4A12C0094 for ; Sat, 23 Feb 2013 07:32:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756554Ab3BVUcr (ORCPT ); Fri, 22 Feb 2013 15:32:47 -0500 Received: from charlotte.tuxdriver.com ([70.61.120.58]:50075 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752808Ab3BVUcq (ORCPT ); Fri, 22 Feb 2013 15:32:46 -0500 Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1U8zII-00033G-MN; Fri, 22 Feb 2013 15:32:43 -0500 From: Neil Horman To: netdev@vger.kernel.org Cc: Neil Horman , Shreyas Bhatewara , "VMware, Inc." , "David S. Miller" Subject: [PATCH net-next] vmxnet3: fix ethtool ring buffer size setting Date: Fri, 22 Feb 2013 15:32:24 -0500 Message-Id: <1361565144-18301-1-git-send-email-nhorman@tuxdriver.com> X-Mailer: git-send-email 1.7.11.7 X-Spam-Score: -2.9 (--) X-Spam-Status: No Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. Signed-off-by: Neil Horman CC: Shreyas Bhatewara CC: "VMware, Inc." CC: "David S. Miller" --- drivers/net/vmxnet3/vmxnet3_ethtool.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c index 9bc542b..a0feb17 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethtool.c +++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c @@ -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; }