[Intel-wired-lan] [next PATCH S46 7/8] i40e: don't configure zero-size RSS table

Bimmy Pujari bimmy.pujari at intel.com
Mon Sep 12 21:18:43 UTC 2016


From: Mitch Williams <mitch.a.williams at intel.com>

In some rare cases, we might get a VSI with no queues. In this case, we
cannot configure RSS on this VSI as it will try to divide by zero when
configuring the lookup table.

Signed-off-by: Mitch Williams <mitch.a.williams at intel.com>
Change-ID: I6ae173a7dd3481a081e079eb10eb80275de2adb0
---
Testing Hints : This bug showed up at Red Hat while
testing a DUP. It looks like you need Purley and need to enable 32 VFs
on all PFs. I haven't reproduced the bug; this was found via code
inspection.

HSD-number: 10020370

 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 995dc44..7fb08f8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8265,6 +8265,8 @@ static int i40e_pf_config_rss(struct i40e_pf *pf)
 	if (!vsi->rss_size)
 		vsi->rss_size = min_t(int, pf->alloc_rss_size,
 				      vsi->num_queue_pairs);
+	if (!vsi->rss_size)
+		return -EINVAL;
 
 	lut = kzalloc(vsi->rss_table_size, GFP_KERNEL);
 	if (!lut)
-- 
2.4.11



More information about the Intel-wired-lan mailing list