Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/74663/?format=api
https://patches.dpdk.org/api/patches/74663/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200723115639.22357-3-somnath.kotur@broadcom.com/", "project": { "id": 1, "url": "https://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": "<20200723115639.22357-3-somnath.kotur@broadcom.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200723115639.22357-3-somnath.kotur@broadcom.com", "date": "2020-07-23T11:56:21", "name": "[v2,02/20] net/bnxt: nat global registers support", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "6b99dbe9bf5781b7950bec8f385468ef122249c8", "submitter": { "id": 908, "url": "https://patches.dpdk.org/api/people/908/?format=api", "name": "Somnath Kotur", "email": "somnath.kotur@broadcom.com" }, "delegate": { "id": 1766, "url": "https://patches.dpdk.org/api/users/1766/?format=api", "username": "ajitkhaparde", "first_name": "Ajit", "last_name": "Khaparde", "email": "ajit.khaparde@broadcom.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200723115639.22357-3-somnath.kotur@broadcom.com/mbox/", "series": [ { "id": 11254, "url": "https://patches.dpdk.org/api/series/11254/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11254", "date": "2020-07-23T11:56:19", "name": "bnxt patches", "version": 2, "mbox": "https://patches.dpdk.org/series/11254/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/74663/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/74663/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 DEB33A0521;\n\tThu, 23 Jul 2020 14:02:13 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7ADE71BFEE;\n\tThu, 23 Jul 2020 14:02:07 +0200 (CEST)", "from relay.smtp.broadcom.com (unknown [192.19.211.62])\n by dpdk.org (Postfix) with ESMTP id CB2AF199BC\n for <dev@dpdk.org>; Thu, 23 Jul 2020 14:02:02 +0200 (CEST)", "from dhcp-10-123-153-55.dhcp.broadcom.net\n (bgccx-dev-host-lnx35.bec.broadcom.net [10.123.153.55])\n by relay.smtp.broadcom.com (Postfix) with ESMTP id 04E2029ADAA;\n Thu, 23 Jul 2020 05:02:01 -0700 (PDT)" ], "DKIM-Filter": "OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 04E2029ADAA", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1595505722;\n bh=FMmNgzDbl6rcEIhLU2aGORtfWDAltJXPilEScotj3Bg=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=CYbiRLxEor0uOX462N5ntk3LiBkZkRu+6zhEyaFWm8BrtM25z3ymbSbslRvQotxiL\n 0+rEpqxBHWOp9bn1Zv2gt9yXm8eSKZnF8Hs8gxsxjF9umpfmlkSV/DpVgTm3VcqDLl\n 5tA0Vf56hdpEv7ngEv+k5QRzfS8xUzxlC5621Jkg=", "From": "Somnath Kotur <somnath.kotur@broadcom.com>", "To": "dev@dpdk.org", "Cc": "ferruh.yigit@intel.com", "Date": "Thu, 23 Jul 2020 17:26:21 +0530", "Message-Id": "<20200723115639.22357-3-somnath.kotur@broadcom.com>", "X-Mailer": "git-send-email 2.10.1.613.g2cc2e70", "In-Reply-To": "<20200723115639.22357-1-somnath.kotur@broadcom.com>", "References": "<20200723111329.21855-1-somnath.kotur@broadcom.com>\n <20200723115639.22357-1-somnath.kotur@broadcom.com>", "Subject": "[dpdk-dev] [PATCH v2 02/20] net/bnxt: nat global registers support", "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 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>\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 0869231..7c65a4b 100644\n--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\n+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c\n@@ -597,6 +597,52 @@ ulp_session_deinit(struct bnxt_ulp_session_state *session)\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 * infrastructure associated with it.\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 f9e5e2b..7c95ead 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": [ "v2", "02/20" ] }{ "id": 74663, "url": "