From patchwork Mon Nov 2 22:23:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 315777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DFBBC2D0A3 for ; Mon, 2 Nov 2020 22:24:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E45C42084C for ; Mon, 2 Nov 2020 22:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726815AbgKBWYT (ORCPT ); Mon, 2 Nov 2020 17:24:19 -0500 Received: from mga05.intel.com ([192.55.52.43]:16123 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725785AbgKBWYR (ORCPT ); Mon, 2 Nov 2020 17:24:17 -0500 IronPort-SDR: 5AuCr4dI+CFObIvgJePJJFOxGLc9aLvC4YI49/eLTx7g9W6DjRSFdFM+jUY1crOqqfSkecBhrS emT8trBUeslw== X-IronPort-AV: E=McAfee;i="6000,8403,9793"; a="253670959" X-IronPort-AV: E=Sophos;i="5.77,446,1596524400"; d="scan'208";a="253670959" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 14:24:16 -0800 IronPort-SDR: yT1o2GdHdihbTe45CvvxWaaiGGHqRB1TbOmzloKFN8Iu4LWebGgd2rDRCNhoxY7MzpK8Rwm9lo hHEJXanO9ayA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,446,1596524400"; d="scan'208";a="305591762" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by fmsmga008.fm.intel.com with ESMTP; 02 Nov 2020 14:24:16 -0800 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org Cc: Tony Nguyen , netdev@vger.kernel.org, sassmann@redhat.com, Paul M Stillwell Jr , Harikumar Bokkena Subject: [net-next 02/15] ice: rename shared Flow Director functions Date: Mon, 2 Nov 2020 14:23:25 -0800 Message-Id: <20201102222338.1442081-3-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201102222338.1442081-1-anthony.l.nguyen@intel.com> References: <20201102222338.1442081-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org These functions are currently used to add Flow Director filters, however, they will be expanded to also add ACL filters. Rename the functions, replacing 'fdir' to 'ntuple', to reflect that they are being used to for ntuple filters and are not solely used for Flow Director. Co-developed-by: Paul M Stillwell Jr Signed-off-by: Paul M Stillwell Jr Signed-off-by: Tony Nguyen Tested-by: Harikumar Bokkena --- drivers/net/ethernet/intel/ice/ice.h | 4 +-- drivers/net/ethernet/intel/ice/ice_ethtool.c | 4 +-- .../net/ethernet/intel/ice/ice_ethtool_fdir.c | 30 +++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h index a0723831c4e4..59d3862bb7d8 100644 --- a/drivers/net/ethernet/intel/ice/ice.h +++ b/drivers/net/ethernet/intel/ice/ice.h @@ -592,8 +592,8 @@ int ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add, bool is_tun); void ice_vsi_manage_fdir(struct ice_vsi *vsi, bool ena); -int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd); -int ice_del_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd); +int ice_add_ntuple_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd); +int ice_del_ntuple_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd); int ice_get_ethtool_fdir_entry(struct ice_hw *hw, struct ethtool_rxnfc *cmd); int ice_get_fdir_fltr_ids(struct ice_hw *hw, struct ethtool_rxnfc *cmd, diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c index 9e8e9531cd87..363377fe90ee 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -2652,9 +2652,9 @@ static int ice_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd) switch (cmd->cmd) { case ETHTOOL_SRXCLSRLINS: - return ice_add_fdir_ethtool(vsi, cmd); + return ice_add_ntuple_ethtool(vsi, cmd); case ETHTOOL_SRXCLSRLDEL: - return ice_del_fdir_ethtool(vsi, cmd); + return ice_del_ntuple_ethtool(vsi, cmd); case ETHTOOL_SRXFH: return ice_set_rss_hash_opt(vsi, cmd); default: diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c index 2d27f66ac853..f3d2199a2b42 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c @@ -1388,7 +1388,7 @@ ice_fdir_do_rem_flow(struct ice_pf *pf, enum ice_fltr_ptype flow_type) } /** - * ice_fdir_update_list_entry - add or delete a filter from the filter list + * ice_ntuple_update_list_entry - add or delete a filter from the filter list * @pf: PF structure * @input: filter structure * @fltr_idx: ethtool index of filter to modify @@ -1396,8 +1396,8 @@ ice_fdir_do_rem_flow(struct ice_pf *pf, enum ice_fltr_ptype flow_type) * returns 0 on success and negative on errors */ static int -ice_fdir_update_list_entry(struct ice_pf *pf, struct ice_fdir_fltr *input, - int fltr_idx) +ice_ntuple_update_list_entry(struct ice_pf *pf, struct ice_fdir_fltr *input, + int fltr_idx) { struct ice_fdir_fltr *old_fltr; struct ice_hw *hw = &pf->hw; @@ -1429,13 +1429,13 @@ ice_fdir_update_list_entry(struct ice_pf *pf, struct ice_fdir_fltr *input, } /** - * ice_del_fdir_ethtool - delete Flow Director filter + * ice_del_ntuple_ethtool - delete Flow Director or ACL filter * @vsi: pointer to target VSI - * @cmd: command to add or delete Flow Director filter + * @cmd: command to add or delete the filter * * Returns 0 on success and negative values for failure */ -int ice_del_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd) +int ice_del_ntuple_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd) { struct ethtool_rx_flow_spec *fsp = (struct ethtool_rx_flow_spec *)&cmd->fs; @@ -1456,21 +1456,21 @@ int ice_del_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd) return -EBUSY; mutex_lock(&hw->fdir_fltr_lock); - val = ice_fdir_update_list_entry(pf, NULL, fsp->location); + val = ice_ntuple_update_list_entry(pf, NULL, fsp->location); mutex_unlock(&hw->fdir_fltr_lock); return val; } /** - * ice_set_fdir_input_set - Set the input set for Flow Director + * ice_ntuple_set_input_set - Set the input set for Flow Director * @vsi: pointer to target VSI * @fsp: pointer to ethtool Rx flow specification * @input: filter structure */ static int -ice_set_fdir_input_set(struct ice_vsi *vsi, struct ethtool_rx_flow_spec *fsp, - struct ice_fdir_fltr *input) +ice_ntuple_set_input_set(struct ice_vsi *vsi, struct ethtool_rx_flow_spec *fsp, + struct ice_fdir_fltr *input) { u16 dest_vsi, q_index = 0; struct ice_pf *pf; @@ -1594,13 +1594,13 @@ ice_set_fdir_input_set(struct ice_vsi *vsi, struct ethtool_rx_flow_spec *fsp, } /** - * ice_add_fdir_ethtool - Add/Remove Flow Director filter + * ice_add_ntuple_ethtool - Add/Remove Flow Director or ACL filter * @vsi: pointer to target VSI - * @cmd: command to add or delete Flow Director filter + * @cmd: command to add or delete the filter * * Returns 0 on success and negative values for failure */ -int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd) +int ice_add_ntuple_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd) { struct ice_rx_flow_userdef userdata; struct ethtool_rx_flow_spec *fsp; @@ -1657,7 +1657,7 @@ int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd) if (!input) return -ENOMEM; - ret = ice_set_fdir_input_set(vsi, fsp, input); + ret = ice_ntuple_set_input_set(vsi, fsp, input); if (ret) goto free_input; @@ -1674,7 +1674,7 @@ int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd) } /* input struct is added to the HW filter list */ - ice_fdir_update_list_entry(pf, input, fsp->location); + ice_ntuple_update_list_entry(pf, input, fsp->location); ret = ice_fdir_write_all_fltr(pf, input, true); if (ret)