Skip to contentSkip to conversation

net/ice/base: fix wrong first mask value setting

PATCH Applied Wenjun Wu 2 participants 2 messages Jun 21, 2021 – Jun 29, 2021 Network drivers

lore
Share & tools
lore

Wenjun Wu

author
#0 lore raw

PATCH 1/1 net/ice/base: fix wrong first mask value setting

Since each pf does not share the same structure space, the first mask value should start at 0 instead of hw->pf_id * per_pf to avoid address overflow. Otherwise, address space will overlap when masks.first + masks.count > ICE_PROF_MASK_COUNT, and it may lead to unexpected variable assignment, which causes segmentation fault.

Fixes 9467486f179f ("net/ice/base: enable masking for RSS and FD field vectors")
---
 drivers/net/ice/base/ice_flex_pipe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/base/ice_flex_pipe.c +1 -1
index fabff039ec..aa42177833 100644
@@ -3435,7 +3435,7 @@ static void ice_init_prof_masks(struct ice_hw *hw, enum ice_block blk)
 	per_pf = ICE_PROF_MASK_COUNT / hw->dev_caps.num_funcs;
 
 	hw->blk[blk].masks.count = per_pf;
-	hw->blk[blk].masks.first = hw->pf_id * per_pf;
+	hw->blk[blk].masks.first = 0;
 
 	ice_memset(hw->blk[blk].masks.masks, 0,
 		   sizeof(hw->blk[blk].masks.masks), ICE_NONDMA_MEM);
Signature · 1 line
2.25.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 16 lines

-----Original Message-----
From: Wu, Wenjun1 <[email protected]>
Sent: Monday, June 21, 2021 4:59 PM
To: [email protected]; Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>; [email protected]
Subject: [PATCH v1] net/ice/base: fix wrong first mask value setting

Since each pf does not share the same structure space, the first mask value should start at 0 instead of hw->pf_id * per_pf to avoid address overflow. Otherwise, address space will overlap when masks.first + masks.count > ICE_PROF_MASK_COUNT, and it may lead to unexpected variable assignment, which causes segmentation fault.

Quoted 5 lines
Fixes 9467486f179f ("net/ice/base: enable masking for RSS and FD field

vectors")
Cc: [email protected]

Applied to dpdk-next-net-intel.

Thanks
Qi