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 6A0CFA0522; Sat, 27 Jun 2020 12:04:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 256FE1C0BC; Sat, 27 Jun 2020 12:01:38 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 25E171BF9E for ; Sat, 27 Jun 2020 12:01:02 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 293A830C109; Sat, 27 Jun 2020 03:01:01 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 293A830C109 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1593252061; bh=Zr0nrzk5UxCzGeipAFnf45cg4mtM3Al/MkbGLXghesI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JRDa0VfT0lr5OIC2dJqQWbPVPYncij+AHqXdnbPmrdpt32S//iJZAFWy3WvYLqJGV JCps8cBARP35bikcoZ/TNYBNow65Eo22TgWNG4GzulF0BdhBxofvhEeymhCLYjRfps hJ9XTkJJcrjgQKQgkDJkD0liVc1vslkvaOsYOri4= Received: from localhost.localdomain (unknown [10.230.185.215]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 9AE53140093; Sat, 27 Jun 2020 03:01:00 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: Venkat Duvvuru , Somnath Kotur , Mike Baucom Date: Sat, 27 Jun 2020 03:00:42 -0700 Message-Id: <20200627100050.19688-18-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200627100050.19688-1-ajit.khaparde@broadcom.com> References: <20200612125024.15989-1-somnath.kotur@broadcom.com> <20200627100050.19688-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 17/25] net/bnxt: modify IPV6 vtc flow field parsing 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: Venkat Duvvuru ipv6 vtc_flow contains three fields 1. Version 2. Priority / Traffic Class 3. Flow Label Currently, these are not parsed separately and also not set separately in the field bitmap by the flow parser. However, the template treats them separately. As a result, the flow matching doesn't succeed because the bitmaps of parser and the template doesn't match. This patch fixes this problem by parsing the above mentioned fields individually to align with the template. Signed-off-by: Venkat Duvvuru Signed-off-by: Somnath Kotur Reviewed-by: Mike Baucom Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 37 +++++++++++++++++-- drivers/net/bnxt/tf_ulp/ulp_rte_parser.h | 10 +++++ drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 2 +- 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c index 3dd941f15..ec576a997 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c @@ -598,6 +598,7 @@ ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item, 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) { @@ -606,14 +607,27 @@ ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item, } /* - * Copy the rte_flow_item for ipv4 into hdr_field using ipv4 + * Copy the rte_flow_item for ipv6 into hdr_field using ipv6 * header fields */ if (ipv6_spec) { size = sizeof(ipv6_spec->hdr.vtc_flow); + + vtcf = BNXT_ULP_GET_IPV6_VER(ipv6_spec->hdr.vtc_flow); field = ulp_rte_parser_fld_copy(¶ms->hdr_field[idx], - &ipv6_spec->hdr.vtc_flow, + &vtcf, + size); + + vtcf = BNXT_ULP_GET_IPV6_TC(ipv6_spec->hdr.vtc_flow); + field = ulp_rte_parser_fld_copy(field, + &vtcf, + size); + + vtcf = BNXT_ULP_GET_IPV6_FLOWLABEL(ipv6_spec->hdr.vtc_flow); + field = ulp_rte_parser_fld_copy(field, + &vtcf, size); + size = sizeof(ipv6_spec->hdr.payload_len); field = ulp_rte_parser_fld_copy(field, &ipv6_spec->hdr.payload_len, @@ -636,9 +650,24 @@ ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item, size); } if (ipv6_mask) { + size = sizeof(ipv6_mask->hdr.vtc_flow); + + vtcf_mask = BNXT_ULP_GET_IPV6_VER(ipv6_mask->hdr.vtc_flow); + ulp_rte_prsr_mask_copy(params, &idx, + &vtcf_mask, + size); + + vtcf_mask = BNXT_ULP_GET_IPV6_TC(ipv6_mask->hdr.vtc_flow); ulp_rte_prsr_mask_copy(params, &idx, - &ipv6_mask->hdr.vtc_flow, - sizeof(ipv6_mask->hdr.vtc_flow)); + &vtcf_mask, + size); + + vtcf_mask = + BNXT_ULP_GET_IPV6_FLOWLABEL(ipv6_mask->hdr.vtc_flow); + ulp_rte_prsr_mask_copy(params, &idx, + &vtcf_mask, + size); + ulp_rte_prsr_mask_copy(params, &idx, &ipv6_mask->hdr.payload_len, sizeof(ipv6_mask->hdr.payload_len)); diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h index 868e6dc15..c90bff43c 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h +++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h @@ -21,6 +21,16 @@ #define BNXT_ULP_ENCAP_UDP_SIZE 4 #define BNXT_ULP_INVALID_SVIF_VAL -1U +#define BNXT_ULP_GET_IPV6_VER(vtcf) \ + (((vtcf) & BNXT_ULP_PARSER_IPV6_VER_MASK) >> 28) +#define BNXT_ULP_GET_IPV6_TC(vtcf) \ + (((vtcf) & BNXT_ULP_PARSER_IPV6_TC) >> 20) +#define BNXT_ULP_GET_IPV6_FLOWLABEL(vtcf) \ + ((vtcf) & BNXT_ULP_PARSER_IPV6_FLOW_LABEL) +#define BNXT_ULP_PARSER_IPV6_VER_MASK 0xf0000000 +#define BNXT_ULP_PARSER_IPV6_TC 0x0ff00000 +#define BNXT_ULP_PARSER_IPV6_FLOW_LABEL 0x000fffff + /* Function to handle the parsing of the RTE port id. */ int32_t ulp_rte_parser_svif_process(struct ulp_rte_parser_params *params); diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h index 4ca60497e..8805b8b56 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h @@ -23,7 +23,7 @@ #define BNXT_ULP_PROTO_HDR_S_VLAN_NUM 3 #define BNXT_ULP_PROTO_HDR_VLAN_NUM 6 #define BNXT_ULP_PROTO_HDR_IPV4_NUM 10 -#define BNXT_ULP_PROTO_HDR_IPV6_NUM 6 +#define BNXT_ULP_PROTO_HDR_IPV6_NUM 8 #define BNXT_ULP_PROTO_HDR_UDP_NUM 4 #define BNXT_ULP_PROTO_HDR_TCP_NUM 9 #define BNXT_ULP_PROTO_HDR_VXLAN_NUM 4 -- 2.21.1 (Apple Git-122.3)