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 allowed in i40e
driver.

Fixes: 16321de09396 ("ethdev: allow to get RSS hash functions and key")
Cc: sta...@dpdk.org

Change-Id: I992847995cac44172694ea15ab30c4d1e7e48957
Signed-off-by: Qiming Yang <qiming.y...@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 8dc1a4a..a6b97e1 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -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)
-- 
2.9.5

Reply via email to