From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 40B06A0527 for ; Mon, 9 Nov 2020 19:44:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3A7FA6CA9; Mon, 9 Nov 2020 19:44:01 +0100 (CET) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by dpdk.org (Postfix) with ESMTP id BB3C369C8 for ; Mon, 9 Nov 2020 19:43:59 +0100 (CET) Received: by mail-wr1-f42.google.com with SMTP id 33so9865155wrl.7 for ; Mon, 09 Nov 2020 10:43:59 -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=ZClc/fmLhaJfNtXvaLzDNQm4i6xxugUwCCGk+D/MAOI=; b=hpREckN2XLJLAfH+f46J+T10LaChUeZmszIwiKuilY7gILHcHsg+fgfqNtrYkolznn RHAEj5gl6UxaRmvdC2LSHB/oK8AonNSAVaLUNpbjL0ykYqiP0WiYn/Lkk9jZmBW6kUSM 5Tu6blss7dqr75z4VCFMmos9FtMmUiPZr73JFN0T6+SRZoTGK/mFXlATwGzhnqHOpbwn hou0TleGhuCAd3qrHEof4sLo3JNfuLqLW2J+d8EvlETn/SINWeSEFtrb0yvXj1ks+bic qbg0rfDYKJYgOQKKcs/t2XV7KjIlyastM8J+76XF16CI8twE2HcM1ySdHv91h3E5rPEv ntdg== 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=ZClc/fmLhaJfNtXvaLzDNQm4i6xxugUwCCGk+D/MAOI=; b=b5kVQMNb1db2oaAy7cHDUwetZvOtvdVfxQWq8v0JtWV5iMngvy2VJU2nPwvrLa3+nS 7Dqs6sWxiqPeB2i4N1+EvtjPXRRjEcBGZ/pcdAa/fpCF5q4BGtXfT/nIOkmuGA7homc4 5qRXR7FpDqJKHrjss1IPxJoc+qSwqFWGW69iV8cbEF6wIpaZhvJGEogd4Kf/sTEfo1Q4 WcH6KR0KLRE6T8T4N0FaWZy/MU1Q30pQP7uGWzZIxLOaAkJ55I/SXb1ZDhj+zxy7mRr+ DJtDhkw444217FZAMqrw2be2qxqZKljO/sBbHyMrM/IVDvNNP2LjL132AbsBCv43TDGm dg+g== X-Gm-Message-State: AOAM530+QVYnSztk4Pa6hGMnUfDiUTk6+BTWeriIKm2lfA/FGLOUN4rQ Kcv2EJZHcHyoDKzIdvMa6/A= X-Google-Smtp-Source: ABdhPJzMPWIWJVNXhIQcahH4RKbojn0BUOD+63G+SkpBE/oRbhJs9trFLnwqbW/9mSrl6THsh09TEw== X-Received: by 2002:adf:8465:: with SMTP id 92mr18567371wrf.50.1604947438466; Mon, 09 Nov 2020 10:43:58 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id y11sm285767wmj.36.2020.11.09.10.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 10:43:57 -0800 (PST) From: luca.boccassi@gmail.com To: Lijun Ou Cc: Ophir Munk , Ferruh Yigit , dpdk stable Date: Mon, 9 Nov 2020 18:40:36 +0000 Message-Id: <20201109184111.3463090-48-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201109184111.3463090-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-207-luca.boccassi@gmail.com> <20201109184111.3463090-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'app/testpmd: fix RSS key for flow API RSS rule' has been queued to stable release 19.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/11/20. 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/33e2d706b6bc2551c1bd446baa32ac457c327061 Thanks. Luca Boccassi --- >From 33e2d706b6bc2551c1bd446baa32ac457c327061 Mon Sep 17 00:00:00 2001 From: Lijun Ou Date: Wed, 21 Oct 2020 18:07:10 +0800 Subject: [PATCH] app/testpmd: fix RSS key for flow API RSS rule [ upstream commit 1848b117cca159cc4e5f287876491e86e3413f21 ] When a flow API RSS rule is issued in testpmd, device RSS key is changed unexpectedly, device RSS key is changed to the testpmd default RSS key. Consider the following usage with testpmd: 1. first, startup testpmd: testpmd> show port 0 rss-hash key RSS functions: all ipv4-frag ipv4-other ipv6-frag ipv6-other ip RSS key: 6D5A56DA255B0EC24167253D43A38FB0D0CA2BCBAE7B30B477CB2DA38030F 20C6A42B73BBEAC01FA 2. create a rss rule testpmd> flow create 0 ingress pattern eth / ipv4 / udp / end \ actions rss types ipv4-udp end queues end / end 3. show rss-hash key testpmd> show port 0 rss-hash key RSS functions: all ipv4-udp udp RSS key: 74657374706D6427732064656661756C74205253532068617368206B65792 C206F76657272696465 This is because testpmd always sends a key with the RSS rule, if user provides a key as part of the rule that key is used, if user doesn't provide a key, testpmd default key is sent to the PMDs, which is causing device programmed RSS key to be changed. There was a previous attempt to fix the same issue [1], but it has been reverted back [2] because of the crash when 'key_len' is provided without 'key'. This patch follows the same approach with the initial fix [1] but also addresses the crash. After change, testpmd RSS key is 'NULL' by default, if user provides a key as part of rule it is used, if not no key is sent to the PMDs at all [1] Commit a4391f8bae85 ("app/testpmd: set default RSS key as null") [2] Commit f3698c3d09a6 ("app/testpmd: revert setting default RSS") Fixes: d0ad8648b1c5 ("app/testpmd: fix RSS flow action configuration") Signed-off-by: Lijun Ou Signed-off-by: Ophir Munk Signed-off-by: Ferruh Yigit --- app/test-pmd/cmdline_flow.c | 19 ++----------------- lib/librte_ethdev/rte_flow.c | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index deced65016..be39f4b746 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -3900,30 +3900,15 @@ parse_vc_action_rss(struct context *ctx, const struct token *token, .func = RTE_ETH_HASH_FUNCTION_DEFAULT, .level = 0, .types = rss_hf, - .key_len = sizeof(action_rss_data->key), + .key_len = 0, .queue_num = RTE_MIN(nb_rxq, ACTION_RSS_QUEUE_NUM), - .key = action_rss_data->key, + .key = NULL, .queue = action_rss_data->queue, }, - .key = "testpmd's default RSS hash key, " - "override it for better balancing", .queue = { 0 }, }; for (i = 0; i < action_rss_data->conf.queue_num; ++i) action_rss_data->queue[i] = i; - if (!port_id_is_invalid(ctx->port, DISABLED_WARN) && - ctx->port != (portid_t)RTE_PORT_ALL) { - struct rte_eth_dev_info info; - int ret2; - - ret2 = rte_eth_dev_info_get(ctx->port, &info); - if (ret2 != 0) - return ret2; - - action_rss_data->conf.key_len = - RTE_MIN(sizeof(action_rss_data->key), - info.hash_key_size); - } action->conf = &action_rss_data->conf; return ret; } diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c index 7171c11499..9964a241cb 100644 --- a/lib/librte_ethdev/rte_flow.c +++ b/lib/librte_ethdev/rte_flow.c @@ -621,7 +621,7 @@ rte_flow_conv_action_conf(void *buf, const size_t size, }), size > sizeof(*dst.rss) ? sizeof(*dst.rss) : size); off = sizeof(*dst.rss); - if (src.rss->key_len) { + if (src.rss->key_len && src.rss->key) { off = RTE_ALIGN_CEIL(off, sizeof(*dst.rss->key)); tmp = sizeof(*src.rss->key) * src.rss->key_len; if (size >= off + tmp) -- 2.27.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-09 18:40:13.066572451 +0000 +++ 0048-app-testpmd-fix-RSS-key-for-flow-API-RSS-rule.patch 2020-11-09 18:40:11.175311967 +0000 @@ -1 +1 @@ -From 1848b117cca159cc4e5f287876491e86e3413f21 Mon Sep 17 00:00:00 2001 +From 33e2d706b6bc2551c1bd446baa32ac457c327061 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 1848b117cca159cc4e5f287876491e86e3413f21 ] + @@ -47 +48,0 @@ -Cc: stable@dpdk.org @@ -58 +59 @@ -index cd35d5b9cc..3d1dd05953 100644 +index deced65016..be39f4b746 100644 @@ -61 +62 @@ -@@ -4850,30 +4850,15 @@ parse_vc_action_rss(struct context *ctx, const struct token *token, +@@ -3900,30 +3900,15 @@ parse_vc_action_rss(struct context *ctx, const struct token *token, @@ -95 +96 @@ -index d3e5cbc194..a06f64c271 100644 +index 7171c11499..9964a241cb 100644 @@ -98 +99 @@ -@@ -577,7 +577,7 @@ rte_flow_conv_action_conf(void *buf, const size_t size, +@@ -621,7 +621,7 @@ rte_flow_conv_action_conf(void *buf, const size_t size,