From: Alvin Zhang Date: Fri, 8 Jan 2021 07:29:10 +0000 (+0800) Subject: net/ice: fix RSS lookup table initialization X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7fe2fde05ac8766afaed4344659e39e8fc6b2514;p=dpdk.git net/ice: fix RSS lookup table initialization RSS look-up table initialization is done incorrectly due to divide-by-zero error. Add a check to rx-queue count. Fixes: 50370662b727 ("net/ice: support device and queue ops") Cc: stable@dpdk.org Signed-off-by: Alvin Zhang Tested-by: Wei Xie Acked-by: Qi Zhang --- diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 587f485ee3..e2799a8eb2 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -3274,10 +3274,12 @@ ice_dev_configure(struct rte_eth_dev *dev) if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH; - ret = ice_init_rss(pf); - if (ret) { - PMD_DRV_LOG(ERR, "Failed to enable rss for PF"); - return ret; + if (dev->data->nb_rx_queues) { + ret = ice_init_rss(pf); + if (ret) { + PMD_DRV_LOG(ERR, "Failed to enable rss for PF"); + return ret; + } } return 0;