From: Qi Zhang Date: Mon, 30 Mar 2020 11:45:31 +0000 (+0800) Subject: net/ice/base: improve GTPU extend header handle X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8fb908838516fb6ccfcf3d5ba89913974152f8ec;p=dpdk.git net/ice/base: improve GTPU extend header handle A GTPU header can stack with a extend header or not, while current implementation does not allow HDR bit sets like below: ICE_FLOW_SEG_HDR_GTPU_IP | ICE_FLOW_SEG_HDR_GTPU_EH ICE_FLOW_SEG_HDR_GTPU_IP | ICE_FLOW_SEG_HDR_GTPU_UP ICE_FLOW_SEG_HDR_GTPU_IP | ICE_FLOW_SEG_HDR_GTPU_DWN Which is not convenient for upper layer flow parser to generate correct HDR bit. but it could be if we have below assumptions: ICE_FLOW_SEG_HDR_GTPU_DWN -- for GTPU with extend header down link ICE_FLOW_SEG_HDR_GTPU_UP -- for GTPU with extend header up link ICE_FLOW_SEG_HDR_GTPU_EH -- for GTPU with any extend header ICE_FLOW_SEG_HDR_GTPU_IP -- for any GTPU header, but when it combined with any above it downgrade to a dummy one. And handle from specific case to generic case will hit all the cases as expected. if else (hdr & ICE_FLOW_SEG_HDR_GTPU_DWN) { ... } else if (hdr & ICE_FLOW_SEG_HDR_GTPU_UP) { ... } else if (hdr & ICE_FLOW_SEG_HDR_GTPU_EH) { ... } else if (hdr & ICE_FLOW_SEG_HDR_GTPU_IP { ... } Signed-off-by: Qi Zhang Signed-off-by: Paul M Stillwell Jr Acked-by: Qiming Yang --- diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c index e523b8f45c..466fa83d6f 100644 --- a/drivers/net/ice/base/ice_flow.c +++ b/drivers/net/ice/base/ice_flow.c @@ -656,8 +656,7 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) /* Attributes for GTP packet with Extension Header */ params->attr = ice_attr_gtpu_eh; params->attr_cnt = ARRAY_SIZE(ice_attr_gtpu_eh); - } else if ((hdrs & ICE_FLOW_SEG_HDR_GTPU) == - ICE_FLOW_SEG_HDR_GTPU) { + } else if (hdrs & ICE_FLOW_SEG_HDR_GTPU_IP) { src = (const ice_bitmap_t *)ice_ptypes_gtpu; ice_and_bitmap(params->ptypes, params->ptypes, src, ICE_FLOW_PTYPE_MAX);