From patchwork Fri Feb 21 03:29:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Brown, Aaron F" X-Patchwork-Id: 322404 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 0434B2C00C4 for ; Fri, 21 Feb 2014 14:33:02 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753366AbaBUDc6 (ORCPT ); Thu, 20 Feb 2014 22:32:58 -0500 Received: from mga09.intel.com ([134.134.136.24]:20978 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752823AbaBUDcR (ORCPT ); Thu, 20 Feb 2014 22:32:17 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 20 Feb 2014 19:27:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,516,1389772800"; d="scan'208";a="478886034" Received: from s252.jf.intel.com ([10.23.155.219]) by fmsmga001.fm.intel.com with ESMTP; 20 Feb 2014 19:32:15 -0800 From: Aaron Brown To: davem@davemloft.net Cc: Mitch Williams , netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com, Jesse Brandeburg , Aaron Brown Subject: [net-next v2 08/14] i40evf: store ring size in ring structs Date: Thu, 20 Feb 2014 19:29:12 -0800 Message-Id: <1392953358-23908-9-git-send-email-aaron.f.brown@intel.com> X-Mailer: git-send-email 1.8.5.GIT In-Reply-To: <1392953358-23908-1-git-send-email-aaron.f.brown@intel.com> References: <1392953358-23908-1-git-send-email-aaron.f.brown@intel.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Mitch Williams Keep the descriptor ring size in the actual ring structs instead of in the adapter struct. This enables us to use common tx and rx code with the i40e PF driver. Also update copyrights. Change-ID: I2861e599b2b4c76441c062ea14400f4750f54d0e Signed-off-by: Mitch Williams Signed-off-by: Jesse Brandeburg Tested-by: Sibai Li Signed-off-by: Aaron Brown --- drivers/net/ethernet/intel/i40evf/i40evf.h | 2 -- drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 13 ++++++++----- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 3 --- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h index c9a5056..ccb43d3 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf.h +++ b/drivers/net/ethernet/intel/i40evf/i40evf.h @@ -196,8 +196,6 @@ struct i40evf_adapter { /* RX */ struct i40e_ring *rx_rings[I40E_MAX_VSI_QP]; - int txd_count; - int rxd_count; u64 hw_csum_rx_error; int num_msix_vectors; struct msix_entry *msix_entries; diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c index b0b1f4b..8b0db1c 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Intel Ethernet Controller XL710 Family Linux Virtual Function Driver - * Copyright(c) 2013 Intel Corporation. + * Copyright(c) 2013 - 2014 Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -241,6 +241,7 @@ static int i40evf_set_ringparam(struct net_device *netdev, { struct i40evf_adapter *adapter = netdev_priv(netdev); u32 new_rx_count, new_tx_count; + int i; if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) return -EINVAL; @@ -256,12 +257,14 @@ static int i40evf_set_ringparam(struct net_device *netdev, new_rx_count = ALIGN(new_rx_count, I40EVF_REQ_DESCRIPTOR_MULTIPLE); /* if nothing to do return success */ - if ((new_tx_count == adapter->txd_count) && - (new_rx_count == adapter->rxd_count)) + if ((new_tx_count == adapter->tx_rings[0]->count) && + (new_rx_count == adapter->rx_rings[0]->count)) return 0; - adapter->txd_count = new_tx_count; - adapter->rxd_count = new_rx_count; + for (i = 0; i < adapter->vsi_res->num_queue_pairs; i++) { + adapter->tx_rings[0]->count = new_tx_count; + adapter->rx_rings[0]->count = new_rx_count; + } if (netif_running(netdev)) i40evf_reinit_locked(adapter); diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c index 40a5e78..d05d5c1 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c @@ -2025,9 +2025,6 @@ static void i40evf_init_task(struct work_struct *work) adapter->flags |= I40EVF_FLAG_RX_CSUM_ENABLED; - adapter->txd_count = I40EVF_DEFAULT_TXD; - adapter->rxd_count = I40EVF_DEFAULT_RXD; - netdev->netdev_ops = &i40evf_netdev_ops; i40evf_set_ethtool_ops(netdev); netdev->watchdog_timeo = 5 * HZ;