From 9381e4c04b6aea54c85fa6bc298deb5a4f4e6719 Mon Sep 17 00:00:00 2001 From: Junfeng Guo Date: Fri, 8 Oct 2021 10:41:43 +0000 Subject: [PATCH] net/iavf: fix QFI field bit check for GTPU EH If GTPU Extension header has no pdu_type setting, the parsed value of gtp_psc_spec->hdr.type will be 0, which is same as IAVF_GTPU_EH_DWLINK. Thus, for this case, we should check gtp_psc_mask->hdr.type instead, to set QFI field bit of GTPU_EH first. Fixes: cd212c466992 ("net/iavf: fix QFI fields of GTPU UL/DL for flow director") Cc: stable@dpdk.org Signed-off-by: Junfeng Guo Acked-by: Qi Zhang --- drivers/net/iavf/iavf_fdir.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c index ea2b692712..ea99806330 100644 --- a/drivers/net/iavf/iavf_fdir.c +++ b/drivers/net/iavf/iavf_fdir.c @@ -1172,7 +1172,10 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad, if (gtp_psc_spec && gtp_psc_mask) { if (gtp_psc_mask->hdr.qfi == 0x3F) { input_set |= IAVF_INSET_GTPU_QFI; - if (gtp_psc_spec->hdr.type == + if (!gtp_psc_mask->hdr.type) + VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, + GTPU_EH, QFI); + else if (gtp_psc_spec->hdr.type == IAVF_GTPU_EH_UPLINK) VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, GTPU_UP, QFI); @@ -1180,9 +1183,6 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad, IAVF_GTPU_EH_DWLINK) VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, GTPU_DWN, QFI); - else - VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, - GTPU_EH, QFI); } rte_memcpy(hdr->buffer, gtp_psc_spec, -- 2.20.1