Skip to content

Commit

Permalink
net/ice: check Rx queue number on RSS init
Browse files Browse the repository at this point in the history
[ upstream commit bfa4f64 ]

When RSS is initialized, rx queues number is used as denominator to set
default value into the RSS lookup table. If it is zero, there will be
error of being divided by 0. So add value check to avoid the error.

Fixes: 5037066 ("net/ice: support device and queue ops")

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
yudapengx authored and cpaelzer committed Feb 2, 2021
1 parent 068c310 commit 593797b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/ice/ice_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2459,6 +2459,12 @@ static int ice_init_rss(struct ice_pf *pf)
vsi->rss_key_size = ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE;
vsi->rss_lut_size = pf->hash_lut_size;

if (nb_q == 0) {
PMD_DRV_LOG(WARNING,
"RSS is not supported as rx queues number is zero\n");
return 0;
}

if (is_safe_mode) {
PMD_DRV_LOG(WARNING, "RSS is not supported in safe mode\n");
return 0;
Expand Down

0 comments on commit 593797b

Please sign in to comment.