get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 71404,
    "url": "http://patches.dpdk.org/api/patches/71404/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200612132934.16488-13-somnath.kotur@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": "<20200612132934.16488-13-somnath.kotur@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200612132934.16488-13-somnath.kotur@broadcom.com",
    "date": "2020-06-12T13:28:56",
    "name": "[12/50] net/bnxt: support bulk table get and mirror",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4eff61dae76c0c511a79b8c6d95f0cabd878cf60",
    "submitter": {
        "id": 908,
        "url": "http://patches.dpdk.org/api/people/908/?format=api",
        "name": "Somnath Kotur",
        "email": "somnath.kotur@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/20200612132934.16488-13-somnath.kotur@broadcom.com/mbox/",
    "series": [
        {
            "id": 10436,
            "url": "http://patches.dpdk.org/api/series/10436/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=10436",
            "date": "2020-06-12T13:28:44",
            "name": "add features for host-based flow management",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/10436/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/71404/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/71404/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 950BDA00BE;\n\tFri, 12 Jun 2020 15:40:11 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 678341BFB6;\n\tFri, 12 Jun 2020 15:34:24 +0200 (CEST)",
            "from relay.smtp.broadcom.com (relay.smtp.broadcom.com\n [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id 302181BF92\n for <dev@dpdk.org>; Fri, 12 Jun 2020 15:34:21 +0200 (CEST)",
            "from dhcp-10-123-153-55.dhcp.broadcom.net\n (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55])\n by relay.smtp.broadcom.com (Postfix) with ESMTP id ECE201BD7AD;\n Fri, 12 Jun 2020 06:34:19 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com ECE201BD7AD",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1591968860;\n bh=rl0GHf7Daoewhiz2o420HGahHTiEgcdxVoGrnpocXWA=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=DZjrdPXvZ0r8vUQUJ9xOGoVBxKpSDN8IA43ht9ks4vQCRy22fJVFkRWZ5uw+uiU0E\n 6pIBfn5xQvKsIMJzKXYkjbzoFhWFcZbO40vAUBZthdMH7rhaNPCNVhwC48/FBbm6sQ\n 8XsS7hADRJnl1ZKfoD01ldsSG8ELePlodNXkVr9w=",
        "From": "Somnath Kotur <somnath.kotur@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com",
        "Date": "Fri, 12 Jun 2020 18:58:56 +0530",
        "Message-Id": "<20200612132934.16488-13-somnath.kotur@broadcom.com>",
        "X-Mailer": "git-send-email 2.10.1.613.g2cc2e70",
        "In-Reply-To": "<20200612132934.16488-1-somnath.kotur@broadcom.com>",
        "References": "<20200612132934.16488-1-somnath.kotur@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH 12/50] net/bnxt: support bulk table get and mirror",
        "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: Shahaji Bhosle <sbhosle@broadcom.com>\n\n- Add new bulk table type get using FW\n  to DMA the data back to host.\n- Add flag to allow records to be cleared if possible\n- Set mirror using tf_alloc_tbl_entry\n\nSigned-off-by: Shahaji Bhosle <sbhosle@broadcom.com>\nReviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>\nSigned-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>\n---\n drivers/net/bnxt/tf_core/hwrm_tf.h      |  37 +++++++++++-\n drivers/net/bnxt/tf_core/tf_common.h    |  54 +++++++++++++++++\n drivers/net/bnxt/tf_core/tf_core.c      |   2 +\n drivers/net/bnxt/tf_core/tf_core.h      |  55 ++++++++++++++++-\n drivers/net/bnxt/tf_core/tf_msg.c       |  70 +++++++++++++++++-----\n drivers/net/bnxt/tf_core/tf_msg.h       |  15 +++++\n drivers/net/bnxt/tf_core/tf_resources.h |   5 +-\n drivers/net/bnxt/tf_core/tf_tbl.c       | 103 ++++++++++++++++++++++++++++++++\n 8 files changed, 319 insertions(+), 22 deletions(-)\n create mode 100644 drivers/net/bnxt/tf_core/tf_common.h",
    "diff": "diff --git a/drivers/net/bnxt/tf_core/hwrm_tf.h b/drivers/net/bnxt/tf_core/hwrm_tf.h\nindex d342c69..c04d103 100644\n--- a/drivers/net/bnxt/tf_core/hwrm_tf.h\n+++ b/drivers/net/bnxt/tf_core/hwrm_tf.h\n@@ -1,5 +1,5 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2019 Broadcom\n+ * Copyright(c) 2019-2020 Broadcom\n  * All rights reserved.\n  */\n #ifndef _HWRM_TF_H_\n@@ -27,7 +27,8 @@ typedef enum tf_subtype {\n \tHWRM_TFT_REG_SET = 822,\n \tHWRM_TFT_TBL_TYPE_SET = 823,\n \tHWRM_TFT_TBL_TYPE_GET = 824,\n-\tTF_SUBTYPE_LAST = HWRM_TFT_TBL_TYPE_GET,\n+\tHWRM_TFT_TBL_TYPE_GET_BULK = 825,\n+\tTF_SUBTYPE_LAST = HWRM_TFT_TBL_TYPE_GET_BULK,\n } tf_subtype_t;\n \n /* Request and Response compile time checking */\n@@ -81,6 +82,8 @@ struct tf_session_sram_resc_flush_input;\n struct tf_tbl_type_set_input;\n struct tf_tbl_type_get_input;\n struct tf_tbl_type_get_output;\n+struct tf_tbl_type_get_bulk_input;\n+struct tf_tbl_type_get_bulk_output;\n /* Input params for session attach */\n typedef struct tf_session_attach_input {\n \t/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent */\n@@ -902,6 +905,8 @@ typedef struct tf_tbl_type_get_input {\n #define TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_RX\t\t\t(0x0)\n \t/* When set to 1, indicates the get apply to TX */\n #define TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX\t\t\t(0x1)\n+\t/* When set to 1, indicates the clear entry on read */\n+#define TF_TBL_TYPE_GET_INPUT_FLAGS_CLEAR_ON_READ\t  (0x2)\n \t/* Type of the object to set */\n \tuint32_t\t\t\t type;\n \t/* Index to get */\n@@ -916,4 +921,32 @@ typedef struct tf_tbl_type_get_output {\n \tuint8_t\t\t\t  data[TF_BULK_RECV];\n } tf_tbl_type_get_output_t, *ptf_tbl_type_get_output_t;\n \n+/* Input params for table type get */\n+typedef struct tf_tbl_type_get_bulk_input {\n+\t/* Session Id */\n+\tuint32_t\t\t\t fw_session_id;\n+\t/* flags */\n+\tuint16_t\t\t\t flags;\n+\t/* When set to 0, indicates the get apply to RX */\n+#define TF_TBL_TYPE_GET_BULK_INPUT_FLAGS_DIR_RX\t   (0x0)\n+\t/* When set to 1, indicates the get apply to TX */\n+#define TF_TBL_TYPE_GET_BULK_INPUT_FLAGS_DIR_TX\t   (0x1)\n+\t/* When set to 1, indicates the clear entry on read */\n+#define TF_TBL_TYPE_GET_BULK_INPUT_FLAGS_CLEAR_ON_READ\t  (0x2)\n+\t/* Type of the object to set */\n+\tuint32_t\t\t\t type;\n+\t/* Starting index to get from */\n+\tuint32_t\t\t\t start_index;\n+\t/* Number of entries to get */\n+\tuint32_t\t\t\t num_entries;\n+\t/* Host memory where data will be stored */\n+\tuint64_t\t\t\t host_addr;\n+} tf_tbl_type_get_bulk_input_t, *ptf_tbl_type_get_bulk_input_t;\n+\n+/* Output params for table type get */\n+typedef struct tf_tbl_type_get_bulk_output {\n+\t/* Size of the total data read in bytes */\n+\tuint16_t\t\t\t size;\n+} tf_tbl_type_get_bulk_output_t, *ptf_tbl_type_get_bulk_output_t;\n+\n #endif /* _HWRM_TF_H_ */\ndiff --git a/drivers/net/bnxt/tf_core/tf_common.h b/drivers/net/bnxt/tf_core/tf_common.h\nnew file mode 100644\nindex 0000000..2aa4b86\n--- /dev/null\n+++ b/drivers/net/bnxt/tf_core/tf_common.h\n@@ -0,0 +1,54 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2020 Broadcom\n+ * All rights reserved.\n+ */\n+\n+#ifndef _TF_COMMON_H_\n+#define _TF_COMMON_H_\n+\n+/* Helper to check the parms */\n+#define TF_CHECK_PARMS_SESSION(tfp, parms) do {\t\\\n+\t\tif ((parms) == NULL || (tfp) == NULL) { \\\n+\t\t\tTFP_DRV_LOG(ERR, \"Invalid Argument(s)\\n\"); \\\n+\t\t\treturn -EINVAL; \\\n+\t\t} \\\n+\t\tif ((tfp)->session == NULL || \\\n+\t\t    (tfp)->session->core_data == NULL) { \\\n+\t\t\tTFP_DRV_LOG(ERR, \"%s: session error\\n\", \\\n+\t\t\t\t    tf_dir_2_str((parms)->dir)); \\\n+\t\t\treturn -EINVAL; \\\n+\t\t} \\\n+\t} while (0)\n+\n+#define TF_CHECK_PARMS_SESSION_NO_DIR(tfp, parms) do {\t\\\n+\t\tif ((parms) == NULL || (tfp) == NULL) { \\\n+\t\t\tTFP_DRV_LOG(ERR, \"Invalid Argument(s)\\n\"); \\\n+\t\t\treturn -EINVAL; \\\n+\t\t} \\\n+\t\tif ((tfp)->session == NULL || \\\n+\t\t    (tfp)->session->core_data == NULL) { \\\n+\t\t\tTFP_DRV_LOG(ERR, \"Session error\\n\"); \\\n+\t\t\treturn -EINVAL; \\\n+\t\t} \\\n+\t} while (0)\n+\n+#define TF_CHECK_PARMS(tfp, parms) do {\t\\\n+\t\tif ((parms) == NULL || (tfp) == NULL) { \\\n+\t\t\tTFP_DRV_LOG(ERR, \"Invalid Argument(s)\\n\"); \\\n+\t\t\treturn -EINVAL; \\\n+\t\t} \\\n+\t} while (0)\n+\n+#define TF_CHECK_TFP_SESSION(tfp) do { \\\n+\t\tif ((tfp) == NULL) { \\\n+\t\t\tTFP_DRV_LOG(ERR, \"Invalid Argument(s)\\n\"); \\\n+\t\t\treturn -EINVAL; \\\n+\t\t} \\\n+\t\tif ((tfp)->session == NULL || \\\n+\t\t    (tfp)->session->core_data == NULL) { \\\n+\t\t\tTFP_DRV_LOG(ERR, \"Session error\\n\"); \\\n+\t\t\treturn -EINVAL; \\\n+\t\t} \\\n+\t} while (0)\n+\n+#endif /* _TF_COMMON_H_ */\ndiff --git a/drivers/net/bnxt/tf_core/tf_core.c b/drivers/net/bnxt/tf_core/tf_core.c\nindex 58924b1..0098690 100644\n--- a/drivers/net/bnxt/tf_core/tf_core.c\n+++ b/drivers/net/bnxt/tf_core/tf_core.c\n@@ -16,6 +16,8 @@\n #include \"bitalloc.h\"\n #include \"bnxt.h\"\n #include \"rand.h\"\n+#include \"tf_common.h\"\n+#include \"hwrm_tf.h\"\n \n static inline uint32_t SWAP_WORDS32(uint32_t val32)\n {\ndiff --git a/drivers/net/bnxt/tf_core/tf_core.h b/drivers/net/bnxt/tf_core/tf_core.h\nindex becc50c..96a1a79 100644\n--- a/drivers/net/bnxt/tf_core/tf_core.h\n+++ b/drivers/net/bnxt/tf_core/tf_core.h\n@@ -1165,7 +1165,7 @@ struct tf_get_tbl_entry_parms {\n \t */\n \tuint8_t *data;\n \t/**\n-\t * [out] Entry size\n+\t * [in] Entry size\n \t */\n \tuint16_t data_sz_in_bytes;\n \t/**\n@@ -1189,6 +1189,59 @@ int tf_get_tbl_entry(struct tf *tfp,\n \t\t     struct tf_get_tbl_entry_parms *parms);\n \n /**\n+ * tf_get_bulk_tbl_entry parameter definition\n+ */\n+struct tf_get_bulk_tbl_entry_parms {\n+\t/**\n+\t * [in] Receive or transmit direction\n+\t */\n+\tenum tf_dir dir;\n+\t/**\n+\t * [in] Type of object to get\n+\t */\n+\tenum tf_tbl_type type;\n+\t/**\n+\t * [in] Clear hardware entries on reads only\n+\t * supported for TF_TBL_TYPE_ACT_STATS_64\n+\t */\n+\tbool clear_on_read;\n+\t/**\n+\t * [in] Starting index to read from\n+\t */\n+\tuint32_t starting_idx;\n+\t/**\n+\t * [in] Number of sequential entries\n+\t */\n+\tuint16_t num_entries;\n+\t/**\n+\t * [in] Size of the single entry\n+\t */\n+\tuint16_t entry_sz_in_bytes;\n+\t/**\n+\t * [out] Host physical address, where the data\n+\t * will be copied to by the firmware.\n+\t * Use tfp_calloc() API and mem_pa\n+\t * variable of the tfp_calloc_parms\n+\t * structure for the physical address.\n+\t */\n+\tuint64_t physical_mem_addr;\n+};\n+\n+/**\n+ * Bulk get index table entry\n+ *\n+ * Used to retrieve a previous set index table entry.\n+ *\n+ * Reads and compares with the shadow table copy (if enabled) (only\n+ * for internal objects).\n+ *\n+ * Returns success or failure code. Failure will be returned if the\n+ * provided data buffer is too small for the data type requested.\n+ */\n+int tf_get_bulk_tbl_entry(struct tf *tfp,\n+\t\t     struct tf_get_bulk_tbl_entry_parms *parms);\n+\n+/**\n  * @page exact_match Exact Match Table\n  *\n  * @ref tf_insert_em_entry\ndiff --git a/drivers/net/bnxt/tf_core/tf_msg.c b/drivers/net/bnxt/tf_core/tf_msg.c\nindex c8f6b88..c755c85 100644\n--- a/drivers/net/bnxt/tf_core/tf_msg.c\n+++ b/drivers/net/bnxt/tf_core/tf_msg.c\n@@ -1216,12 +1216,8 @@ tf_msg_get_tbl_entry(struct tf *tfp,\n \treturn tfp_le_to_cpu_32(parms.tf_resp_code);\n }\n \n-#define TF_BYTES_PER_SLICE(tfp) 12\n-#define NUM_SLICES(tfp, bytes) \\\n-\t(((bytes) + TF_BYTES_PER_SLICE(tfp) - 1) / TF_BYTES_PER_SLICE(tfp))\n-\n static int\n-tf_msg_get_dma_buf(struct tf_msg_dma_buf *buf, int size)\n+tf_msg_alloc_dma_buf(struct tf_msg_dma_buf *buf, int size)\n {\n \tstruct tfp_calloc_parms alloc_parms;\n \tint rc;\n@@ -1229,15 +1225,10 @@ tf_msg_get_dma_buf(struct tf_msg_dma_buf *buf, int size)\n \t/* Allocate session */\n \talloc_parms.nitems = 1;\n \talloc_parms.size = size;\n-\talloc_parms.alignment = 0;\n+\talloc_parms.alignment = 4096;\n \trc = tfp_calloc(&alloc_parms);\n-\tif (rc) {\n-\t\t/* Log error */\n-\t\tPMD_DRV_LOG(ERR,\n-\t\t\t    \"Failed to allocate tcam dma entry, rc:%d\\n\",\n-\t\t\t    rc);\n+\tif (rc)\n \t\treturn -ENOMEM;\n-\t}\n \n \tbuf->pa_addr = (uintptr_t)alloc_parms.mem_pa;\n \tbuf->va_addr = alloc_parms.mem_va;\n@@ -1246,6 +1237,52 @@ tf_msg_get_dma_buf(struct tf_msg_dma_buf *buf, int size)\n }\n \n int\n+tf_msg_get_bulk_tbl_entry(struct tf *tfp,\n+\t\t\t  struct tf_get_bulk_tbl_entry_parms *params)\n+{\n+\tint rc;\n+\tstruct tfp_send_msg_parms parms = { 0 };\n+\tstruct tf_tbl_type_get_bulk_input req = { 0 };\n+\tstruct tf_tbl_type_get_bulk_output resp = { 0 };\n+\tstruct tf_session *tfs = (struct tf_session *)(tfp->session->core_data);\n+\tint data_size = 0;\n+\n+\t/* Populate the request */\n+\treq.fw_session_id =\n+\t\ttfp_cpu_to_le_32(tfs->session_id.internal.fw_session_id);\n+\treq.flags = tfp_cpu_to_le_16((params->dir) |\n+\t\t((params->clear_on_read) ?\n+\t\t TF_TBL_TYPE_GET_BULK_INPUT_FLAGS_CLEAR_ON_READ : 0x0));\n+\treq.type = tfp_cpu_to_le_32(params->type);\n+\treq.start_index = tfp_cpu_to_le_32(params->starting_idx);\n+\treq.num_entries = tfp_cpu_to_le_32(params->num_entries);\n+\n+\tdata_size = (params->num_entries * params->entry_sz_in_bytes);\n+\treq.host_addr = tfp_cpu_to_le_64(params->physical_mem_addr);\n+\n+\tMSG_PREP(parms,\n+\t\t TF_KONG_MB,\n+\t\t HWRM_TF,\n+\t\t HWRM_TFT_TBL_TYPE_GET_BULK,\n+\t\t req,\n+\t\t resp);\n+\n+\trc = tfp_send_msg_tunneled(tfp, &parms);\n+\tif (rc)\n+\t\treturn rc;\n+\n+\t/* Verify that we got enough buffer to return the requested data */\n+\tif (resp.size < data_size)\n+\t\treturn -EINVAL;\n+\n+\treturn tfp_le_to_cpu_32(parms.tf_resp_code);\n+}\n+\n+#define TF_BYTES_PER_SLICE(tfp) 12\n+#define NUM_SLICES(tfp, bytes) \\\n+\t(((bytes) + TF_BYTES_PER_SLICE(tfp) - 1) / TF_BYTES_PER_SLICE(tfp))\n+\n+int\n tf_msg_tcam_entry_set(struct tf *tfp,\n \t\t      struct tf_set_tcam_entry_parms *parms)\n {\n@@ -1282,9 +1319,9 @@ tf_msg_tcam_entry_set(struct tf *tfp,\n \t} else {\n \t\t/* use dma buffer */\n \t\treq.flags |= HWRM_TF_TCAM_SET_INPUT_FLAGS_DMA;\n-\t\trc = tf_msg_get_dma_buf(&buf, data_size);\n-\t\tif (rc != 0)\n-\t\t\treturn rc;\n+\t\trc = tf_msg_alloc_dma_buf(&buf, data_size);\n+\t\tif (rc)\n+\t\t\tgoto cleanup;\n \t\tdata = buf.va_addr;\n \t\tmemcpy(&req.dev_data[0], &buf.pa_addr, sizeof(buf.pa_addr));\n \t}\n@@ -1303,8 +1340,9 @@ tf_msg_tcam_entry_set(struct tf *tfp,\n \trc = tfp_send_msg_direct(tfp,\n \t\t\t\t &mparms);\n \tif (rc)\n-\t\treturn rc;\n+\t\tgoto cleanup;\n \n+cleanup:\n \tif (buf.va_addr != NULL)\n \t\ttfp_free(buf.va_addr);\n \ndiff --git a/drivers/net/bnxt/tf_core/tf_msg.h b/drivers/net/bnxt/tf_core/tf_msg.h\nindex 89f7370..8d050c4 100644\n--- a/drivers/net/bnxt/tf_core/tf_msg.h\n+++ b/drivers/net/bnxt/tf_core/tf_msg.h\n@@ -267,4 +267,19 @@ int tf_msg_get_tbl_entry(struct tf *tfp,\n \t\t\t uint8_t *data,\n \t\t\t uint32_t index);\n \n+/**\n+ * Sends bulk get message of a Table Type element to the firmware.\n+ *\n+ * [in] tfp\n+ *   Pointer to session handle\n+ *\n+ * [in] parms\n+ *   Pointer to table get bulk parameters\n+ *\n+ * Returns:\n+ *  0 on Success else internal Truflow error\n+ */\n+int tf_msg_get_bulk_tbl_entry(struct tf *tfp,\n+\t\t\t  struct tf_get_bulk_tbl_entry_parms *parms);\n+\n #endif  /* _TF_MSG_H_ */\ndiff --git a/drivers/net/bnxt/tf_core/tf_resources.h b/drivers/net/bnxt/tf_core/tf_resources.h\nindex 05e131f..9b7f5a0 100644\n--- a/drivers/net/bnxt/tf_core/tf_resources.h\n+++ b/drivers/net/bnxt/tf_core/tf_resources.h\n@@ -149,11 +149,10 @@\n #define TF_RSVD_METER_INST_END_IDX_TX             0\n \n /* Mirror */\n-/* Not yet supported fully in the infra */\n-#define TF_RSVD_MIRROR_RX                         0\n+#define TF_RSVD_MIRROR_RX                         1\n #define TF_RSVD_MIRROR_BEGIN_IDX_RX               0\n #define TF_RSVD_MIRROR_END_IDX_RX                 0\n-#define TF_RSVD_MIRROR_TX                         0\n+#define TF_RSVD_MIRROR_TX                         1\n #define TF_RSVD_MIRROR_BEGIN_IDX_TX               0\n #define TF_RSVD_MIRROR_END_IDX_TX                 0\n \ndiff --git a/drivers/net/bnxt/tf_core/tf_tbl.c b/drivers/net/bnxt/tf_core/tf_tbl.c\nindex c403d81..0f2979e 100644\n--- a/drivers/net/bnxt/tf_core/tf_tbl.c\n+++ b/drivers/net/bnxt/tf_core/tf_tbl.c\n@@ -23,6 +23,7 @@\n #include \"bnxt.h\"\n #include \"tf_resources.h\"\n #include \"tf_rm.h\"\n+#include \"tf_common.h\"\n \n #define PTU_PTE_VALID          0x1UL\n #define PTU_PTE_LAST           0x2UL\n@@ -794,6 +795,7 @@ tf_set_tbl_entry_internal(struct tf *tfp,\n \n \tif (parms->type != TF_TBL_TYPE_FULL_ACT_RECORD &&\n \t    parms->type != TF_TBL_TYPE_ACT_SP_SMAC_IPV4 &&\n+\t    parms->type != TF_TBL_TYPE_MIRROR_CONFIG &&\n \t    parms->type != TF_TBL_TYPE_ACT_STATS_64) {\n \t\tPMD_DRV_LOG(ERR,\n \t\t\t    \"dir:%d, Type not supported, type:%d\\n\",\n@@ -915,6 +917,76 @@ tf_get_tbl_entry_internal(struct tf *tfp,\n \treturn rc;\n }\n \n+/**\n+ * Internal function to get a Table Entry. Supports all Table Types\n+ * except the TF_TBL_TYPE_EXT as that is handled as a table scope.\n+ *\n+ * [in] tfp\n+ *   Pointer to TruFlow handle\n+ *\n+ * [in] parms\n+ *   Pointer to input parameters\n+ *\n+ * Returns:\n+ *   0       - Success\n+ *   -EINVAL - Parameter error\n+ */\n+static int\n+tf_get_bulk_tbl_entry_internal(struct tf *tfp,\n+\t\t\t  struct tf_get_bulk_tbl_entry_parms *parms)\n+{\n+\tint rc;\n+\tint id;\n+\tuint32_t index;\n+\tstruct bitalloc *session_pool;\n+\tstruct tf_session *tfs = (struct tf_session *)(tfp->session->core_data);\n+\n+\t/* Lookup the pool using the table type of the element */\n+\trc = tf_rm_lookup_tbl_type_pool(tfs,\n+\t\t\t\t\tparms->dir,\n+\t\t\t\t\tparms->type,\n+\t\t\t\t\t&session_pool);\n+\t/* Error logging handled by tf_rm_lookup_tbl_type_pool */\n+\tif (rc)\n+\t\treturn rc;\n+\n+\tindex = parms->starting_idx;\n+\n+\t/*\n+\t * Adjust the returned index/offset as there is no guarantee\n+\t * that the start is 0 at time of RM allocation\n+\t */\n+\ttf_rm_convert_index(tfs,\n+\t\t\t    parms->dir,\n+\t\t\t    parms->type,\n+\t\t\t    TF_RM_CONVERT_RM_BASE,\n+\t\t\t    parms->starting_idx,\n+\t\t\t    &index);\n+\n+\t/* Verify that the entry has been previously allocated */\n+\tid = ba_inuse(session_pool, index);\n+\tif (id != 1) {\n+\t\tTFP_DRV_LOG(ERR,\n+\t\t   \"%s, Invalid or not allocated index, type:%d, starting_idx:%d\\n\",\n+\t\t   tf_dir_2_str(parms->dir),\n+\t\t   parms->type,\n+\t\t   index);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Get the entry */\n+\trc = tf_msg_get_bulk_tbl_entry(tfp, parms);\n+\tif (rc) {\n+\t\tTFP_DRV_LOG(ERR,\n+\t\t\t    \"%s, Bulk get failed, type:%d, rc:%s\\n\",\n+\t\t\t    tf_dir_2_str(parms->dir),\n+\t\t\t    parms->type,\n+\t\t\t    strerror(-rc));\n+\t}\n+\n+\treturn rc;\n+}\n+\n #if (TF_SHADOW == 1)\n /**\n  * Allocate Tbl entry from the Shadow DB. Shadow DB is searched for\n@@ -1182,6 +1254,7 @@ tf_alloc_tbl_entry_pool_internal(struct tf *tfp,\n \t    parms->type != TF_TBL_TYPE_ACT_ENCAP_8B &&\n \t    parms->type != TF_TBL_TYPE_ACT_ENCAP_16B &&\n \t    parms->type != TF_TBL_TYPE_ACT_ENCAP_64B &&\n+\t    parms->type != TF_TBL_TYPE_MIRROR_CONFIG &&\n \t    parms->type != TF_TBL_TYPE_ACT_STATS_64) {\n \t\tPMD_DRV_LOG(ERR,\n \t\t\t    \"dir:%d, Type not supported, type:%d\\n\",\n@@ -1665,6 +1738,36 @@ tf_get_tbl_entry(struct tf *tfp,\n \n /* API defined in tf_core.h */\n int\n+tf_get_bulk_tbl_entry(struct tf *tfp,\n+\t\t struct tf_get_bulk_tbl_entry_parms *parms)\n+{\n+\tint rc = 0;\n+\n+\tTF_CHECK_PARMS_SESSION(tfp, parms);\n+\n+\tif (parms->type == TF_TBL_TYPE_EXT) {\n+\t\t/* Not supported, yet */\n+\t\tTFP_DRV_LOG(ERR,\n+\t\t\t    \"%s, External table type not supported\\n\",\n+\t\t\t    tf_dir_2_str(parms->dir));\n+\n+\t\trc = -EOPNOTSUPP;\n+\t} else {\n+\t\t/* Internal table type processing */\n+\t\trc = tf_get_bulk_tbl_entry_internal(tfp, parms);\n+\t\tif (rc)\n+\t\t\tTFP_DRV_LOG(ERR,\n+\t\t\t\t    \"%s, Bulk get failed, type:%d, rc:%s\\n\",\n+\t\t\t\t    tf_dir_2_str(parms->dir),\n+\t\t\t\t    parms->type,\n+\t\t\t\t    strerror(-rc));\n+\t}\n+\n+\treturn rc;\n+}\n+\n+/* API defined in tf_core.h */\n+int\n tf_alloc_tbl_scope(struct tf *tfp,\n \t\t   struct tf_alloc_tbl_scope_parms *parms)\n {\n",
    "prefixes": [
        "12/50"
    ]
}