From fe33a6a65fa4ecb94c0417c35a50247cdcfda7c0 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Wed, 30 Oct 2019 09:14:32 +0800 Subject: [PATCH] net/ice/base: fix ptype mapping pollution from GTP flow A new gtp flow's profile will capture other profile's non-gtp ptypes which is unexpected. For example, a RSS flow for inner IP / UDP on regular tunnel packet's behaviour will be changed by a following GTP RSS rule where inner IP is the only inputset, since all tunnel ptypes have been shifted from the first profile to the second one. The patch fixes the issue by correcting the ptype mapping that prevents the ptype shift. Fixes: d1c2f76b440a ("net/ice/base: support GTP and PPPoE protocols") Signed-off-by: Qi Zhang Tested-by: Simei Su Acked-by: Xiaolong Ye --- drivers/net/ice/base/ice_flow.c | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c index d2dbb1177d..6264e77479 100644 --- a/drivers/net/ice/base/ice_flow.c +++ b/drivers/net/ice/base/ice_flow.c @@ -579,29 +579,21 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) src, ICE_FLOW_PTYPE_MAX); } } else if (hdrs & ICE_FLOW_SEG_HDR_GTPC) { - if (!i) { - src = (const ice_bitmap_t *)ice_ptypes_gtpc; - ice_and_bitmap(params->ptypes, params->ptypes, - src, ICE_FLOW_PTYPE_MAX); - } + src = (const ice_bitmap_t *)ice_ptypes_gtpc; + ice_and_bitmap(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); } else if (hdrs & ICE_FLOW_SEG_HDR_GTPC_TEID) { - if (!i) { - src = (const ice_bitmap_t *)ice_ptypes_gtpc_tid; - ice_and_bitmap(params->ptypes, params->ptypes, - src, ICE_FLOW_PTYPE_MAX); - } + src = (const ice_bitmap_t *)ice_ptypes_gtpc_tid; + ice_and_bitmap(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); } else if (hdrs & ICE_FLOW_SEG_HDR_GTPU) { - if (!i) { - src = (const ice_bitmap_t *)ice_ptypes_gtpu; - ice_and_bitmap(params->ptypes, params->ptypes, - src, ICE_FLOW_PTYPE_MAX); - } + src = (const ice_bitmap_t *)ice_ptypes_gtpu; + ice_and_bitmap(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); } else if (hdrs & ICE_FLOW_SEG_HDR_GTPU_EH) { - if (!i) { - src = (const ice_bitmap_t *)ice_ptypes_gtpu; - ice_and_bitmap(params->ptypes, params->ptypes, - src, ICE_FLOW_PTYPE_MAX); - } + src = (const ice_bitmap_t *)ice_ptypes_gtpu; + ice_and_bitmap(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); /* Attributes for GTP packet with Extension Header */ params->attr = ice_attr_gtpu_eh; -- 2.20.1