Show a patch.

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

{
    "id": 74712,
    "url": "https://patches.dpdk.org/api/patches/74712/",
    "web_url": "https://patches.dpdk.org/patch/74712/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20200724053235.71069-3-ajit.khaparde@broadcom.com>",
    "date": "2020-07-24T05:32:15",
    "name": "[v3,02/22] net/bnxt: add access to nat global register",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "eb0378997ec792b23ab0e9ff1ef7321691249b5b",
    "submitter": {
        "id": 501,
        "url": "https://patches.dpdk.org/api/people/501/",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "https://patches.dpdk.org/api/users/1766/",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "https://patches.dpdk.org/patch/74712/mbox/",
    "series": [
        {
            "id": 11269,
            "url": "https://patches.dpdk.org/api/series/11269/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11269",
            "date": "2020-07-24T05:32:13",
            "name": "bnxt patches",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/11269/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74712/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74712/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "X-Gm-Message-State": "AOAM5332MH3LHSNumaxPRo9bKmKxGLD4lONyZRVjbmYzrNM1hGdZ0Q0m\n tix9RICg1FHKEZcSTVE4/9tICyd4vpoIW4TfqNXvSletFLEDF8rJiheKWckEc82lVi6WyWV8DW1\n QTVFCBTKnfcRw2Z4a4bRmOgD02cDa+v7hophVkWa8Hn2z++q0mV7DaSOY/9pho1yaUDoMihgwHf\n sVJA==",
        "X-Google-Smtp-Source": "\n ABdhPJyiwC7RE0Wwqz6AhE9ay7GopVlliooGIsYOm3Q2PeMMJIa8HeLUUFGgG8h3ew42/KlzVwWTSO16Eoes",
        "List-Post": "<mailto:dev@dpdk.org>",
        "MIME-Version": "1.0",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<20200723115639.22357-1-somnath.kotur@broadcom.com>\n <20200724053235.71069-1-ajit.khaparde@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH v3 02/22] net/bnxt: add access to nat global\n\tregister",
        "Sender": "\"dev\" <dev-bounces@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 6B11CA0518;\n\tFri, 24 Jul 2020 07:33:10 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 382431C044;\n\tFri, 24 Jul 2020 07:33:00 +0200 (CEST)",
            "from mail-vs1-f99.google.com (mail-vs1-f99.google.com\n [209.85.217.99]) by dpdk.org (Postfix) with ESMTP id BBF2D1C031\n for <dev@dpdk.org>; Fri, 24 Jul 2020 07:32:54 +0200 (CEST)",
            "by mail-vs1-f99.google.com with SMTP id a17so4293972vsq.6\n for <dev@dpdk.org>; Thu, 23 Jul 2020 22:32:54 -0700 (PDT)",
            "from localhost.localdomain ([192.19.223.252])\n by smtp-relay.gmail.com with ESMTPS id h17sm592840vsk.0.2020.07.23.22.32.50\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Thu, 23 Jul 2020 22:32:53 -0700 (PDT)"
        ],
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "X-Mailer": "git-send-email 2.21.1 (Apple Git-122.3)",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "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=DB1zM/DUz/JVi/Rl5HNYRF3CCoXN/COO8qWhyE8K2/4=;\n b=JOHi0bqDomUGeX2/IX3jm9m09u169Z/oHMhV2t1NJHdGNy4aHmIWdmSxyH8dW4c8x2\n dhpgJ9tBAPWOQCgYlhxwFF75aC3RM44d7nYw0maIn01DSA7kbKs2FuFtQ/x4EuN9jIOa\n 6sJiJwOkYRFSy4CyGYIZlvb8JoSJ2nX9X+uoVA79oi8rjXnn2d/00GTrAKLyfA95ik7d\n s6+d9j9nt1QkaLG0qNdGocDEDaAbMHw5ShWhVgJwRNlT4H0pKzgQGaM5jMBPw25KeOUN\n /G9aO9co2WKXsDbhMA2hfZ3ajsNRFrG9hCUqBwWCDtIClFzstWGzdWtVeP0iBZXqlKUQ\n ooIA==",
        "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=DB1zM/DUz/JVi/Rl5HNYRF3CCoXN/COO8qWhyE8K2/4=;\n b=MFu8QprjmUWNvGo6+s2YTn9OmwkqREVAt3oEoAKhmOzqPF+yP8IRGqKsp4flWEr57W\n KJebmpP4WEvF0JsmMu/DH/pG1S8jl+73BMF4BdEQJhfkdslhZOORt00DyENZeL8nnpH1\n sHk9zhOdyy8GWkqR9wn/fdkzOXzdQcj9yZshg=",
        "Date": "Thu, 23 Jul 2020 22:32:15 -0700",
        "Content-Transfer-Encoding": "8bit",
        "X-Received": "by 2002:a67:5cc6:: with SMTP id q189mr6640799vsb.3.1595568773730;\n Thu, 23 Jul 2020 22:32:53 -0700 (PDT)",
        "To": "dev@dpdk.org",
        "X-Relaying-Domain": "broadcom.com",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "In-Reply-To": "<20200724053235.71069-1-ajit.khaparde@broadcom.com>",
        "Cc": "ferruh.yigit@intel.com,\n Kishore Padmanabha <kishore.padmanabha@broadcom.com>,\n Michael Baucom <michael.baucom@broadcom.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200724053235.71069-3-ajit.khaparde@broadcom.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\n\nAdd support to enable or disable the NAT global registers.\nThe NAT feature is enabled in hardware during initialization\nand disabled at deinitialization of the application.\n\nSigned-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nReviewed-by: Michael Baucom <michael.baucom@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 83 ++++++++++++++++++++++++++++++\n drivers/net/bnxt/tf_ulp/bnxt_ulp.h |  4 ++\n 2 files changed, 87 insertions(+)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\nindex 0869231a0..7c65a4b1b 100644\n--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\n+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\n@@ -596,6 +596,52 @@ ulp_session_deinit(struct bnxt_ulp_session_state *session)\n \t}\n }\n \n+/*\n+ * Internal api to enable NAT feature.\n+ * Set set_flag to 1 to set the value or zero to reset the value.\n+ * returns 0 on success.\n+ */\n+static int32_t\n+bnxt_ulp_global_cfg_update(struct bnxt *bp,\n+\t\t\t   enum tf_dir dir,\n+\t\t\t   enum tf_global_config_type type,\n+\t\t\t   uint32_t offset,\n+\t\t\t   uint32_t value,\n+\t\t\t   uint32_t set_flag)\n+{\n+\tuint32_t global_cfg = 0;\n+\tint rc;\n+\tstruct tf_global_cfg_parms parms;\n+\n+\t/* Initialize the params */\n+\tparms.dir = dir,\n+\tparms.type = type,\n+\tparms.offset = offset,\n+\tparms.config = (uint8_t *)&global_cfg,\n+\tparms.config_sz_in_bytes = sizeof(global_cfg);\n+\n+\trc = tf_get_global_cfg(&bp->tfp, &parms);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to get global cfg 0x%x rc:%d\\n\",\n+\t\t\t    type, rc);\n+\t\treturn rc;\n+\t}\n+\n+\tif (set_flag)\n+\t\tglobal_cfg |= value;\n+\telse\n+\t\tglobal_cfg &= ~value;\n+\n+\t/* SET the register RE_CFA_REG_ACT_TECT */\n+\trc = tf_set_global_cfg(&bp->tfp, &parms);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to set global cfg 0x%x rc:%d\\n\",\n+\t\t\t    type, rc);\n+\t\treturn rc;\n+\t}\n+\treturn rc;\n+}\n+\n /*\n  * When a port is initialized by dpdk. This functions is called\n  * and this function initializes the ULP context and rest of the\n@@ -732,6 +778,29 @@ bnxt_ulp_init(struct bnxt *bp)\n \t\tgoto jump_to_error;\n \t}\n \n+\t/*\n+\t * Enable NAT feature. Set the global configuration register\n+\t * Tunnel encap to enable NAT with the reuse of existing inner\n+\t * L2 header smac and dmac\n+\t */\n+\trc = bnxt_ulp_global_cfg_update(bp, TF_DIR_RX, TF_TUNNEL_ENCAP,\n+\t\t\t\t\tTF_TUNNEL_ENCAP_NAT,\n+\t\t\t\t\t(BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |\n+\t\t\t\t\tBNXT_ULP_NAT_INNER_L2_HEADER_DMAC), 1);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to set rx global configuration\\n\");\n+\t\tgoto jump_to_error;\n+\t}\n+\n+\trc = bnxt_ulp_global_cfg_update(bp, TF_DIR_TX, TF_TUNNEL_ENCAP,\n+\t\t\t\t\tTF_TUNNEL_ENCAP_NAT,\n+\t\t\t\t\t(BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |\n+\t\t\t\t\tBNXT_ULP_NAT_INNER_L2_HEADER_DMAC), 1);\n+\tif (rc) {\n+\t\tBNXT_TF_DBG(ERR, \"Failed to set tx global configuration\\n\");\n+\t\tgoto jump_to_error;\n+\t}\n+\n \treturn rc;\n \n jump_to_error:\n@@ -785,6 +854,19 @@ bnxt_ulp_deinit(struct bnxt *bp)\n \t/* Delete the Port database */\n \tulp_port_db_deinit(bp->ulp_ctx);\n \n+\t/* Disable NAT feature */\n+\t(void)bnxt_ulp_global_cfg_update(bp, TF_DIR_RX, TF_TUNNEL_ENCAP,\n+\t\t\t\t\t TF_TUNNEL_ENCAP_NAT,\n+\t\t\t\t\t (BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |\n+\t\t\t\t\t  BNXT_ULP_NAT_INNER_L2_HEADER_DMAC),\n+\t\t\t\t\t 0);\n+\n+\t(void)bnxt_ulp_global_cfg_update(bp, TF_DIR_TX, TF_TUNNEL_ENCAP,\n+\t\t\t\t\t TF_TUNNEL_ENCAP_NAT,\n+\t\t\t\t\t (BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |\n+\t\t\t\t\t  BNXT_ULP_NAT_INNER_L2_HEADER_DMAC),\n+\t\t\t\t\t 0);\n+\n \t/* Delete the ulp context and tf session */\n \tulp_ctx_detach(bp, session);\n \n@@ -942,6 +1024,7 @@ bnxt_ulp_eth_dev_ptr2_cntxt_get(struct rte_eth_dev\t*dev)\n \n \tif (BNXT_ETH_DEV_IS_REPRESENTOR(dev)) {\n \t\tstruct bnxt_vf_representor *vfr = dev->data->dev_private;\n+\n \t\tbp = vfr->parent_dev->data->dev_private;\n \t}\n \ndiff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.h b/drivers/net/bnxt/tf_ulp/bnxt_ulp.h\nindex f9e5e2ba6..7c95ead55 100644\n--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.h\n+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.h\n@@ -14,6 +14,10 @@\n \n #include \"ulp_template_db_enum.h\"\n \n+/* NAT defines to reuse existing inner L2 SMAC and DMAC */\n+#define BNXT_ULP_NAT_INNER_L2_HEADER_SMAC\t0x2000\n+#define BNXT_ULP_NAT_INNER_L2_HEADER_DMAC\t0x100\n+\n /* defines for the ulp_flags */\n #define BNXT_ULP_VF_REP_ENABLED\t\t0x1\n #define ULP_VF_REP_IS_ENABLED(flag)\t((flag) & BNXT_ULP_VF_REP_ENABLED)\n",
    "prefixes": [
        "v3",
        "02/22"
    ]
}