From patchwork Thu Aug 24 10:20:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rybalchenko, Kirill" X-Patchwork-Id: 27844 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 016907D56; Thu, 24 Aug 2017 12:21:02 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 5BC6F7D6E for ; Thu, 24 Aug 2017 12:21:00 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Aug 2017 03:21:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,421,1498546800"; d="scan'208";a="144048881" Received: from silpixa00389036.ir.intel.com (HELO silpixa00389036.ger.corp.intel.com) ([10.237.223.231]) by fmsmga006.fm.intel.com with ESMTP; 24 Aug 2017 03:20:58 -0700 From: Kirill Rybalchenko To: dev@dpdk.org Cc: kirill.rybalchenko@intel.com, andrey.chilikin@intel.com, beilei.xing@intel.com Date: Thu, 24 Aug 2017 11:20:43 +0100 Message-Id: <1503570044-104133-5-git-send-email-kirill.rybalchenko@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1503570044-104133-1-git-send-email-kirill.rybalchenko@intel.com> References: <1503570044-104133-1-git-send-email-kirill.rybalchenko@intel.com> Subject: [dpdk-dev] [PATCH 4/5] net/i40e: change list of parameters for functions mapping flow type to pctype and back X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Functions i40e_pctype_to_flowtype and i40e_flowtype_to_pctype are changed to work with dynamic mapping pctype to flowtype table. This table is located in private data area of adapter structure. Therefore those functions need one extra parameter pointing to the adapter data structure. Signed-off-by: Kirill Rybalchenko --- drivers/net/i40e/i40e_fdir.c | 10 +++++----- drivers/net/i40e/i40e_flow.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 8013add..7515941 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -665,10 +665,10 @@ i40e_fdir_configure(struct rte_eth_dev *dev) pctype = (enum i40e_filter_pctype)i40e_read_rx_ctl( hw, I40E_GLQF_FD_PCTYPES( (int)i40e_flowtype_to_pctype( - conf->flex_mask[i].flow_type))); + conf->flex_mask[i].flow_type, pf->adapter))); } else pctype = i40e_flowtype_to_pctype( - conf->flex_mask[i].flow_type); + conf->flex_mask[i].flow_type, pf->adapter); i40e_set_flex_mask_on_pctype(pf, pctype, &conf->flex_mask[i]); } @@ -1143,9 +1143,9 @@ i40e_add_del_fdir_filter(struct rte_eth_dev *dev, pctype = (enum i40e_filter_pctype)i40e_read_rx_ctl( hw, I40E_GLQF_FD_PCTYPES( (int)i40e_flowtype_to_pctype( - filter->input.flow_type))); + filter->input.flow_type, pf->adapter))); } else - pctype = i40e_flowtype_to_pctype(filter->input.flow_type); + pctype = i40e_flowtype_to_pctype(filter->input.flow_type, pf->adapter); ret = i40e_fdir_filter_programming(pf, pctype, filter, add); if (ret < 0) { @@ -1400,7 +1400,7 @@ i40e_fdir_info_get_flex_mask(struct i40e_pf *pf, if (!I40E_VALID_PCTYPE((enum i40e_filter_pctype)i)) continue; } - flow_type = i40e_pctype_to_flowtype((enum i40e_filter_pctype)i); + flow_type = i40e_pctype_to_flowtype(i, pf->adapter); for (j = 0; j < I40E_FDIR_MAX_FLEXWORD_NUM; j++) { if (mask->word_mask & I40E_FLEX_WORD_MASK(j)) { ptr->mask[j * sizeof(uint16_t)] = UINT8_MAX; diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index b92719a..4db771c 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -2776,7 +2776,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, } } - pctype = i40e_flowtype_to_pctype(flow_type); + pctype = i40e_flowtype_to_pctype(flow_type, pf->adapter); if (pctype == 0 || pctype > I40E_FILTER_PCTYPE_L2_PAYLOAD) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item,