net/i40e: fix RSS key initialization
authorWei Zhao <wei.zhao1@intel.com>
Thu, 15 Nov 2018 08:57:20 +0000 (16:57 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 15 Nov 2018 22:32:46 +0000 (23:32 +0100)
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 <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/i40e/i40e_ethdev.c

index 3628d7f..7030eb1 100644 (file)
@@ -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;
 }