From: Wei Zhao Date: Thu, 15 Nov 2018 08:57:20 +0000 (+0800) Subject: net/i40e: fix RSS key initialization X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2e00f9e70ea230365107875d66ea1d62e0af87c5;p=dpdk.git net/i40e: fix RSS key initialization 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 Tested-by: Yuan Peng Acked-by: Qi Zhang --- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 3628d7f2ae..7030eb1fa6 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -12583,8 +12583,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, @@ -12594,6 +12592,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; }