From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id E0D3F4CB1 for ; Thu, 15 Nov 2018 10:21:50 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Nov 2018 01:21:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,236,1539673200"; d="scan'208";a="108446907" Received: from dpdk6.bj.intel.com ([172.16.182.192]) by orsmga001.jf.intel.com with ESMTP; 15 Nov 2018 01:21:47 -0800 From: Wei Zhao To: dev@dpdk.org Cc: qi.z.zhang@intel.com, yuan.peng@intel.com, Wei Zhao Date: Thu, 15 Nov 2018 16:57:20 +0800 Message-Id: <1542272240-24905-1-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.7.5 Subject: [dpdk-dev] [PATCH] net/i40e: fix RSS key pointer initialization error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 09:21:51 -0000 The assignment should be done after initialization, or it will be zero. Fixes: 264b23e3d2c1 ("net/i40e: add parameter check for RSS flow init") Signed-off-by: Wei Zhao --- drivers/net/i40e/i40e_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 790ecc3..a96d407 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -12554,8 +12554,6 @@ i40e_rss_conf_init(struct i40e_rte_flow_rss_conf *out, return -EINVAL; if (!in->key && in->key_len) return -EINVAL; - if (in->key) - out->conf.key = memcpy(out->key, in->key, in->key_len); out->conf = (struct rte_flow_action_rss){ .func = in->func, .level = in->level, @@ -12565,6 +12563,8 @@ i40e_rss_conf_init(struct i40e_rte_flow_rss_conf *out, .queue = memcpy(out->queue, in->queue, sizeof(*in->queue) * in->queue_num), }; + if (in->key) + out->conf.key = memcpy(out->key, in->key, in->key_len); return 0; } -- 2.7.5