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 4A922A0A0A for ; Thu, 21 Jan 2021 10:42:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A3DB140F46; Thu, 21 Jan 2021 10:42:10 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id D023F140F34; Thu, 21 Jan 2021 10:42:07 +0100 (CET) IronPort-SDR: PH2Jg1j5srNPuqbj+8PZfvo9oyxS8Vi6c1vbMSTz005UxXMWoa1715jOyHPl+B94iI+/RmpQOZ BC5dYPuFTXEA== X-IronPort-AV: E=McAfee;i="6000,8403,9870"; a="179394733" X-IronPort-AV: E=Sophos;i="5.79,363,1602572400"; d="scan'208";a="179394733" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2021 01:42:06 -0800 IronPort-SDR: zTDVAsnNt7dG2PJfrDf+F47L5DvQgwOcAvNmF0E5zsM0deWEsyIHoUSCM78wuTdOgg/d3IGIR8 S6OVG9bhOFeg== X-IronPort-AV: E=Sophos;i="5.79,363,1602572400"; d="scan'208";a="403130523" Received: from shwdenpg235.ccr.corp.intel.com ([10.240.182.60]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2021 01:42:04 -0800 From: "Zhang,Alvin" To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Alvin Zhang , stable@dpdk.org Date: Thu, 21 Jan 2021 17:41:54 +0800 Message-Id: <20210121094154.6788-1-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20210118085937.12072-1-alvinx.zhang@intel.com> References: <20210118085937.12072-1-alvinx.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v2] app/testpmd: fix RSS key 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" From: Alvin Zhang Since the patch '1848b117' has initialized the variable 'key' in 'struct rte_flow_action_rss' with 'NULL', the PMD cannot get the RSS key now. Details as bellow: testpmd> flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-other end key 1234567890123456789012345678901234567890FFFFFFFFFFFF123 4567890123456789012345678901234567890FFFFFFFFFFFF queues end / end Flow rule #1 created testpmd> show port 0 rss-hash key RSS functions: all ipv4-other ip RSS key: 4439796BB54C5023B675EA5B124F9F30B8A2C03DDFDC4D02A08C9B3 34AF64A4C05C6FA343958D8557D99583AE138C92E81150366 This patch sets offset and size of the 'key' variable as the first parameter of the token 'key'. Later, the address of the RSS key will be copied to 'key' variable. Fixes: 1848b117cca1 ("app/testpmd: fix RSS key for flow API RSS rule") Cc: stable@dpdk.org Signed-off-by: Alvin Zhang --- app/test-pmd/cmdline_flow.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 0618611..067e120 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -3541,7 +3541,10 @@ static int comp_set_modify_field_id(struct context *, const struct token *, .name = "key", .help = "RSS hash key", .next = NEXT(action_rss, NEXT_ENTRY(HEX)), - .args = ARGS(ARGS_ENTRY_ARB(0, 0), + .args = ARGS(ARGS_ENTRY_ARB + (offsetof(struct action_rss_data, conf) + + offsetof(struct rte_flow_action_rss, key), + sizeof(((struct rte_flow_action_rss *)0)->key)), ARGS_ENTRY_ARB (offsetof(struct action_rss_data, conf) + offsetof(struct rte_flow_action_rss, key_len), -- 1.8.3.1