Skip to content

Commit

Permalink
net/ice/base: fix first profile mask
Browse files Browse the repository at this point in the history
[ upstream commit 148fdf2 ]

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: 9467486 ("net/ice/base: enable masking for RSS and FD field vectors")

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
Junewu7777 authored and cpaelzer committed Aug 9, 2021
1 parent bc88f4c commit 75d705f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ice/base/ice_flex_pipe.c
Expand Up @@ -2953,7 +2953,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);
Expand Down

0 comments on commit 75d705f

Please sign in to comment.