get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/77280/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 77280,
    "url": "http://patches.dpdk.org/api/patches/77280/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200911015603.88359-19-ajit.khaparde@broadcom.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20200911015603.88359-19-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200911015603.88359-19-ajit.khaparde@broadcom.com",
    "date": "2020-09-11T01:55:56",
    "name": "[18/25] net/bnxt: enable support for VXLAN ipv6 encapsulation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2e55026a1c108da529acba50c4070d58c046d6ec",
    "submitter": {
        "id": 501,
        "url": "http://patches.dpdk.org/api/people/501/?format=api",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "http://patches.dpdk.org/api/users/1766/?format=api",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200911015603.88359-19-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 12116,
            "url": "http://patches.dpdk.org/api/series/12116/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12116",
            "date": "2020-09-11T01:55:38",
            "name": "patchset for bnxt",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/12116/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77280/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/77280/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 40421A04B5;\n\tFri, 11 Sep 2020 03:59:26 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id EE4FA1C1A2;\n\tFri, 11 Sep 2020 03:57:30 +0200 (CEST)",
            "from mail-pf1-f228.google.com (mail-pf1-f228.google.com\n [209.85.210.228]) by dpdk.org (Postfix) with ESMTP id BF3ED1C1A2\n for <dev@dpdk.org>; Fri, 11 Sep 2020 03:57:28 +0200 (CEST)",
            "by mail-pf1-f228.google.com with SMTP id b124so5995973pfg.13\n for <dev@dpdk.org>; Thu, 10 Sep 2020 18:57:28 -0700 (PDT)",
            "from localhost.localdomain ([192.19.223.252])\n by smtp-relay.gmail.com with ESMTPS id cl6sm80986pjb.15.2020.09.10.18.57.23\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Thu, 10 Sep 2020 18:57:27 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com;\n s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=oRA2K2uTsiqAo1B3E0chKMice/T0s2p0qVOwjdm026Y=;\n b=UQrcULsLzn3rpTUVEmSLKK5tPIDUlH+Khj7dSMAawzbmjMEHi8UduxhOJ5FYGmGqPz\n xB7XdZ3txXKPqmVp5HR3gVsNrz0oi2OgfgmYN8GzVUoPAcbsumRpEqx62Kmb979OUJya\n BbDPrR7g0vNOpM/CemQuhCKAH10Ga/hMc/+EQ=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=oRA2K2uTsiqAo1B3E0chKMice/T0s2p0qVOwjdm026Y=;\n b=ks2D3/41g4fju7Hz4id8I0r3GOAhub6m4pYDX2MBNtPxjOHHSRiJw4985A5bVTC/dh\n uNU1gnofDKMeQhxMHbfrOiOudqCPW3k/Sna+BZNmqsxK2tq04w4ES6gqCM+sjPR98VWa\n 4ezn+GFBJyM904tAnwGe9wDRAgAkeS9U/r01Whf3pWhaiFpYtPMr/yFQ4LvTxmXl+IXx\n NMvVc4708rIxh8IgvlHxcH8r+2ebBy0LSoASP8CSNxEAP64njQUbZaEmjcF6sljuttT1\n z90NPO6e1s3ZRheYilPXF2QqE6GCWNnSdj6crOrWNEmsXndtH8evn8ek5tI3DQ4X/sFC\n v5/g==",
        "X-Gm-Message-State": "AOAM530OrLsRC64ndPVkIOPUSvyGo62Wnqd7PiCFSYHlwCTyBS2DM8EW\n 1XTVq6fJSwF0VDcR3/xjZQI3uNkawdyDXiTMSJc9IfzxL3rH5fgWhGIEmnsQdppt+U5/XCvy6+d\n n+GFlECCIKG9sVpL59GYTFK+zOfe+WkxBwRf/gV/T7dwccKlE4pqVeRBBJ6f68NazpjVMp74+Ca\n jG2A==",
        "X-Google-Smtp-Source": "\n ABdhPJwH1E66G02Fi4gdiEDDGKv4R+w0Wxku1voLnoG5lQsREb+c+MD281KPZwkDIIcekJcqMtlz/8s9nUqQ",
        "X-Received": "by 2002:a17:902:70c9:: with SMTP id\n l9mr8183176plt.161.1599789447759;\n Thu, 10 Sep 2020 18:57:27 -0700 (PDT)",
        "X-Relaying-Domain": "broadcom.com",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "Kishore Padmanabha <kishore.padmanabha@broadcom.com>,\n Mike Baucom <michael.baucom@broadcom.com>",
        "Date": "Thu, 10 Sep 2020 18:55:56 -0700",
        "Message-Id": "<20200911015603.88359-19-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.21.1 (Apple Git-122.3)",
        "In-Reply-To": "<20200911015603.88359-1-ajit.khaparde@broadcom.com>",
        "References": "<20200911015603.88359-1-ajit.khaparde@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 18/25] net/bnxt: enable support for VXLAN ipv6\n\tencapsulation",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\n\nAdd code to support vxlan ipv6 tunnel encapsulation. The\nipv6 flow traffic class and flow label wild card match\nare ignore to support ovs offload.\n\nSigned-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nReviewed-by: Mike Baucom <michael.baucom@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |   1 +\n drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      | 132 ++++++++++++++----\n drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |   5 +-\n drivers/net/bnxt/tf_ulp/ulp_template_db_act.c |   2 +-\n drivers/net/bnxt/tf_ulp/ulp_utils.c           |  43 ++++--\n drivers/net/bnxt/tf_ulp/ulp_utils.h           |   7 +-\n 6 files changed, 147 insertions(+), 43 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\nindex 1e4aa8da4..eae8884bd 100644\n--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\n+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\n@@ -149,6 +149,7 @@ ulp_ctx_session_open(struct bnxt *bp,\n \n \t/* SP */\n \tresources->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_SP_SMAC_IPV4] = 488;\n+\tresources->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_SP_SMAC_IPV6] = 511;\n \n \trc = tf_open_session(&bp->tfp, &params);\n \tif (rc) {\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\nindex ed95cf60f..03d759851 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\n@@ -78,6 +78,16 @@ ulp_rte_prsr_mask_copy(struct ulp_rte_parser_params *params,\n \t*idx = *idx + 1;\n }\n \n+/* Utility function to ignore field masks items */\n+static void\n+ulp_rte_prsr_mask_ignore(struct ulp_rte_parser_params *params __rte_unused,\n+\t\t\t uint32_t *idx,\n+\t\t\t const void *buffer __rte_unused,\n+\t\t\t uint32_t size __rte_unused)\n+{\n+\t*idx = *idx + 1;\n+}\n+\n /*\n  * Function to handle the parsing of RTE Flows and placing\n  * the RTE flow items into the ulp structures.\n@@ -741,7 +751,8 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,\n \t\t * wild card match and it is not supported. This is a work\n \t\t * around and shall be addressed in the future.\n \t\t */\n-\t\tidx += 1;\n+\t\tulp_rte_prsr_mask_ignore(params, &idx, &priority,\n+\t\t\t\t\t sizeof(priority));\n \n \t\tulp_rte_prsr_mask_copy(params, &idx, &vlan_tag,\n \t\t\t\t       sizeof(vlan_tag));\n@@ -920,7 +931,10 @@ ulp_rte_ipv4_hdr_handler(const struct rte_flow_item *item,\n \t\t * match and it is not supported. This is a work around and\n \t\t * shall be addressed in the future.\n \t\t */\n-\t\tidx += 1;\n+\t\tulp_rte_prsr_mask_ignore(params, &idx,\n+\t\t\t\t\t &ipv4_mask->hdr.type_of_service,\n+\t\t\t\t\t sizeof(ipv4_mask->hdr.type_of_service)\n+\t\t\t\t\t );\n \n \t\tulp_rte_prsr_mask_copy(params, &idx,\n \t\t\t\t       &ipv4_mask->hdr.total_length,\n@@ -1041,17 +1055,17 @@ ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item,\n \t\tulp_rte_prsr_mask_copy(params, &idx,\n \t\t\t\t       &vtcf_mask,\n \t\t\t\t       size);\n-\n+\t\t/*\n+\t\t * The TC and flow lable field are ignored since OVS is seting\n+\t\t * it for match and it is not supported.\n+\t\t * This is a work around and\n+\t\t * shall be addressed in the future.\n+\t\t */\n \t\tvtcf_mask = BNXT_ULP_GET_IPV6_TC(ipv6_mask->hdr.vtc_flow);\n-\t\tulp_rte_prsr_mask_copy(params, &idx,\n-\t\t\t\t       &vtcf_mask,\n-\t\t\t\t       size);\n-\n+\t\tulp_rte_prsr_mask_ignore(params, &idx, &vtcf_mask, size);\n \t\tvtcf_mask =\n \t\t\tBNXT_ULP_GET_IPV6_FLOWLABEL(ipv6_mask->hdr.vtc_flow);\n-\t\tulp_rte_prsr_mask_copy(params, &idx,\n-\t\t\t\t       &vtcf_mask,\n-\t\t\t\t       size);\n+\t\tulp_rte_prsr_mask_ignore(params, &idx, &vtcf_mask, size);\n \n \t\tulp_rte_prsr_mask_copy(params, &idx,\n \t\t\t\t       &ipv6_mask->hdr.payload_len,\n@@ -1414,8 +1428,12 @@ ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item,\n \t/* IP header per byte - ver/hlen, TOS, ID, ID, FRAG, FRAG, TTL, PROTO */\n \tconst uint8_t def_ipv4_hdr[] = {0x45, 0x00, 0x00, 0x01, 0x00,\n \t\t\t\t    0x00, 0x40, 0x11};\n+\t/* IPv6 header per byte - vtc-flow,flow,zero,nexthdr-ttl */\n+\tconst uint8_t def_ipv6_hdr[] = {0x60, 0x00, 0x00, 0x01, 0x00,\n+\t\t\t\t0x00, 0x11, 0xf6};\n \tstruct ulp_rte_act_bitmap *act = &params->act_bitmap;\n \tstruct ulp_rte_act_prop *ap = &params->act_prop;\n+\tconst uint8_t *tmp_buff;\n \n \tvxlan_encap = action_item->conf;\n \tif (!vxlan_encap) {\n@@ -1441,12 +1459,14 @@ ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item,\n \tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_L2_DMAC];\n \tulp_encap_buffer_copy(buff,\n \t\t\t      eth_spec->dst.addr_bytes,\n-\t\t\t      BNXT_ULP_ACT_PROP_SZ_ENCAP_L2_DMAC);\n+\t\t\t      BNXT_ULP_ACT_PROP_SZ_ENCAP_L2_DMAC,\n+\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n \n \tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_L2_SMAC];\n \tulp_encap_buffer_copy(buff,\n \t\t\t      eth_spec->src.addr_bytes,\n-\t\t\t      BNXT_ULP_ACT_PROP_SZ_ENCAP_L2_SMAC);\n+\t\t\t      BNXT_ULP_ACT_PROP_SZ_ENCAP_L2_SMAC,\n+\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n \n \t/* Goto the next item */\n \tif (!ulp_rte_item_skip_void(&item, 1))\n@@ -1458,7 +1478,8 @@ ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item,\n \t\tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_VTAG];\n \t\tulp_encap_buffer_copy(buff,\n \t\t\t\t      item->spec,\n-\t\t\t\t      sizeof(struct rte_flow_item_vlan));\n+\t\t\t\t      sizeof(struct rte_flow_item_vlan),\n+\t\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n \n \t\tif (!ulp_rte_item_skip_void(&item, 1))\n \t\t\treturn BNXT_TF_RC_ERROR;\n@@ -1499,32 +1520,41 @@ ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item,\n \t\t\tulp_encap_buffer_copy(buff,\n \t\t\t\t\t      def_ipv4_hdr,\n \t\t\t\t\t      BNXT_ULP_ENCAP_IPV4_VER_HLEN_TOS +\n-\t\t\t\t\t      BNXT_ULP_ENCAP_IPV4_ID_PROTO);\n+\t\t\t\t\t      BNXT_ULP_ENCAP_IPV4_ID_PROTO,\n+\t\t\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n \t\t} else {\n-\t\t\tconst uint8_t *tmp_buff;\n-\n+\t\t\t/* Total length being ignored in the ip hdr. */\n \t\t\tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_IP];\n \t\t\ttmp_buff = (const uint8_t *)&ipv4_spec->hdr.packet_id;\n \t\t\tulp_encap_buffer_copy(buff,\n \t\t\t\t\t      tmp_buff,\n-\t\t\t\t\t      BNXT_ULP_ENCAP_IPV4_ID_PROTO);\n+\t\t\t\t\t      BNXT_ULP_ENCAP_IPV4_ID_PROTO,\n+\t\t\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n \t\t\tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_IP +\n \t\t\t     BNXT_ULP_ENCAP_IPV4_ID_PROTO];\n \t\t\tulp_encap_buffer_copy(buff,\n \t\t\t\t\t      &ipv4_spec->hdr.version_ihl,\n-\t\t\t\t\t      BNXT_ULP_ENCAP_IPV4_VER_HLEN_TOS);\n+\t\t\t\t\t      BNXT_ULP_ENCAP_IPV4_VER_HLEN_TOS,\n+\t\t\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n \t\t}\n+\n+\t\t/* Update the dst ip address in ip encap buffer */\n \t\tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_IP +\n \t\t    BNXT_ULP_ENCAP_IPV4_VER_HLEN_TOS +\n \t\t    BNXT_ULP_ENCAP_IPV4_ID_PROTO];\n \t\tulp_encap_buffer_copy(buff,\n \t\t\t\t      (const uint8_t *)&ipv4_spec->hdr.dst_addr,\n-\t\t\t\t      BNXT_ULP_ENCAP_IPV4_DEST_IP);\n+\t\t\t\t      sizeof(ipv4_spec->hdr.dst_addr),\n+\t\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n \n-\t\tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_IP_SRC];\n+\t\t/* Update the src ip address */\n+\t\tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_IP_SRC +\n+\t\t\tBNXT_ULP_ACT_PROP_SZ_ENCAP_IP_SRC -\n+\t\t\tsizeof(ipv4_spec->hdr.src_addr)];\n \t\tulp_encap_buffer_copy(buff,\n \t\t\t\t      (const uint8_t *)&ipv4_spec->hdr.src_addr,\n-\t\t\t\t      BNXT_ULP_ACT_PROP_SZ_ENCAP_IP_SRC);\n+\t\t\t\t      sizeof(ipv4_spec->hdr.src_addr),\n+\t\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n \n \t\t/* Update the ip size details */\n \t\tip_size = tfp_cpu_to_be_32(ip_size);\n@@ -1546,9 +1576,46 @@ ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item,\n \t\tipv6_spec = item->spec;\n \t\tip_size = BNXT_ULP_ENCAP_IPV6_SIZE;\n \n-\t\t/* copy the ipv4 details */\n-\t\tmemcpy(&ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_IP],\n-\t\t       ipv6_spec, BNXT_ULP_ENCAP_IPV6_SIZE);\n+\t\t/* copy the ipv6 details */\n+\t\ttmp_buff = (const uint8_t *)&ipv6_spec->hdr.vtc_flow;\n+\t\tif (ulp_buffer_is_empty(tmp_buff,\n+\t\t\t\t\tBNXT_ULP_ENCAP_IPV6_VTC_FLOW)) {\n+\t\t\tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_IP];\n+\t\t\tulp_encap_buffer_copy(buff,\n+\t\t\t\t\t      def_ipv6_hdr,\n+\t\t\t\t\t      sizeof(def_ipv6_hdr),\n+\t\t\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n+\t\t} else {\n+\t\t\t/* The payload length being ignored in the ip hdr. */\n+\t\t\tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_IP];\n+\t\t\ttmp_buff = (const uint8_t *)&ipv6_spec->hdr.proto;\n+\t\t\tulp_encap_buffer_copy(buff,\n+\t\t\t\t\t      tmp_buff,\n+\t\t\t\t\t      BNXT_ULP_ENCAP_IPV6_PROTO_TTL,\n+\t\t\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n+\t\t\tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_IP +\n+\t\t\t\tBNXT_ULP_ENCAP_IPV6_PROTO_TTL +\n+\t\t\t\tBNXT_ULP_ENCAP_IPV6_DO];\n+\t\t\ttmp_buff = (const uint8_t *)&ipv6_spec->hdr.vtc_flow;\n+\t\t\tulp_encap_buffer_copy(buff,\n+\t\t\t\t\t      tmp_buff,\n+\t\t\t\t\t      BNXT_ULP_ENCAP_IPV6_VTC_FLOW,\n+\t\t\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n+\t\t}\n+\t\t/* Update the dst ip address in ip encap buffer */\n+\t\tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_IP +\n+\t\t\tsizeof(def_ipv6_hdr)];\n+\t\tulp_encap_buffer_copy(buff,\n+\t\t\t\t      (const uint8_t *)ipv6_spec->hdr.dst_addr,\n+\t\t\t\t      sizeof(ipv6_spec->hdr.dst_addr),\n+\t\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n+\n+\t\t/* Update the src ip address */\n+\t\tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_IP_SRC];\n+\t\tulp_encap_buffer_copy(buff,\n+\t\t\t\t      (const uint8_t *)ipv6_spec->hdr.src_addr,\n+\t\t\t\t      sizeof(ipv6_spec->hdr.src_addr),\n+\t\t\t\t      ULP_BUFFER_ALIGN_16_BYTE);\n \n \t\t/* Update the ip size details */\n \t\tip_size = tfp_cpu_to_be_32(ip_size);\n@@ -1578,7 +1645,8 @@ ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item,\n \t}\n \t/* copy the udp details */\n \tulp_encap_buffer_copy(&ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_UDP],\n-\t\t\t      item->spec, BNXT_ULP_ENCAP_UDP_SIZE);\n+\t\t\t      item->spec, BNXT_ULP_ENCAP_UDP_SIZE,\n+\t\t\t      ULP_BUFFER_ALIGN_8_BYTE);\n \n \tif (!ulp_rte_item_skip_void(&item, 1))\n \t\treturn BNXT_TF_RC_ERROR;\n@@ -1592,9 +1660,17 @@ ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item,\n \t/* copy the vxlan details */\n \tmemcpy(&vxlan_spec, item->spec, vxlan_size);\n \tvxlan_spec.flags = 0x08;\n-\tulp_encap_buffer_copy(&ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_TUN],\n-\t\t\t      (const uint8_t *)&vxlan_spec,\n-\t\t\t      vxlan_size);\n+\tbuff = &ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_TUN];\n+\tif (ip_type == rte_cpu_to_be_32(BNXT_ULP_ETH_IPV4)) {\n+\t\tulp_encap_buffer_copy(buff, (const uint8_t *)&vxlan_spec,\n+\t\t\t\t      vxlan_size, ULP_BUFFER_ALIGN_8_BYTE);\n+\t} else {\n+\t\tulp_encap_buffer_copy(buff, (const uint8_t *)&vxlan_spec,\n+\t\t\t\t      vxlan_size / 2, ULP_BUFFER_ALIGN_8_BYTE);\n+\t\tulp_encap_buffer_copy(buff + (vxlan_size / 2),\n+\t\t\t\t      (const uint8_t *)&vxlan_spec.vni,\n+\t\t\t\t      vxlan_size / 2, ULP_BUFFER_ALIGN_8_BYTE);\n+\t}\n \tvxlan_size = tfp_cpu_to_be_32(vxlan_size);\n \tmemcpy(&ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_TUN_SZ],\n \t       &vxlan_size, sizeof(uint32_t));\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h\nindex 7b6b57e0e..41f3df998 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h\n@@ -17,7 +17,10 @@\n #define BNXT_ULP_ENCAP_IPV4_ID_PROTO\t\t6\n #define BNXT_ULP_ENCAP_IPV4_DEST_IP\t\t4\n #define BNXT_ULP_ENCAP_IPV4_SIZE\t\t12\n-#define BNXT_ULP_ENCAP_IPV6_SIZE\t\t8\n+#define BNXT_ULP_ENCAP_IPV6_VTC_FLOW\t\t4\n+#define BNXT_ULP_ENCAP_IPV6_PROTO_TTL\t\t2\n+#define BNXT_ULP_ENCAP_IPV6_DO\t\t\t2\n+#define BNXT_ULP_ENCAP_IPV6_SIZE\t\t24\n #define BNXT_ULP_ENCAP_UDP_SIZE\t\t\t4\n #define BNXT_ULP_INVALID_SVIF_VAL\t\t-1U\n \ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_act.c b/drivers/net/bnxt/tf_ulp/ulp_template_db_act.c\nindex de96afe8c..cab3445a2 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_template_db_act.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_act.c\n@@ -1036,7 +1036,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {\n \t},\n \t{\n \t.resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,\n-\t.resource_type = TF_TBL_TYPE_ACT_SP_SMAC_IPV4,\n+\t.resource_type = TF_TBL_TYPE_ACT_SP_SMAC_IPV6,\n \t.resource_sub_type =\n \t\tBNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,\n \t.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_IS_SET,\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_utils.c b/drivers/net/bnxt/tf_ulp/ulp_utils.c\nindex a923da86e..24474e2e2 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_utils.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_utils.c\n@@ -546,8 +546,8 @@ ulp_blob_encap_swap_idx_set(struct ulp_blob *blob)\n void\n ulp_blob_perform_encap_swap(struct ulp_blob *blob)\n {\n-\tuint32_t\t\ti, idx = 0, end_idx = 0;\n-\tuint8_t\t\ttemp_val_1, temp_val_2;\n+\tuint32_t i, idx = 0, end_idx = 0, roundoff;\n+\tuint8_t temp_val_1, temp_val_2;\n \n \t/* validate the arguments */\n \tif (!blob) {\n@@ -556,7 +556,11 @@ ulp_blob_perform_encap_swap(struct ulp_blob *blob)\n \t}\n \tidx = ULP_BITS_2_BYTE_NR(blob->encap_swap_idx);\n \tend_idx = ULP_BITS_2_BYTE(blob->write_idx);\n-\n+\troundoff = ULP_BYTE_2_BITS(ULP_BITS_2_BYTE(end_idx));\n+\tif (roundoff > end_idx) {\n+\t\tblob->write_idx += ULP_BYTE_2_BITS(roundoff - end_idx);\n+\t\tend_idx = roundoff;\n+\t}\n \twhile (idx <= end_idx) {\n \t\tfor (i = 0; i < 4; i = i + 2) {\n \t\t\ttemp_val_1 = blob->data[idx + i];\n@@ -631,20 +635,35 @@ ulp_operand_read(uint8_t *operand,\n  * dst [out] The destination buffer\n  * src [in] The source buffer dst\n  * size[in] size of the buffer.\n+ * align[in] The alignment is either 8 or 16.\n  */\n void\n ulp_encap_buffer_copy(uint8_t *dst,\n \t\t      const uint8_t *src,\n-\t\t      uint16_t size)\n+\t\t      uint16_t size,\n+\t\t      uint16_t align)\n {\n-\tuint16_t\tidx = 0;\n-\n-\t/* copy 2 bytes at a time. Write MSB to LSB */\n-\twhile ((idx + sizeof(uint16_t)) <= size) {\n-\t\tmemcpy(&dst[idx], &src[size - idx - sizeof(uint16_t)],\n-\t\t       sizeof(uint16_t));\n-\t\tidx += sizeof(uint16_t);\n-\t}\n+\tuint16_t\tidx, tmp_size = 0;\n+\n+\tdo {\n+\t\tdst += tmp_size;\n+\t\tsrc += tmp_size;\n+\t\tidx = 0;\n+\t\tif (size > align) {\n+\t\t\ttmp_size = align;\n+\t\t\tsize -= align;\n+\t\t} else {\n+\t\t\ttmp_size = size;\n+\t\t\tsize = 0;\n+\t\t}\n+\t\t/* copy 2 bytes at a time. Write MSB to LSB */\n+\t\twhile ((idx + sizeof(uint16_t)) <= tmp_size) {\n+\t\t\tmemcpy(&dst[idx],\n+\t\t\t       &src[tmp_size - idx - sizeof(uint16_t)],\n+\t\t\t       sizeof(uint16_t));\n+\t\t\tidx += sizeof(uint16_t);\n+\t\t}\n+\t} while (size);\n }\n \n /*\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_utils.h b/drivers/net/bnxt/tf_ulp/ulp_utils.h\nindex 22dfb1732..c054a77a9 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_utils.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_utils.h\n@@ -9,6 +9,9 @@\n #include \"bnxt.h\"\n #include \"ulp_template_db_enum.h\"\n \n+#define ULP_BUFFER_ALIGN_8_BYTE\t\t8\n+#define ULP_BUFFER_ALIGN_16_BYTE\t16\n+\n /*\n  * Macros for bitmap sets and gets\n  * These macros can be used if the val are power of 2.\n@@ -315,11 +318,13 @@ ulp_operand_read(uint8_t *operand,\n  * dst [out] The destination buffer\n  * src [in] The source buffer dst\n  * size[in] size of the buffer.\n+ * align[in] The alignment is either 8 or 16.\n  */\n void\n ulp_encap_buffer_copy(uint8_t *dst,\n \t\t      const uint8_t *src,\n-\t\t      uint16_t size);\n+\t\t      uint16_t size,\n+\t\t      uint16_t align);\n \n /*\n  * Check the buffer is empty\n",
    "prefixes": [
        "18/25"
    ]
}