net/i40e: fix get RSS conf
authorQiming Yang <qiming.yang@intel.com>
Mon, 24 Dec 2018 15:34:02 +0000 (23:34 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 3 Jan 2019 09:52:18 +0000 (10:52 +0100)
rte_eth_dev_rss_hash_conf_get API doesn't force 'rss_conf.rss_key'
to be not NULL, so rss_key = NULL should be alllowed in i40e
driver.

Fixes: 16321de09396 ("ethdev: allow to get RSS hash functions and key")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/i40e/i40e_ethdev.c

index 8dc1a4a..a6b97e1 100644 (file)
@@ -7407,7 +7407,7 @@ i40e_get_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t *key_len)
        int ret;
 
        if (!key || !key_len)
-               return -EINVAL;
+               return 0;
 
        if (pf->flags & I40E_FLAG_RSS_AQ_CAPABLE) {
                ret = i40e_aq_get_rss_key(hw, vsi->vsi_id,
@@ -7492,6 +7492,9 @@ i40e_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
        uint64_t hena;
        int ret;
 
+       if (!rss_conf)
+               return -EINVAL;
+
        ret = i40e_get_rss_key(pf->main_vsi, rss_conf->rss_key,
                         &rss_conf->rss_key_len);
        if (ret)