From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E036CA0A0E for ; Mon, 10 May 2021 18:17:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA52E4003E; Mon, 10 May 2021 18:17:28 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2078.outbound.protection.outlook.com [40.107.94.78]) by mails.dpdk.org (Postfix) with ESMTP id 46F484003E for ; Mon, 10 May 2021 18:17:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OkphAD/0sR1WhGBuXBQIzUroxod21DXBIvb9iTPEZskws6huOqM1zZFGRm4XpBGNBrD15t5TD6Hj0QmRVZCe+FiT/kQqqFor2Uhh7yXB2HxZPdNVwHA9J6nXKRtrngfGViWgLfHKiGFLgDr2z6yQoXok8ueTHAUJ2Y9wv1/fFCdO59Q8Xo5bmRjvZlLrS9vgZpjyW/5lU+mPkwjbIwLUCvmDgzQ0JwC2ovgowMgk9D6hMSMrzJPY00fTNvISRsDLnQ8lReOWyTkMPh1AF3fplGlakYIIf87tj+mHJZNWA19yaHA6YgO7YBpqxOQU6MMZkmdKKMrOyIlHHjQ5AXhlow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MiZJfBU8iogUnZ4dtRGwSQk3BQ3noC3EIisnUvtr4VY=; b=Os4ycqDr0r+q3MIkDPxh8PpLDAELpKS5sfL133/Wa5Df8cx8YUdrvLcp3+1Du0608AC2drD9Vh23yjm0kj9kpyzQYzBq9NEMujkJbBQzlxbPWfdUV8rE98gAUSlVTWZt1mf2hAorMmyQYkdqDXeB8hrivb7c32hk4yYUO2El+Gp78KW1cd5VR9fnBh0nNHepFwigAnQRhIf3PrGD0snA0CIRpaQHg1fpfNiQ+Ga+2HtsBIusSmUZFIQWFydBo9w72HmggJboKPqxYTnNhfLADWF2RM1SobM3qplaeZzGvokv3+VWcA5YPzU8v1X+KHK3NjSF6zjfs61gu8XR4X7tRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MiZJfBU8iogUnZ4dtRGwSQk3BQ3noC3EIisnUvtr4VY=; b=oTZ0jPbYFkkye4AAut1/0UmMRxQ54UEPzvI2bOtmxLLdWirVwDFhX7A27bkVectExfIyaFT9iqEUw/gw9Xak6RAHUpCYCVUxR5wotrYJ9zvYg/sSf+Ak7dRixPjtcL0bm0Nk8s9n/3LRE3LQQUbidSEhTm72Eyq41XBFq/X1UO7xosHtb9VkmTMXR/bAoCGOfVi/dwGgZf/r2GB+qzmyOj1n9YhAD3Gy7oV4Isu0ksHkq9LCmrQ2obhE+4Dm0e6nIoZQ80UWcTqAD2uH4dDjlKckc2OlqrfzC24Zv/6ujtoyme3U6bg3AOD9j2eGizpcbrXvictLItO9ci36epUoVQ== Received: from DM5PR07CA0168.namprd07.prod.outlook.com (2603:10b6:3:ee::34) by MWHPR12MB1918.namprd12.prod.outlook.com (2603:10b6:300:114::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25; Mon, 10 May 2021 16:17:25 +0000 Received: from DM6NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:3:ee:cafe::12) by DM5PR07CA0168.outlook.office365.com (2603:10b6:3:ee::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Mon, 10 May 2021 16:17:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT045.mail.protection.outlook.com (10.13.173.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:17:25 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:17:23 +0000 From: Xueming Li To: Murphy Yang CC: Luca Boccassi , Beilei Xing , dpdk stable Date: Tue, 11 May 2021 00:01:32 +0800 Message-ID: <20210510160258.30982-143-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aab333b9-caa8-4773-d2fa-08d913cf194a X-MS-TrafficTypeDiagnostic: MWHPR12MB1918: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7q85EP+KgpozC2fU4FWcIDrUYvTayOxRVBzxjLtSOwuzK6a/zAaDO5k9hxQMZ/tcJWTWDKRFhRDY2gjDwdw5f82ggkJg9J15fRuQPbpERnrJtYtSNHrrIorrYNGhvm3iTryNOig2terY3L0hBTQQ2d+z0jD2y6svQvZJgfCeHNaMrm9M4TiSvmketzCHQZhpk+2ddmA+RLBzUuX8BOGsr6OWToA5HrR2yxfXGPLfLmJlAKP1c3bHORchULVbqqOPFGyIwtgA9mdqVJGPz4Wwkhf3E2rYADxs+c1p4D88cIZ9k62lXzXlcXrSZEVlpJRslVIzmjUxJpcE8tgLEqCdBx1VnSwYxuwh+fKaNcKuNwIbz/YtIurbtHvm47ku3D2KBqMLA//3bzVb9hi0HXWqmAl6ngMcockUWiJkMnXxtioTajp7TPQg4Vi2sDlekSUJ3ycejaK0mc4Me5XyK+YuS0kANFmKg35mJiO97z5yS1PC3glCJ9IcKJTde8UCXpg2VPbLVwONemQqbm0zlxIQfFJvioCYtzZBME+A7rDuLas5z5VltjVFWGjMapbpvnHDtd2FGFYxcpWOfI63T7fWJpIOMbI5OLAprfxl+NU01jHl8vXg1mnZysnuP0bkpHRsYpxgpOY5D0G0vc3k8cfKiRPn7oY7LAyhySP5zcLCpVRonM+2fBroB5O+py5kLCs9OJJUH9p+E1skkkca9nwENHgHhUJqY00Bjtab9a8RTwl99yOfnEaD22PmETUMjA1S8MuU1vMHMZMqe4ztlsPiyQ== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(136003)(396003)(376002)(346002)(39860400002)(36840700001)(46966006)(1076003)(26005)(186003)(4326008)(16526019)(356005)(8936002)(82310400003)(316002)(82740400003)(47076005)(36906005)(54906003)(6286002)(7636003)(55016002)(83380400001)(966005)(70206006)(336012)(70586007)(2906002)(36860700001)(86362001)(15650500001)(53546011)(478600001)(36756003)(7696005)(6666004)(2616005)(6916009)(426003)(8676002)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:17:25.2108 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aab333b9-caa8-4773-d2fa-08d913cf194a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1918 Subject: [dpdk-stable] patch 'net/i40e: fix flow director config after flow validate' has been queued to stable release 20.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/81c1c91037262fd6e44e23cd86035a0987500761 Thanks. Xueming Li --- >From 81c1c91037262fd6e44e23cd86035a0987500761 Mon Sep 17 00:00:00 2001 From: Murphy Yang Date: Thu, 1 Apr 2021 03:23:32 +0000 Subject: [PATCH] net/i40e: fix flow director config after flow validate Cc: Luca Boccassi [ upstream commit 4a072ad434426ebfb5a6120858a971b54e7d2204 ] The configuration of FDIR input set should not be set during flow validate. It should be set when flow create. Fixes: fe5d0e85b713 ("net/i40e: fix flow director flex configuration") Fixes: 15018d79f0be ("net/i40e: add FDIR support for GTP-C and GTP-U") Signed-off-by: Murphy Yang Acked-by: Beilei Xing --- drivers/net/i40e/i40e_ethdev.h | 1 + drivers/net/i40e/i40e_fdir.c | 88 +++++++++++++++++++++++++++++++ drivers/net/i40e/i40e_flow.c | 94 +++------------------------------- 3 files changed, 96 insertions(+), 87 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 7d203a7816..aeabe5a205 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -629,6 +629,7 @@ struct i40e_fdir_flow_ext { uint8_t raw_id; uint8_t is_vf; /* 1 for VF, 0 for port dev */ uint16_t dst_id; /* VF ID, available when is_vf is 1*/ + uint64_t input_set; bool inner_ip; /* If there is inner ip */ enum i40e_fdir_ip_type iip_type; /* ip type for inner ip */ enum i40e_fdir_ip_type oip_type; /* ip type for outer ip */ diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index f5defcf585..37d988d21c 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -1588,6 +1588,83 @@ i40e_flow_set_fdir_flex_msk(struct i40e_pf *pf, pf->fdir.flex_mask_flag[pctype] = 1; } +static int +i40e_flow_set_fdir_inset(struct i40e_pf *pf, + enum i40e_filter_pctype pctype, + uint64_t input_set) +{ + uint32_t mask_reg[I40E_INSET_MASK_NUM_REG] = {0}; + struct i40e_hw *hw = I40E_PF_TO_HW(pf); + uint64_t inset_reg = 0; + int i, num; + + /* Check if the input set is valid */ + if (i40e_validate_input_set(pctype, RTE_ETH_FILTER_FDIR, + input_set) != 0) { + PMD_DRV_LOG(ERR, "Invalid input set"); + return -EINVAL; + } + + /* Check if the configuration is conflicted */ + if (pf->fdir.inset_flag[pctype] && + memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) + return -1; + + if (pf->fdir.inset_flag[pctype] && + !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) + return 0; + + num = i40e_generate_inset_mask_reg(hw, input_set, mask_reg, + I40E_INSET_MASK_NUM_REG); + if (num < 0) + return -EINVAL; + + if (pf->support_multi_driver) { + for (i = 0; i < num; i++) + if (i40e_read_rx_ctl(hw, + I40E_GLQF_FD_MSK(i, pctype)) != + mask_reg[i]) { + PMD_DRV_LOG(ERR, "Input set setting is not" + " supported with" + " `support-multi-driver`" + " enabled!"); + return -EPERM; + } + for (i = num; i < I40E_INSET_MASK_NUM_REG; i++) + if (i40e_read_rx_ctl(hw, + I40E_GLQF_FD_MSK(i, pctype)) != 0) { + PMD_DRV_LOG(ERR, "Input set setting is not" + " supported with" + " `support-multi-driver`" + " enabled!"); + return -EPERM; + } + + } else { + for (i = 0; i < num; i++) + i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), + mask_reg[i]); + /*clear unused mask registers of the pctype */ + for (i = num; i < I40E_INSET_MASK_NUM_REG; i++) + i40e_check_write_reg(hw, + I40E_GLQF_FD_MSK(i, pctype), 0); + } + + inset_reg |= i40e_translate_input_set_reg(hw->mac.type, input_set); + + i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0), + (uint32_t)(inset_reg & UINT32_MAX)); + i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 1), + (uint32_t)((inset_reg >> + I40E_32_BIT_WIDTH) & UINT32_MAX)); + + I40E_WRITE_FLUSH(hw); + + pf->fdir.input_set[pctype] = input_set; + pf->fdir.inset_flag[pctype] = 1; + return 0; +} + static inline unsigned char * i40e_find_available_buffer(struct rte_eth_dev *dev) { @@ -1686,6 +1763,17 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev, if (add) { if (filter->input.flow_ext.is_flex_flow) { + ret = i40e_flow_set_fdir_inset(pf, pctype, + filter->input.flow_ext.input_set); + if (ret == -1) { + PMD_DRV_LOG(ERR, "Conflict with the" + " first rule's input set."); + return -EINVAL; + } else if (ret == -EINVAL) { + PMD_DRV_LOG(ERR, "Invalid pattern mask."); + return -EINVAL; + } + for (i = 0; i < filter->input.flow_ext.raw_id; i++) { layer_idx = filter->input.flow_ext.layer_idx; field_idx = layer_idx * I40E_MAX_FLXPLD_FIED + i; diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 15c6464703..19bdce0195 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -2243,82 +2243,6 @@ i40e_flow_check_raw_item(const struct rte_flow_item *item, return 0; } -static int -i40e_flow_set_fdir_inset(struct i40e_pf *pf, - enum i40e_filter_pctype pctype, - uint64_t input_set) -{ - struct i40e_hw *hw = I40E_PF_TO_HW(pf); - uint64_t inset_reg = 0; - uint32_t mask_reg[I40E_INSET_MASK_NUM_REG] = {0}; - int i, num; - - /* Check if the input set is valid */ - if (i40e_validate_input_set(pctype, RTE_ETH_FILTER_FDIR, - input_set) != 0) { - PMD_DRV_LOG(ERR, "Invalid input set"); - return -EINVAL; - } - - /* Check if the configuration is conflicted */ - if (pf->fdir.inset_flag[pctype] && - memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) - return -1; - - if (pf->fdir.inset_flag[pctype] && - !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) - return 0; - - num = i40e_generate_inset_mask_reg(hw, input_set, mask_reg, - I40E_INSET_MASK_NUM_REG); - if (num < 0) - return -EINVAL; - - if (pf->support_multi_driver) { - for (i = 0; i < num; i++) - if (i40e_read_rx_ctl(hw, - I40E_GLQF_FD_MSK(i, pctype)) != - mask_reg[i]) { - PMD_DRV_LOG(ERR, "Input set setting is not" - " supported with" - " `support-multi-driver`" - " enabled!"); - return -EPERM; - } - for (i = num; i < I40E_INSET_MASK_NUM_REG; i++) - if (i40e_read_rx_ctl(hw, - I40E_GLQF_FD_MSK(i, pctype)) != 0) { - PMD_DRV_LOG(ERR, "Input set setting is not" - " supported with" - " `support-multi-driver`" - " enabled!"); - return -EPERM; - } - - } else { - for (i = 0; i < num; i++) - i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), - mask_reg[i]); - /*clear unused mask registers of the pctype */ - for (i = num; i < I40E_INSET_MASK_NUM_REG; i++) - i40e_check_write_reg(hw, - I40E_GLQF_FD_MSK(i, pctype), 0); - } - - inset_reg |= i40e_translate_input_set_reg(hw->mac.type, input_set); - - i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0), - (uint32_t)(inset_reg & UINT32_MAX)); - i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 1), - (uint32_t)((inset_reg >> - I40E_32_BIT_WIDTH) & UINT32_MAX)); - - I40E_WRITE_FLUSH(hw); - - pf->fdir.input_set[pctype] = input_set; - pf->fdir.inset_flag[pctype] = 1; - return 0; -} static uint8_t i40e_flow_fdir_get_pctype_value(struct i40e_pf *pf, @@ -3212,18 +3136,14 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, /* If customized pctype is not used, set fdir configuration.*/ if (!filter->input.flow_ext.customized_pctype) { - ret = i40e_flow_set_fdir_inset(pf, pctype, input_set); - if (ret == -1) { - rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ITEM, item, - "Conflict with the first rule's input set."); - return -rte_errno; - } else if (ret == -EINVAL) { - rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ITEM, item, - "Invalid pattern mask."); - return -rte_errno; + /* Check if the input set is valid */ + if (i40e_validate_input_set(pctype, RTE_ETH_FILTER_FDIR, + input_set) != 0) { + PMD_DRV_LOG(ERR, "Invalid input set"); + return -EINVAL; } + + filter->input.flow_ext.input_set = input_set; } filter->input.pctype = pctype; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:30.291577100 +0800 +++ 0144-net-i40e-fix-flow-director-config-after-flow-validat.patch 2021-05-10 23:59:26.550000000 +0800 @@ -1 +1 @@ -From 4a072ad434426ebfb5a6120858a971b54e7d2204 Mon Sep 17 00:00:00 2001 +From 81c1c91037262fd6e44e23cd86035a0987500761 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 4a072ad434426ebfb5a6120858a971b54e7d2204 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -22 +24 @@ -index faf6896fbc..cdf1c2fe1f 100644 +index 7d203a7816..aeabe5a205 100644 @@ -25 +27 @@ -@@ -631,6 +631,7 @@ struct i40e_fdir_flow_ext { +@@ -629,6 +629,7 @@ struct i40e_fdir_flow_ext { @@ -34 +36 @@ -index c572d003cb..da089baa4d 100644 +index f5defcf585..37d988d21c 100644 @@ -140 +142 @@ -index 1ee8959e56..2cc9ad9ef7 100644 +index 15c6464703..19bdce0195 100644