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 756EEA0524 for ; Fri, 5 Feb 2021 12:23:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F3261606CE; Fri, 5 Feb 2021 12:23:08 +0100 (CET) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mails.dpdk.org (Postfix) with ESMTP id 9DCDD1606B6 for ; Fri, 5 Feb 2021 12:23:07 +0100 (CET) Received: by mail-wm1-f50.google.com with SMTP id i9so5627067wmq.1 for ; Fri, 05 Feb 2021 03:23:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8UilDS16LJwRoXmHpY/HqB9MWSUCDSrlHO0zPQ+7e0c=; b=jh5qJ7yOXSImtsdMK5fGVORPmNkAa0SIlo2iXb8LspZU8pmFSYqIV9fmNmyGbrh77B 23VWqllRwE7uN8leCgTBKBmL95LtvPbRYzbam/00iZ1nH5eXltzl8oCgvezl1UFa3Erl Iskj8o/gZwkcEokE9a4p7b8GV5+O5lhkB1fGpz96W6rwsmRnt4U5yyedriR5qWfUPxOm 69zOgPtZBrvwOTj7sqaNO3xEp4AvpGllRzjDhskedXpCqyN6rb84zHnqQvLjH98J0V0R aOYri4YsJlUM0d4aUJTDfvLAVPEj8UP/ezQ/qO2i/yBfHBLHLwNKY22CoqZz7fXRFl7W TO9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8UilDS16LJwRoXmHpY/HqB9MWSUCDSrlHO0zPQ+7e0c=; b=Pyfqf5xqUFjDX9BubIVCFS2BjQaehOF3D6olkPa65bgUwLZYNiKvLWjaA6+NgJfzZz 4AYlcavq1hzJpYf3yNHvwVlOF/eQ70ylB4Tw/Z8+jsalAhGTijfKr62Pa2Bin/c5XEhz /tniZET1mKMh0PxPkLfTJfvPfB9op4sro8vh3eew6EBhktAVYeUzcGNgKgdC7Ziq9+l/ M2+GaUvLKcnp4ZHjc80cg7aBfNF+HeXNiSoUovJH1Q5WuriYDJ9rqS7aSajKK6RzEJaM VJuAmRhZYRNU8kUpHSasOR46psphwpEAIV8fRFOmC5RkUMR/lwVVZ+qqno8WWhkcaHpC 5v8A== X-Gm-Message-State: AOAM533Kwgonu2aerUVcyE/xECJLqF2aM9kj77o8vLTs/kRWKR9g1cZV AfBgGAff+xfWld+R+DDZT0k= X-Google-Smtp-Source: ABdhPJwgc8EHWMckKwCazqIhvImDhIVjo0oHgPp2THPuktjNQgxFbdPABefy0OvhalZsF2HbTLeQnQ== X-Received: by 2002:a7b:c7c8:: with SMTP id z8mr3154656wmk.72.1612524187352; Fri, 05 Feb 2021 03:23:07 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id u10sm8213889wmj.40.2021.02.05.03.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:23:06 -0800 (PST) From: luca.boccassi@gmail.com To: Beilei Xing Cc: Chenmin Sun , Jeff Guo , dpdk stable Date: Fri, 5 Feb 2021 11:15:54 +0000 Message-Id: <20210205111920.1272063-68-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/i40e: fix flex payload rule conflict' has been queued to stable release 20.11.1 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.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/9bfd012b73890134478a04be2a0c0d219fc46d4a Thanks. Luca Boccassi --- >From 9bfd012b73890134478a04be2a0c0d219fc46d4a Mon Sep 17 00:00:00 2001 From: Beilei Xing Date: Tue, 5 Jan 2021 11:12:56 +0800 Subject: [PATCH] net/i40e: fix flex payload rule conflict [ upstream commit 47193beea5035ac27665efe9ba96b64b19ac220f ] With the following commands, the second flow can't be created successfully. 1. flow create 0 ingress pattern eth / ipv4 / udp / raw relative is 1 pattern is 0102030405 / end actions drop / end 2. flow destroy 0 rule 0 3. flow create 0 ingress pattern eth / ipv4 / udp / raw relative is 1 pattern is 010203040506 / end actions drop / end The root cause is that a flag for flex pit isn't reset. Fixes: 6ced3dd72f5f ("net/i40e: support flexible payload parsing for FDIR") Reported-by: Chenmin Sun Signed-off-by: Beilei Xing Acked-by: Jeff Guo --- drivers/net/i40e/i40e_ethdev.h | 3 +++ drivers/net/i40e/i40e_fdir.c | 19 ++++++++++++++++--- drivers/net/i40e/i40e_flow.c | 4 ++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 696c5aaf7e..aac226999c 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -636,6 +636,7 @@ struct i40e_fdir_flow_ext { bool is_udp; /* ipv4|ipv6 udp flow */ enum i40e_flxpld_layer_idx layer_idx; struct i40e_fdir_flex_pit flex_pit[I40E_MAX_FLXPLD_LAYER * I40E_MAX_FLXPLD_FIED]; + bool is_flex_flow; }; /* A structure used to define the input for a flow director filter entry */ @@ -784,6 +785,8 @@ struct i40e_fdir_info { bool flex_mask_flag[I40E_FILTER_PCTYPE_MAX]; bool inset_flag[I40E_FILTER_PCTYPE_MAX]; /* Mark if input set is set */ + + uint32_t flex_flow_count[I40E_MAX_FLXPLD_LAYER]; }; /* Ethertype filter number HW supports */ diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 50c0eee9f2..0343e8b09a 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -355,6 +355,7 @@ i40e_init_flx_pld(struct i40e_pf *pf) I40E_PRTQF_FLX_PIT(index + 1), 0x0000FC29);/*non-used*/ I40E_WRITE_REG(hw, I40E_PRTQF_FLX_PIT(index + 2), 0x0000FC2A);/*non-used*/ + pf->fdir.flex_pit_flag[i] = 0; } /* initialize the masks */ @@ -1513,8 +1514,6 @@ i40e_flow_set_fdir_flex_pit(struct i40e_pf *pf, I40E_WRITE_REG(hw, I40E_PRTQF_FLX_PIT(field_idx), flx_pit); min_next_off++; } - - pf->fdir.flex_pit_flag[layer_idx] = 1; } static int @@ -1686,7 +1685,7 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev, i40e_fdir_filter_convert(filter, &check_filter); if (add) { - if (!filter->input.flow_ext.customized_pctype) { + if (filter->input.flow_ext.is_flex_flow) { 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; @@ -1738,6 +1737,9 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev, fdir_info->fdir_guarantee_free_space > 0) wait_status = false; } else { + if (filter->input.flow_ext.is_flex_flow) + layer_idx = filter->input.flow_ext.layer_idx; + node = i40e_sw_fdir_filter_lookup(fdir_info, &check_filter.fdir.input); if (!node) { @@ -1785,6 +1787,17 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev, goto error_op; } + if (filter->input.flow_ext.is_flex_flow) { + if (add) { + fdir_info->flex_flow_count[layer_idx]++; + pf->fdir.flex_pit_flag[layer_idx] = 1; + } else { + fdir_info->flex_flow_count[layer_idx]--; + if (!fdir_info->flex_flow_count[layer_idx]) + pf->fdir.flex_pit_flag[layer_idx] = 0; + } + } + if (add) { fdir_info->fdir_actual_cnt++; if (fdir_info->fdir_invalprio == 1 && diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index b09ff6590d..bbd666b7a0 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -3069,6 +3069,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, &flex_pit, sizeof(struct i40e_fdir_flex_pit)); filter->input.flow_ext.layer_idx = layer_idx; filter->input.flow_ext.raw_id = raw_id; + filter->input.flow_ext.is_flex_flow = true; break; case RTE_FLOW_ITEM_TYPE_VF: vf_spec = item->spec; @@ -5515,6 +5516,9 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf) pf->fdir.flex_mask_flag[pctype] = 0; } + for (i = 0; i < I40E_MAX_FLXPLD_LAYER; i++) + pf->fdir.flex_pit_flag[i] = 0; + /* Disable FDIR processing as all FDIR rules are now flushed */ i40e_fdir_rx_proc_enable(dev, 0); } -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:32.314774046 +0000 +++ 0068-net-i40e-fix-flex-payload-rule-conflict.patch 2021-02-05 11:18:28.834691645 +0000 @@ -1 +1 @@ -From 47193beea5035ac27665efe9ba96b64b19ac220f Mon Sep 17 00:00:00 2001 +From 9bfd012b73890134478a04be2a0c0d219fc46d4a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 47193beea5035ac27665efe9ba96b64b19ac220f ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org