net/iavf: fix QFI field bit check for GTPU EH
authorJunfeng Guo <junfeng.guo@intel.com>
Fri, 8 Oct 2021 10:41:43 +0000 (10:41 +0000)
committerQi Zhang <qi.z.zhang@intel.com>
Fri, 8 Oct 2021 06:18:07 +0000 (08:18 +0200)
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 <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_fdir.c

index ea2b692..ea99806 100644 (file)
@@ -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,