From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AA96BA052A; Sat, 18 Jul 2020 09:26:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B050B1BFD4; Sat, 18 Jul 2020 09:25:41 +0200 (CEST) Received: from mail-wr1-f99.google.com (mail-wr1-f99.google.com [209.85.221.99]) by dpdk.org (Postfix) with ESMTP id 02FDD1BFC6 for ; Sat, 18 Jul 2020 09:25:37 +0200 (CEST) Received: by mail-wr1-f99.google.com with SMTP id f7so13298465wrw.1 for ; Sat, 18 Jul 2020 00:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9aNqM6jlgDrcxWq+dkaWPR2rbpJoBH7ZvoNOZFbyzns=; b=b81X8nXy6PfqgOV2lQ4ywyn7X0ycxDj21Pc6rE/KFhHA2xrwk0SvVcWwkxU2eJXjtw xhy/f3rdtqSq7KrjEXRad+q6T5TrtdxBKle1L0a4iveJy9YI54wCN1BB3OaGW2VTx5/P QgqCZp1NvxQHbQ9TruiT8thCR586abxsD+G8g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9aNqM6jlgDrcxWq+dkaWPR2rbpJoBH7ZvoNOZFbyzns=; b=dibkRNxbD2vkbH7/eimOBtQrqD2f7jzP/4eWKkNv4AdGoYBI6pM43050qU44N5Xs4N 6veRwfpFDt3HuUKNHaMPJxRDLCAieHjwVc62W7yKop5NZ+YoqFrVGsIHStw4VXVhXLwV ez64diGk2jStfnQyiz1fh/wmLvPGh4onhjBQDVTiLosgkex26LdPt7NnN7Hhgf4JXzq4 R6LvF3tJDRcqCjLtmAym3F9lLla9PHzW42Ng8pKpjWKLbPY0UHD2KE001SHJNiGS+PqZ unWri1JonBzQheH1NXSLrm/of7EdLQpwhmH9N3QHL9J3p/PuP7VAlekwrlJ3qRxmr033 OlwQ== X-Gm-Message-State: AOAM530EmMc4DXviJOetHOxgKwYp7p75z7cUpUXl8mZQFK3jY68GP0Lm W/vLWGM25VOTakRvx9vSqns3lMc4ajXifNspGxVpjgc8RczdaysjIuXvzhiTO4xwqhRYSL0rxa3 aOXTp310BEXPY7G96pR16rGJesMU92dkXcDfs/rgHNV4hp/yeR/YlK8CicoqUZki5+yx5giXAyz OZlQ== X-Google-Smtp-Source: ABdhPJxoX52wYD43YzKy+SVFu7+7CzvUj9raEQphwJHADgKC7bBA5e/Ap6+MIPH+2w2h0DDi1lttjZB3Xzyc X-Received: by 2002:adf:9f12:: with SMTP id l18mr1239654wrf.35.1595057136382; Sat, 18 Jul 2020 00:25:36 -0700 (PDT) Received: from localhost.localdomain ([192.19.223.252]) by smtp-relay.gmail.com with ESMTPS id g14sm34554wrb.16.2020.07.18.00.25.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jul 2020 00:25:36 -0700 (PDT) X-Relaying-Domain: broadcom.com From: Ajit Khaparde To: dev@dpdk.org Cc: Kishore Padmanabha , Somnath Kotur , Michael Baucom Date: Sat, 18 Jul 2020 00:25:06 -0700 Message-Id: <20200718072515.62969-6-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200718072515.62969-1-ajit.khaparde@broadcom.com> References: <20200717141451.11705-1-somnath.kotur@broadcom.com> <20200718072515.62969-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 05/14] net/bnxt: add protocol header info based on proto field data X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kishore Padmanabha The protocol header are implicitly matched based on the proto field data. For instance, if ether type is set as 0x800 in the ether header then ipv4 protocol header is assumed to be present for template matching even if ipv4 header is not present in the given flow pattern. Signed-off-by: Kishore Padmanabha Signed-off-by: Somnath Kotur Reviewed-by: Michael Baucom --- drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 180 +++++++++++++----- .../net/bnxt/tf_ulp/ulp_template_db_enum.h | 4 +- drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 1 + 3 files changed, 140 insertions(+), 45 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c index 4c1221aed..3891bcdc1 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c @@ -16,6 +16,7 @@ #define ULP_VLAN_PRIORITY_SHIFT 13 /* First 3 bits */ #define ULP_VLAN_PRIORITY_MASK 0x700 #define ULP_VLAN_TAG_MASK 0xFFF /* Last 12 bits*/ +#define ULP_UDP_PORT_VXLAN 4789 /* Utility function to skip the void items. */ static inline int32_t @@ -209,6 +210,9 @@ bnxt_ulp_rte_parser_post_process(struct ulp_rte_parser_params *params) } } + /* Merge the hdr_fp_bit into the proto header bit */ + params->hdr_bitmap.bits |= params->hdr_fp_bit.bits; + /* TBD: Handle the flow rejection scenarios */ return 0; } @@ -493,6 +497,34 @@ ulp_rte_phy_port_hdr_handler(const struct rte_flow_item *item, return BNXT_TF_RC_SUCCESS; } +/* Function to handle the update of proto header based on field values */ +static void +ulp_rte_l2_proto_type_update(struct ulp_rte_parser_params *param, + uint16_t type, uint32_t in_flag) +{ + if (type == tfp_cpu_to_be_16(RTE_ETHER_TYPE_IPV4)) { + if (in_flag) { + ULP_BITMAP_SET(param->hdr_fp_bit.bits, + BNXT_ULP_HDR_BIT_I_IPV4); + ULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_I_L3, 1); + } else { + ULP_BITMAP_SET(param->hdr_fp_bit.bits, + BNXT_ULP_HDR_BIT_O_IPV4); + ULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_O_L3, 1); + } + } else if (type == tfp_cpu_to_be_16(RTE_ETHER_TYPE_IPV6)) { + if (in_flag) { + ULP_BITMAP_SET(param->hdr_fp_bit.bits, + BNXT_ULP_HDR_BIT_I_IPV6); + ULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_I_L3, 1); + } else { + ULP_BITMAP_SET(param->hdr_fp_bit.bits, + BNXT_ULP_HDR_BIT_O_IPV6); + ULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_O_L3, 1); + } + } +} + /* Function to handle the parsing of RTE Flow item Ethernet Header. */ int32_t ulp_rte_eth_hdr_handler(const struct rte_flow_item *item, @@ -502,8 +534,9 @@ ulp_rte_eth_hdr_handler(const struct rte_flow_item *item, const struct rte_flow_item_eth *eth_mask = item->mask; struct ulp_rte_hdr_field *field; uint32_t idx = params->field_idx; - uint64_t set_flag = 0; uint32_t size; + uint16_t eth_type = 0; + uint32_t inner_flag = 0; /* * Copy the rte_flow_item for eth into hdr_field using ethernet @@ -521,6 +554,7 @@ ulp_rte_eth_hdr_handler(const struct rte_flow_item *item, field = ulp_rte_parser_fld_copy(field, ð_spec->type, sizeof(eth_spec->type)); + eth_type = eth_spec->type; } if (eth_mask) { ulp_rte_prsr_mask_copy(params, &idx, eth_mask->dst.addr_bytes, @@ -535,17 +569,15 @@ ulp_rte_eth_hdr_handler(const struct rte_flow_item *item, params->vlan_idx = params->field_idx; params->field_idx += BNXT_ULP_PROTO_HDR_VLAN_NUM; - /* Update the hdr_bitmap with BNXT_ULP_HDR_PROTO_I_ETH */ - set_flag = ULP_BITMAP_ISSET(params->hdr_bitmap.bits, - BNXT_ULP_HDR_BIT_O_ETH); - if (set_flag) + /* Update the protocol hdr bitmap */ + if (ULP_BITMAP_ISSET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_O_ETH)) { ULP_BITMAP_SET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_I_ETH); - else - ULP_BITMAP_RESET(params->hdr_bitmap.bits, - BNXT_ULP_HDR_BIT_I_ETH); - - /* update the hdr_bitmap with BNXT_ULP_HDR_PROTO_O_ETH */ - ULP_BITMAP_SET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_O_ETH); + inner_flag = 1; + } else { + ULP_BITMAP_SET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_O_ETH); + } + /* Update the field protocol hdr bitmap */ + ulp_rte_l2_proto_type_update(params, eth_type, inner_flag); return BNXT_TF_RC_SUCCESS; } @@ -563,6 +595,8 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item, uint16_t vlan_tag, priority; uint32_t outer_vtag_num; uint32_t inner_vtag_num; + uint16_t eth_type = 0; + uint32_t inner_flag = 0; /* * Copy the rte_flow_item for vlan into hdr_field using Vlan @@ -583,6 +617,7 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item, field = ulp_rte_parser_fld_copy(field, &vlan_spec->inner_type, sizeof(vlan_spec->inner_type)); + eth_type = vlan_spec->inner_type; } if (vlan_mask) { @@ -653,6 +688,7 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item, ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_ONE_VTAG, 1); ULP_BITMAP_SET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_IO_VLAN); + inner_flag = 1; } else if (ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_O_ETH) && ULP_BITMAP_ISSET(hdr_bit->bits, BNXT_ULP_HDR_BIT_I_ETH) && inner_vtag_num == 1) { @@ -664,13 +700,44 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item, ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_ONE_VTAG, 0); ULP_BITMAP_SET(params->hdr_bitmap.bits, BNXT_ULP_HDR_BIT_II_VLAN); + inner_flag = 1; } else { BNXT_TF_DBG(ERR, "Error Parsing:Vlan hdr found withtout eth\n"); return BNXT_TF_RC_ERROR; } + /* Update the field protocol hdr bitmap */ + ulp_rte_l2_proto_type_update(params, eth_type, inner_flag); return BNXT_TF_RC_SUCCESS; } +/* Function to handle the update of proto header based on field values */ +static void +ulp_rte_l3_proto_type_update(struct ulp_rte_parser_params *param, + uint8_t proto, uint32_t in_flag) +{ + if (proto == IPPROTO_UDP) { + if (in_flag) { + ULP_BITMAP_SET(param->hdr_fp_bit.bits, + BNXT_ULP_HDR_BIT_I_UDP); + ULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_I_L4, 1); + } else { + ULP_BITMAP_SET(param->hdr_fp_bit.bits, + BNXT_ULP_HDR_BIT_O_UDP); + ULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_O_L4, 1); + } + } else if (proto == IPPROTO_TCP) { + if (in_flag) { + ULP_BITMAP_SET(param->hdr_fp_bit.bits, + BNXT_ULP_HDR_BIT_I_TCP); + ULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_I_L4, 1); + } else { + ULP_BITMAP_SET(param->hdr_fp_bit.bits, + BNXT_ULP_HDR_BIT_O_TCP); + ULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_O_L4, 1); + } + } +} + /* Function to handle the parsing of RTE Flow item IPV4 Header. */ int32_t ulp_rte_ipv4_hdr_handler(const struct rte_flow_item *item, @@ -682,11 +749,14 @@ ulp_rte_ipv4_hdr_handler(const struct rte_flow_item *item, struct ulp_rte_hdr_bitmap *hdr_bitmap = ¶ms->hdr_bitmap; uint32_t idx = params->field_idx; uint32_t size; - uint32_t inner_l3, outer_l3; - - inner_l3 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_I_L3); - if (inner_l3) { - BNXT_TF_DBG(ERR, "Parse Error:Third L3 header not supported\n"); + uint8_t proto = 0; + uint32_t inner_flag = 0; + uint32_t cnt; + + /* validate there are no 3rd L3 header */ + cnt = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_L3_HDR_CNT); + if (cnt == 2) { + BNXT_TF_DBG(ERR, "Parse Err:Third L3 header not supported\n"); return BNXT_TF_RC_ERROR; } @@ -723,6 +793,7 @@ ulp_rte_ipv4_hdr_handler(const struct rte_flow_item *item, field = ulp_rte_parser_fld_copy(field, &ipv4_spec->hdr.next_proto_id, size); + proto = ipv4_spec->hdr.next_proto_id; size = sizeof(ipv4_spec->hdr.hdr_checksum); field = ulp_rte_parser_fld_copy(field, &ipv4_spec->hdr.hdr_checksum, @@ -782,18 +853,19 @@ ulp_rte_ipv4_hdr_handler(const struct rte_flow_item *item, params->field_idx += BNXT_ULP_PROTO_HDR_IPV4_NUM; /* Set the ipv4 header bitmap and computed l3 header bitmaps */ - outer_l3 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_O_L3); - if (outer_l3 || - ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV4) || + 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_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_I_IPV4); - inner_l3++; - ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L3, inner_l3); + ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L3, 1); + inner_flag = 1; } else { ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV4); - outer_l3++; - ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L3, outer_l3); + ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L3, 1); } + + /* Update the field protocol hdr bitmap */ + ulp_rte_l3_proto_type_update(params, proto, inner_flag); + ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L3_HDR_CNT, ++cnt); return BNXT_TF_RC_SUCCESS; } @@ -808,12 +880,15 @@ ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item, struct ulp_rte_hdr_bitmap *hdr_bitmap = ¶ms->hdr_bitmap; uint32_t idx = params->field_idx; uint32_t size; - uint32_t inner_l3, outer_l3; uint32_t vtcf, vtcf_mask; - - inner_l3 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_I_L3); - if (inner_l3) { - BNXT_TF_DBG(ERR, "Parse Error: 3'rd L3 header not supported\n"); + uint8_t proto = 0; + uint32_t inner_flag = 0; + uint32_t cnt; + + /* validate there are no 3rd L3 header */ + cnt = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_L3_HDR_CNT); + if (cnt == 2) { + BNXT_TF_DBG(ERR, "Parse Err:Third L3 header not supported\n"); return BNXT_TF_RC_ERROR; } @@ -847,6 +922,7 @@ ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item, field = ulp_rte_parser_fld_copy(field, &ipv6_spec->hdr.proto, size); + proto = ipv6_spec->hdr.proto; size = sizeof(ipv6_spec->hdr.hop_limits); field = ulp_rte_parser_fld_copy(field, &ipv6_spec->hdr.hop_limits, @@ -899,19 +975,33 @@ ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item, params->field_idx += BNXT_ULP_PROTO_HDR_IPV6_NUM; /* Set the ipv6 header bitmap and computed l3 header bitmaps */ - outer_l3 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_O_L3); - if (outer_l3 || - ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV4) || + 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_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; } else { ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_IPV6); ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L3, 1); } + + /* Update the field protocol hdr bitmap */ + ulp_rte_l3_proto_type_update(params, proto, inner_flag); + ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L3_HDR_CNT, ++cnt); + return BNXT_TF_RC_SUCCESS; } +/* Function to handle the update of proto header based on field values */ +static void +ulp_rte_l4_proto_type_update(struct ulp_rte_parser_params *param, + uint16_t dst_port) +{ + if (dst_port == tfp_cpu_to_be_16(ULP_UDP_PORT_VXLAN)) + ULP_BITMAP_SET(param->hdr_fp_bit.bits, + BNXT_ULP_HDR_BIT_T_VXLAN); +} + /* Function to handle the parsing of RTE Flow item UDP Header. */ int32_t ulp_rte_udp_hdr_handler(const struct rte_flow_item *item, @@ -923,10 +1013,11 @@ ulp_rte_udp_hdr_handler(const struct rte_flow_item *item, struct ulp_rte_hdr_bitmap *hdr_bitmap = ¶ms->hdr_bitmap; uint32_t idx = params->field_idx; uint32_t size; - uint32_t inner_l4, outer_l4; + uint16_t dst_port = 0; + uint32_t cnt; - inner_l4 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_I_L4); - if (inner_l4) { + cnt = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_L4_HDR_CNT); + if (cnt == 2) { BNXT_TF_DBG(ERR, "Parse Err:Third L4 header not supported\n"); return BNXT_TF_RC_ERROR; } @@ -944,6 +1035,7 @@ ulp_rte_udp_hdr_handler(const struct rte_flow_item *item, field = ulp_rte_parser_fld_copy(field, &udp_spec->hdr.dst_port, size); + dst_port = udp_spec->hdr.dst_port; size = sizeof(udp_spec->hdr.dgram_len); field = ulp_rte_parser_fld_copy(field, &udp_spec->hdr.dgram_len, @@ -972,16 +1064,17 @@ ulp_rte_udp_hdr_handler(const struct rte_flow_item *item, params->field_idx += BNXT_ULP_PROTO_HDR_UDP_NUM; /* Set the udp header bitmap and computed l4 header bitmaps */ - outer_l4 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_O_L4); - if (outer_l4 || - ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_UDP) || + if (ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_UDP) || ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_TCP)) { ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_I_UDP); ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L4, 1); } else { ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_UDP); ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L4, 1); + /* Update the field protocol hdr bitmap */ + ulp_rte_l4_proto_type_update(params, dst_port); } + ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L4_HDR_CNT, ++cnt); return BNXT_TF_RC_SUCCESS; } @@ -996,11 +1089,11 @@ ulp_rte_tcp_hdr_handler(const struct rte_flow_item *item, struct ulp_rte_hdr_bitmap *hdr_bitmap = ¶ms->hdr_bitmap; uint32_t idx = params->field_idx; uint32_t size; - uint32_t inner_l4, outer_l4; + uint32_t cnt; - inner_l4 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_I_L4); - if (inner_l4) { - BNXT_TF_DBG(ERR, "Parse Error:Third L4 header not supported\n"); + cnt = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_L4_HDR_CNT); + if (cnt == 2) { + BNXT_TF_DBG(ERR, "Parse Err:Third L4 header not supported\n"); return BNXT_TF_RC_ERROR; } @@ -1082,9 +1175,7 @@ ulp_rte_tcp_hdr_handler(const struct rte_flow_item *item, params->field_idx += BNXT_ULP_PROTO_HDR_TCP_NUM; /* Set the udp header bitmap and computed l4 header bitmaps */ - outer_l4 = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_O_L4); - if (outer_l4 || - ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_UDP) || + if (ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_UDP) || ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_TCP)) { ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_I_TCP); ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L4, 1); @@ -1092,6 +1183,7 @@ ulp_rte_tcp_hdr_handler(const struct rte_flow_item *item, ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_TCP); ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L4, 1); } + ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L4_HDR_CNT, ++cnt); return BNXT_TF_RC_SUCCESS; } diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h index 6b68b9576..a9295e006 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h @@ -132,7 +132,9 @@ enum bnxt_ulp_cf_idx { BNXT_ULP_CF_IDX_ACT_PORT_TYPE = 36, BNXT_ULP_CF_IDX_MATCH_PORT_TYPE = 37, BNXT_ULP_CF_IDX_VF_TO_VF = 38, - BNXT_ULP_CF_IDX_LAST = 39 + BNXT_ULP_CF_IDX_L3_HDR_CNT = 39, + BNXT_ULP_CF_IDX_L4_HDR_CNT = 40, + BNXT_ULP_CF_IDX_LAST = 41 }; enum bnxt_ulp_cond_opcode { diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h index 2f2f9a2d1..b9a25b064 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h @@ -63,6 +63,7 @@ struct ulp_rte_act_prop { /* Structure to be used for passing all the parser functions */ struct ulp_rte_parser_params { struct ulp_rte_hdr_bitmap hdr_bitmap; + struct ulp_rte_hdr_bitmap hdr_fp_bit; struct ulp_rte_field_bitmap fld_bitmap; struct ulp_rte_hdr_field hdr_field[BNXT_ULP_PROTO_HDR_MAX]; uint32_t comp_fld[BNXT_ULP_CF_IDX_LAST]; -- 2.21.1 (Apple Git-122.3)