From: Kishore Padmanabha <kishore.padmana...@broadcom.com>

This change allows adding ip header matches for GRE flows that
does not specify outer ip header in the flow match pattern.

Signed-off-by: Kishore Padmanabha <kishore.padmana...@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvv...@broadcom.com>
Reviewed-by: Michael Baucom <michael.bau...@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khapa...@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schac...@broadcom.com>
---
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      | 7 ++++---
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c 
b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
index 3a9c9bba27..09ebfeb785 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
@@ -1079,7 +1079,8 @@ ulp_rte_ipv4_hdr_handler(const struct rte_flow_item *item,
 
        /* Set the ipv4 header bitmap and computed l3 header bitmaps */
        if (ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV4) ||
-           ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV6)) {
+           ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV6) ||
+           ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_L3_TUN)) {
                ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_I_IPV4);
                ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L3, 1);
                inner_flag = 1;
@@ -1205,7 +1206,8 @@ ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item,
 
        /* Set the ipv6 header bitmap and computed l3 header bitmaps */
        if (ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV4) ||
-           ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV6)) {
+           ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV6) ||
+           ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_L3_TUN)) {
                ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_I_IPV6);
                ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L3, 1);
                inner_flag = 1;
@@ -2087,7 +2089,6 @@ ulp_rte_vxlan_decap_act_handler(const struct 
rte_flow_action *action_item
                       BNXT_ULP_ACT_BIT_VXLAN_DECAP);
        /* Update computational field with tunnel decap info */
        ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L3_TUN_DECAP, 1);
-       ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L3_TUN, 1);
        return BNXT_TF_RC_SUCCESS;
 }
 
diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h 
b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h
index d3bfb8c12d..7d1bc06a3e 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h
+++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h
@@ -27,7 +27,7 @@
 #define BNXT_ULP_PROTO_HDR_UDP_NUM     4
 #define BNXT_ULP_PROTO_HDR_TCP_NUM     9
 #define BNXT_ULP_PROTO_HDR_VXLAN_NUM   4
-#define BNXT_ULP_PROTO_HDR_GRE_NUM     6
+#define BNXT_ULP_PROTO_HDR_GRE_NUM     2
 #define BNXT_ULP_PROTO_HDR_ICMP_NUM    5
 #define BNXT_ULP_PROTO_HDR_MAX         128
 #define BNXT_ULP_PROTO_HDR_ENCAP_MAX   64
-- 
2.17.1

Reply via email to