From d935fb5bb09188f3f03c4d01a45bc9cac09032db Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Tue, 23 Jul 2019 11:51:12 +0800 Subject: [PATCH] net/ice/base: fix packet type size Change ptype variable to correctly be 16-bits in ice_prof_map structure. Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module") Cc: stable@dpdk.org Signed-off-by: Dan Nowlin Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- drivers/net/ice/base/ice_flex_pipe.c | 3 ++- drivers/net/ice/base/ice_flex_type.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c index c1f23ec020..147fa4d018 100644 --- a/drivers/net/ice/base/ice_flex_pipe.c +++ b/drivers/net/ice/base/ice_flex_pipe.c @@ -4376,7 +4376,8 @@ ice_add_prof_to_lst(struct ice_hw *hw, enum ice_block blk, p->tcam[i].prof_id = map->prof_id; p->tcam[i].tcam_idx = ICE_INVALID_TCAM; - ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg); + if (ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg)) + return ICE_ERR_CFG; p->tcam[i].ptg = ptg; } diff --git a/drivers/net/ice/base/ice_flex_type.h b/drivers/net/ice/base/ice_flex_type.h index dca5cf2857..837e1e8727 100644 --- a/drivers/net/ice/base/ice_flex_type.h +++ b/drivers/net/ice/base/ice_flex_type.h @@ -526,7 +526,7 @@ struct ice_prof_map { u64 context; u8 prof_id; u8 ptype_count; - u8 ptype[ICE_MAX_PTYPE_PER_PROFILE]; + u16 ptype[ICE_MAX_PTYPE_PER_PROFILE]; }; #define ICE_INVALID_TCAM 0xFFFF -- 2.20.1