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 50AA4A0C4C for ; Mon, 12 Jul 2021 15:12:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 47600411A1; Mon, 12 Jul 2021 15:12:40 +0200 (CEST) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mails.dpdk.org (Postfix) with ESMTP id 150FA411A1 for ; Mon, 12 Jul 2021 15:12:39 +0200 (CEST) Received: by mail-wr1-f47.google.com with SMTP id r11so20294474wro.9 for ; Mon, 12 Jul 2021 06:12:39 -0700 (PDT) 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=UqDsKzq6ZJBIH0EimKIzLuTDBFAQnzHMUOx77VHadh8=; b=mrnsZsg9pUPsCx0EbjD4ENzXKoPZcIDAQAAs3jio0fKDeqEyqFfACXszK4oH00eh2d pR2I26+RhrVesOy286V7SSPy9D8VABbNSSX9D+wUJMiBPKlXiPeUMehw+mo9HUl9X/LM nyfYLgJbqxOR9oOeHwbMHvQ/hWhanUKlBWzC9VvTSerC1Z32tL8YfVHlk4XKfHwG5URU 16WTpxBJ3eD05mF9DuQuRBhMnK0px/mYSPKiRcE9XiA5V3VHRB7rhcySOylRDnttSiKh EJWJ7YiXO5ivrri/g8YLrz0KO83cX/mgjDjeCexw/I7P6SAyhXnZQdsP0crEfhguGPU4 LSHw== 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=UqDsKzq6ZJBIH0EimKIzLuTDBFAQnzHMUOx77VHadh8=; b=QyS5SVdxPq88pwNFIyBtApSSuHUqhcm2FFxaHvrgAVOUgndkNHgv5HgqoCMUZzFNVn uHq/WACWYeu4KoBQiyAtxKVXNeTrHliCZ266t6W+3+EaPMoPAmmbG1kQuCoRjiVtsKOW QS4nHxOd680pxDMiSazda28NZQBIVKqdXTEhfWbsQF0rbMrB4Zh5dD9P2069UdcqDQNi r6VZlurncD+KKmZM4JCjNyXHfx70nBWCkFcWsWrXhrNg+fouJOSy/19OWbmXqndKmb2p hqdytJoUx35BlsckTtUG9WNT46nB1S36Ah+bDh74eC59L2ITNqOIL4jBFe1u2Ozqpk9l fX5g== X-Gm-Message-State: AOAM531YpG+pBnrXrEP8xgmWNFvurDUmcbO4lKbI+AT2Evufwa8VnFJ3 k6RjdGIhTqmpwiFPUkACTUM= X-Google-Smtp-Source: ABdhPJzXKMFYyjeY0VfwwMMwWxre86PeQ9lsVcaRvkZk6sca7k5rvTdTTdgF7czw+9BTPztYNP06pg== X-Received: by 2002:a05:6000:1842:: with SMTP id c2mr46372098wri.374.1626095558829; Mon, 12 Jul 2021 06:12:38 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id p16sm14445471wrs.52.2021.07.12.06.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:12:38 -0700 (PDT) From: luca.boccassi@gmail.com To: Beilei Xing Cc: Lingli Chen , dpdk stable Date: Mon, 12 Jul 2021 14:04:45 +0100 Message-Id: <20210712130551.2462159-50-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/i40e: fix flow director input set conflict' has been queued to stable release 20.11.3 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.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/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/5299dc34f4682c29cdd735d9f5f2f65f6d7b8460 Thanks. Luca Boccassi --- >From 5299dc34f4682c29cdd735d9f5f2f65f6d7b8460 Mon Sep 17 00:00:00 2001 From: Beilei Xing Date: Thu, 24 Jun 2021 15:29:56 +0800 Subject: [PATCH] net/i40e: fix flow director input set conflict [ upstream commit 2fefa0942e75330e09b8ad7513e89e4a66dd738f ] Currently, there'll be conflict error when running the following commands: 1. flow create 0 ingress pattern eth / ipv4 / udp src is 32 / end actions queue index 2 / end 2. flow destroy 0 rule 0 3. flow create 0 ingress pattern eth / ipv4 / udp dst is 32 / end actions queue index 2 / end This patch fixes the input set conflict issue. Fixes: 42044b69c67d ("net/i40e: support input set selection for FDIR") Fixes: 4a072ad43442 ("net/i40e: fix flow director config after flow validate") Signed-off-by: Beilei Xing Tested-by: Lingli Chen --- drivers/net/i40e/i40e_ethdev.c | 5 +++++ drivers/net/i40e/i40e_ethdev.h | 2 +- drivers/net/i40e/i40e_fdir.c | 7 ++++--- drivers/net/i40e/i40e_flow.c | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 100d42d6bd..63a9fc04d0 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1082,6 +1082,7 @@ i40e_init_fdir_filter_list(struct rte_eth_dev *dev) char fdir_hash_name[RTE_HASH_NAMESIZE]; uint32_t alloc = hw->func_caps.fd_filters_guaranteed; uint32_t best = hw->func_caps.fd_filters_best_effort; + enum i40e_filter_pctype pctype; struct rte_bitmap *bmp = NULL; uint32_t bmp_size; void *mem = NULL; @@ -1130,6 +1131,10 @@ i40e_init_fdir_filter_list(struct rte_eth_dev *dev) goto err_fdir_filter_array_alloc; } + for (pctype = I40E_FILTER_PCTYPE_NONF_IPV4_UDP; + pctype <= I40E_FILTER_PCTYPE_L2_PAYLOAD; pctype++) + pf->fdir.flow_count[pctype] = 0; + fdir_info->fdir_space_size = alloc + best; fdir_info->fdir_actual_cnt = 0; fdir_info->fdir_guarantee_total_space = alloc; diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index aeabe5a205..ba1bb3dc98 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -786,7 +786,7 @@ struct i40e_fdir_info { bool flex_pit_flag[I40E_MAX_FLXPLD_LAYER]; bool flex_mask_flag[I40E_FILTER_PCTYPE_MAX]; - bool inset_flag[I40E_FILTER_PCTYPE_MAX]; /* Mark if input set is set */ + uint32_t flow_count[I40E_FILTER_PCTYPE_MAX]; uint32_t flex_flow_count[I40E_MAX_FLXPLD_LAYER]; }; diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index a447cfdd92..5f8e167632 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -1606,13 +1606,13 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf, } /* Check if the configuration is conflicted */ - if (pf->fdir.inset_flag[pctype] && + if (pf->fdir.flow_count[pctype] && memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) { PMD_DRV_LOG(ERR, "Conflict with the first rule's input set."); return -EINVAL; } - if (pf->fdir.inset_flag[pctype] && + if (pf->fdir.flow_count[pctype] && !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) return 0; @@ -1665,7 +1665,6 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf, I40E_WRITE_FLUSH(hw); pf->fdir.input_set[pctype] = input_set; - pf->fdir.inset_flag[pctype] = 1; return 0; } @@ -1889,11 +1888,13 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev, } if (add) { + fdir_info->flow_count[pctype]++; fdir_info->fdir_actual_cnt++; if (fdir_info->fdir_invalprio == 1 && fdir_info->fdir_guarantee_free_space > 0) fdir_info->fdir_guarantee_free_space--; } else { + fdir_info->flow_count[pctype]--; fdir_info->fdir_actual_cnt--; if (fdir_info->fdir_invalprio == 1 && fdir_info->fdir_guarantee_free_space < diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 19bdce0195..7de1a8dbc0 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -5501,7 +5501,7 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf) for (pctype = I40E_FILTER_PCTYPE_NONF_IPV4_UDP; pctype <= I40E_FILTER_PCTYPE_L2_PAYLOAD; pctype++) { - pf->fdir.inset_flag[pctype] = 0; + pf->fdir.flow_count[pctype] = 0; pf->fdir.flex_mask_flag[pctype] = 0; } -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:39.226644617 +0100 +++ 0050-net-i40e-fix-flow-director-input-set-conflict.patch 2021-07-12 13:41:36.398120694 +0100 @@ -1 +1 @@ -From 2fefa0942e75330e09b8ad7513e89e4a66dd738f Mon Sep 17 00:00:00 2001 +From 5299dc34f4682c29cdd735d9f5f2f65f6d7b8460 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 2fefa0942e75330e09b8ad7513e89e4a66dd738f ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org @@ -32 +33 @@ -index dd61258739..df716c180f 100644 +index 100d42d6bd..63a9fc04d0 100644 @@ -35 +36 @@ -@@ -1087,6 +1087,7 @@ i40e_init_fdir_filter_list(struct rte_eth_dev *dev) +@@ -1082,6 +1082,7 @@ i40e_init_fdir_filter_list(struct rte_eth_dev *dev) @@ -43 +44 @@ -@@ -1135,6 +1136,10 @@ i40e_init_fdir_filter_list(struct rte_eth_dev *dev) +@@ -1130,6 +1131,10 @@ i40e_init_fdir_filter_list(struct rte_eth_dev *dev) @@ -55 +56 @@ -index ba6acd1878..585a0d8eb2 100644 +index aeabe5a205..ba1bb3dc98 100644 @@ -58 +59 @@ -@@ -788,7 +788,7 @@ struct i40e_fdir_info { +@@ -786,7 +786,7 @@ struct i40e_fdir_info { @@ -68 +69 @@ -index 20658816ee..6f73936091 100644 +index a447cfdd92..5f8e167632 100644 @@ -71 +72 @@ -@@ -1607,13 +1607,13 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf, +@@ -1606,13 +1606,13 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf, @@ -87 +88 @@ -@@ -1666,7 +1666,6 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf, +@@ -1665,7 +1665,6 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf, @@ -95 +96 @@ -@@ -1890,11 +1889,13 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev, +@@ -1889,11 +1888,13 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev, @@ -110 +111 @@ -index 2cc9ad9ef7..ff8441b378 100644 +index 19bdce0195..7de1a8dbc0 100644 @@ -113 +114 @@ -@@ -4940,7 +4940,7 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf) +@@ -5501,7 +5501,7 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)