From patchwork Tue Jul 26 15:48:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Brady X-Patchwork-Id: 652913 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rzVK21k7dz9stY for ; Wed, 27 Jul 2016 06:36:38 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B8CAF8B662; Tue, 26 Jul 2016 20:36:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hpuk0b0PEoSo; Tue, 26 Jul 2016 20:36:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 943728B6CA; Tue, 26 Jul 2016 20:36:29 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 60A971C0F89 for ; Tue, 26 Jul 2016 15:48:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5C91E8732F for ; Tue, 26 Jul 2016 15:48:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1JCxYspyAcPf for ; Tue, 26 Jul 2016 15:48:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by whitealder.osuosl.org (Postfix) with ESMTP id C1AD686C23 for ; Tue, 26 Jul 2016 15:48:43 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 26 Jul 2016 08:48:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,425,1464678000"; d="scan'208";a="740012243" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by FMSMGA003.fm.intel.com with ESMTP; 26 Jul 2016 08:48:42 -0700 Received: from orsmsx154.amr.corp.intel.com (10.22.226.12) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 26 Jul 2016 08:48:41 -0700 Received: from orsmsx102.amr.corp.intel.com ([169.254.3.105]) by ORSMSX154.amr.corp.intel.com ([169.254.11.220]) with mapi id 14.03.0248.002; Tue, 26 Jul 2016 08:48:41 -0700 From: "Brady, Alan" To: "Pujari, Bimmy" , "intel-wired-lan@lists.osuosl.org" Thread-Topic: [next PATCH S40 10/13] i40e: fix lookup table when RSS disabled/enabled Thread-Index: AQHR5sp0tDFodETbAE2JHOUhlLM7y6Aq3DHA Date: Tue, 26 Jul 2016 15:48:41 +0000 Message-ID: References: <1469488555-28187-1-git-send-email-bimmy.pujari@intel.com> <1469488555-28187-11-git-send-email-bimmy.pujari@intel.com> In-Reply-To: <1469488555-28187-11-git-send-email-bimmy.pujari@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.139] MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 26 Jul 2016 20:36:27 +0000 Subject: Re: [Intel-wired-lan] [next PATCH S40 10/13] i40e: fix lookup table when RSS disabled/enabled X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" ACK -----Original Message----- From: Pujari, Bimmy Sent: Monday, July 25, 2016 4:16 PM To: intel-wired-lan@lists.osuosl.org Cc: Brady, Alan Subject: [next PATCH S40 10/13] i40e: fix lookup table when RSS disabled/enabled From: "Alan, Brady" This patch fixes the bug which causes RSS to continue to work after being disabled. After disabling RSS, traffic would continue to be assigned to different queues instead of falling back to a single queue. Without this patch, attempting to disable RSS would not work as expected. This patch fixes the bug by clearing the lookup table used by RSS such that all traffic is assigned to a single queue. This patch also addresses the issue of reinstating the lookup table should RSS then be re-enabled. Signed-off-by: Alan Brady Change-ID: Ib20c7c6a7e9f1f772bb787370f8a8c664796b141 --- drivers/net/ethernet/intel/i40e/i40e_main.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) + if (features & NETIF_F_RXHASH && !(netdev->features & NETIF_F_RXHASH)) + i40e_pf_config_rss(pf); + else if (!(features & NETIF_F_RXHASH) && + netdev->features & NETIF_F_RXHASH) + i40e_clear_rss_lut(vsi); + if (features & NETIF_F_HW_VLAN_CTAG_RX) i40e_vlan_stripping_enable(vsi); else -- 2.4.11 diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index c130149..a33e902 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -8658,6 +8658,28 @@ bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features) } /** + * i40e_clear_rss_lut - clear the rx hash lookup table + * @vsi: the VSI being configured + **/ +static void i40e_clear_rss_lut(struct i40e_vsi *vsi) { + struct i40e_pf *pf = vsi->back; + struct i40e_hw *hw = &pf->hw; + u16 vf_id = vsi->vf_id; + u8 i; + + if (vsi->type == I40E_VSI_MAIN) { + for (i = 0; i <= I40E_PFQF_HLUT_MAX_INDEX; i++) + wr32(hw, I40E_PFQF_HLUT(i), 0); + } else if (vsi->type == I40E_VSI_SRIOV) { + for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) + i40e_write_rx_ctl(hw, I40E_VFQF_HLUT1(i, vf_id), 0); + } else { + dev_err(&pf->pdev->dev, "Cannot set RSS LUT - invalid VSI type\n"); + } +} + +/** * i40e_set_features - set the netdev feature flags * @netdev: ptr to the netdev being adjusted * @features: the feature set that the stack is suggesting @@ -8670,6 +8692,12 @@ static int i40e_set_features(struct net_device *netdev, struct i40e_pf *pf = vsi->back; bool need_reset;