From patchwork Sat May 16 00:55:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 1291789 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49P6MJ0l5Sz9sTM for ; Sat, 16 May 2020 10:57:48 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A7D7689A34; Sat, 16 May 2020 00:57:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KzMpCXYjHHpp; Sat, 16 May 2020 00:57:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 10059897DC; Sat, 16 May 2020 00:57:45 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 238B61BF9C8 for ; Sat, 16 May 2020 00:57:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 20A8989738 for ; Sat, 16 May 2020 00:57:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7U9zXjAkn8Uz for ; Sat, 16 May 2020 00:57:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by hemlock.osuosl.org (Postfix) with ESMTPS id C970588717 for ; Sat, 16 May 2020 00:57:41 +0000 (UTC) IronPort-SDR: hYENSPa9Po+w60NA/qR3eU4jJKU+cmNXiFKdichnu9ZMs7T+seIhF8PLxVRIke7v2qja75GEB7 iskXjbBir2HA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2020 17:57:41 -0700 IronPort-SDR: iDPk9hQh3OP2i81nSmCK2DbwQ0rf79EXbm6jc2OgkCm/bcF+DpwhjiRcA4N3r17q1ap1RlKgkn DCjU0sD8/dRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,397,1583222400"; d="scan'208";a="464922710" Received: from unknown (HELO localhost.jf.intel.com) ([10.166.241.65]) by fmsmga005.fm.intel.com with ESMTP; 15 May 2020 17:57:41 -0700 From: Tony Nguyen To: intel-wired-lan@lists.osuosl.org Date: Fri, 15 May 2020 17:55:05 -0700 Message-Id: <20200516005506.5113-8-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200516005506.5113-1-anthony.l.nguyen@intel.com> References: <20200516005506.5113-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Subject: [Intel-wired-lan] [PATCH S46 8/9] ice: fix aRFS after flow director delete X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 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@osuosl.org Sender: "Intel-wired-lan" From: Henry Tieman The logic was missing for adding back perfect flows after flow director filter delete. The code now adds perfect flows into the HW tables after filter delete. Signed-off-by: Henry Tieman Tested-by: Andrew Bowers --- .../net/ethernet/intel/ice/ice_ethtool_fdir.c | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c index 22cc4167b974..b92017b8ae4a 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c @@ -1363,6 +1363,31 @@ void ice_vsi_manage_fdir(struct ice_vsi *vsi, bool ena) mutex_unlock(&hw->fdir_fltr_lock); } +/** + * ice_fdir_do_rem_flow - delete flow and possibly add perfect flow + * @pf: PF structure + * @flow_type: FDir flow type to release + */ +static void +ice_fdir_do_rem_flow(struct ice_pf *pf, enum ice_fltr_ptype flow_type) +{ + struct ice_hw *hw = &pf->hw; + bool need_perfect = false; + + if (flow_type == ICE_FLTR_PTYPE_NONF_IPV4_TCP || + flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP || + flow_type == ICE_FLTR_PTYPE_NONF_IPV6_TCP || + flow_type == ICE_FLTR_PTYPE_NONF_IPV6_UDP) + need_perfect = true; + + if (need_perfect && test_bit(flow_type, hw->fdir_perfect_fltr)) + return; + + ice_fdir_rem_flow(hw, ICE_BLK_FD, flow_type); + if (need_perfect) + ice_create_init_fdir_rule(pf, flow_type); +} + /** * ice_fdir_update_list_entry - add or delete a filter from the filter list * @pf: PF structure @@ -1393,7 +1418,7 @@ ice_fdir_update_list_entry(struct ice_pf *pf, struct ice_fdir_fltr *input, /* we just deleted the last filter of flow_type so we * should also delete the HW filter info. */ - ice_fdir_rem_flow(hw, ICE_BLK_FD, old_fltr->flow_type); + ice_fdir_do_rem_flow(pf, old_fltr->flow_type); list_del(&old_fltr->fltr_node); devm_kfree(ice_hw_to_dev(hw), old_fltr); }