get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 13720,
    "url": "https://patches.dpdk.org/api/patches/13720/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1465944971-113413-6-git-send-email-stephen.hurd@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": "<1465944971-113413-6-git-send-email-stephen.hurd@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1465944971-113413-6-git-send-email-stephen.hurd@broadcom.com",
    "date": "2016-06-14T22:55:39",
    "name": "[dpdk-dev,v5,06/38] bnxt: add vnic functions and structs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0eb6faf588f0c97a02542fcff1c7bfca11473acb",
    "submitter": {
        "id": 438,
        "url": "https://patches.dpdk.org/api/people/438/?format=api",
        "name": "Stephen Hurd",
        "email": "stephen.hurd@broadcom.com"
    },
    "delegate": {
        "id": 10,
        "url": "https://patches.dpdk.org/api/users/10/?format=api",
        "username": "bruce",
        "first_name": "Bruce",
        "last_name": "Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1465944971-113413-6-git-send-email-stephen.hurd@broadcom.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/13720/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/13720/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 9591EADEB;\n\tWed, 15 Jun 2016 00:57:43 +0200 (CEST)",
            "from mail-gw2-out.broadcom.com (mail-gw2-out.broadcom.com\n\t[216.31.210.63]) by dpdk.org (Postfix) with ESMTP id 521C4AA39\n\tfor <dev@dpdk.org>; Wed, 15 Jun 2016 00:57:12 +0200 (CEST)",
            "from mail-irv-18.broadcom.com ([10.15.198.37])\n\tby mail-gw2-out.broadcom.com with ESMTP; 14 Jun 2016 16:17:10 -0700",
            "from mail-irva-12.broadcom.com (mail-irva-12.broadcom.com\n\t[10.11.16.101])\n\tby mail-irv-18.broadcom.com (Postfix) with ESMTP id DC3718202C;\n\tTue, 14 Jun 2016 15:57:00 -0700 (PDT)",
            "from DPDK-C1.broadcom.com (dhcp-10-13-115-104.irv.broadcom.com\n\t[10.13.115.104])\n\tby mail-irva-12.broadcom.com (Postfix) with ESMTP id 0E14EA6281;\n\tTue, 14 Jun 2016 15:57:00 -0700 (PDT)"
        ],
        "X-IronPort-AV": "E=Sophos;i=\"5.26,473,1459839600\"; d=\"scan'208\";a=\"97627290\"",
        "From": "Stephen Hurd <stephen.hurd@broadcom.com>",
        "To": "dev@dpdk.org,\n\tajit.khaparde@broadcom.com,\n\tbruce.richardson@intel.com",
        "Date": "Tue, 14 Jun 2016 15:55:39 -0700",
        "Message-Id": "<1465944971-113413-6-git-send-email-stephen.hurd@broadcom.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1465944971-113413-1-git-send-email-stephen.hurd@broadcom.com>",
        "References": "<1465250923-78695-1-git-send-email-stephen.hurd@broadcom.com>\n\t<1465944971-113413-1-git-send-email-stephen.hurd@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH v5 06/38] bnxt: add vnic functions and structs",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Ajit Khaparde <ajit.khaparde@broadcom.com>\n\nAdd functions to allocate, initialize, and free vnics.\n\nA VNIC represents a virtual interface. It is a resource in the RX path\nof the chip and is used to setup various target actions such as RSS,\nMAC filtering etc.. for the physical function in use.\n\nSigned-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\nSigned-off-by: Stephen Hurd <stephen.hurd@broadcom.com>\nReviewed-by: David Christensen <david.christensen@broadcom.com>\n\n--\nv5:\nReorder footer\n---\n drivers/net/bnxt/Makefile              |   1 +\n drivers/net/bnxt/bnxt.h                |  14 ++\n drivers/net/bnxt/bnxt_vnic.c           | 277 +++++++++++++++++++++++++++++++++\n drivers/net/bnxt/bnxt_vnic.h           |  80 ++++++++++\n drivers/net/bnxt/hsi_struct_def_dpdk.h |   3 +\n 5 files changed, 375 insertions(+)\n create mode 100644 drivers/net/bnxt/bnxt_vnic.c\n create mode 100644 drivers/net/bnxt/bnxt_vnic.h",
    "diff": "diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile\nindex 9965597..c57afaa 100644\n--- a/drivers/net/bnxt/Makefile\n+++ b/drivers/net/bnxt/Makefile\n@@ -50,6 +50,7 @@ EXPORT_MAP := rte_pmd_bnxt_version.map\n #\n SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_ethdev.c\n SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_hwrm.c\n+SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_vnic.c\n \n #\n # Export include files\ndiff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h\nindex bfce91e..d0f84f4 100644\n--- a/drivers/net/bnxt/bnxt.h\n+++ b/drivers/net/bnxt/bnxt.h\n@@ -45,6 +45,13 @@\n #define BNXT_MAX_MTU\t\t9000\n #define VLAN_TAG_SIZE\t\t4\n \n+enum bnxt_hw_context {\n+\tHW_CONTEXT_NONE     = 0,\n+\tHW_CONTEXT_IS_RSS   = 1,\n+\tHW_CONTEXT_IS_COS   = 2,\n+\tHW_CONTEXT_IS_LB    = 3,\n+};\n+\n struct bnxt_vf_info {\n \tuint16_t\t\tfw_fid;\n \tuint8_t\t\t\tmac_addr[ETHER_ADDR_LEN];\n@@ -130,6 +137,13 @@ struct bnxt {\n \tunsigned int\t\ttx_cp_nr_rings;\n \tstruct bnxt_tx_queue **tx_queues;\n \n+\tstruct bnxt_vnic_info\t*vnic_info;\n+\tSTAILQ_HEAD(, bnxt_vnic_info)\tfree_vnic_list;\n+\n+\t/* VNIC pointer for flow filter (VMDq) pools */\n+#define MAX_FF_POOLS\tETH_64_POOLS\n+\tSTAILQ_HEAD(, bnxt_vnic_info)\tff_pool[MAX_FF_POOLS];\n+\n #define MAX_NUM_MAC_ADDR\t32\n \tuint8_t\t\t\tmac_addr[ETHER_ADDR_LEN];\n \ndiff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c\nnew file mode 100644\nindex 0000000..c04c4c7\n--- /dev/null\n+++ b/drivers/net/bnxt/bnxt_vnic.c\n@@ -0,0 +1,277 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2014-2015 Broadcom Corporation.\n+ *   All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Broadcom Corporation nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <inttypes.h>\n+\n+#include <rte_memzone.h>\n+#include <rte_malloc.h>\n+\n+#include \"bnxt.h\"\n+#include \"bnxt_vnic.h\"\n+#include \"hsi_struct_def_dpdk.h\"\n+\n+/*\n+ * VNIC Functions\n+ */\n+\n+static void prandom_bytes(void *dest_ptr, size_t len)\n+{\n+\tchar *dest = (char *)dest_ptr;\n+\tuint64_t rb;\n+\n+\twhile (len) {\n+\t\trb = rte_rand();\n+\t\tif (len >= 8) {\n+\t\t\tmemcpy(dest, &rb, 8);\n+\t\t\tlen -= 8;\n+\t\t\tdest += 8;\n+\t\t} else {\n+\t\t\tmemcpy(dest, &rb, len);\n+\t\t\tdest += len;\n+\t\t\tlen = 0;\n+\t\t}\n+\t}\n+}\n+\n+void bnxt_init_vnics(struct bnxt *bp)\n+{\n+\tstruct bnxt_vnic_info *vnic;\n+\tuint16_t max_vnics;\n+\tint i, j;\n+\n+\tif (BNXT_PF(bp)) {\n+\t\tstruct bnxt_pf_info *pf = &bp->pf;\n+\n+\t\tmax_vnics = pf->max_vnics;\n+\t} else {\n+\t\tstruct bnxt_vf_info *vf = &bp->vf;\n+\n+\t\tmax_vnics = vf->max_vnics;\n+\t}\n+\tSTAILQ_INIT(&bp->free_vnic_list);\n+\tfor (i = 0; i < max_vnics; i++) {\n+\t\tvnic = &bp->vnic_info[i];\n+\t\tvnic->fw_vnic_id = (uint16_t)HWRM_NA_SIGNATURE;\n+\t\tvnic->fw_rss_cos_lb_ctx = (uint16_t)HWRM_NA_SIGNATURE;\n+\t\tvnic->ctx_is_rss_cos_lb = HW_CONTEXT_NONE;\n+\n+\t\tfor (j = 0; j < MAX_QUEUES_PER_VNIC; j++)\n+\t\t\tvnic->fw_grp_ids[j] = (uint16_t)HWRM_NA_SIGNATURE;\n+\n+\t\tprandom_bytes(vnic->rss_hash_key, HW_HASH_KEY_SIZE);\n+\t\tSTAILQ_INIT(&vnic->filter);\n+\t\tSTAILQ_INSERT_TAIL(&bp->free_vnic_list, vnic, next);\n+\t}\n+\tfor (i = 0; i < MAX_FF_POOLS; i++)\n+\t\tSTAILQ_INIT(&bp->ff_pool[i]);\n+}\n+\n+int bnxt_free_vnic(struct bnxt *bp, struct bnxt_vnic_info *vnic,\n+\t\t\t  int pool)\n+{\n+\tstruct bnxt_vnic_info *temp;\n+\n+\ttemp = STAILQ_FIRST(&bp->ff_pool[pool]);\n+\twhile (temp) {\n+\t\tif (temp == vnic) {\n+\t\t\tSTAILQ_REMOVE(&bp->ff_pool[pool], vnic,\n+\t\t\t\t      bnxt_vnic_info, next);\n+\t\t\tvnic->fw_vnic_id = (uint16_t)HWRM_NA_SIGNATURE;\n+\t\t\tSTAILQ_INSERT_TAIL(&bp->free_vnic_list, vnic,\n+\t\t\t\t\t   next);\n+\t\t\treturn 0;\n+\t\t}\n+\t\ttemp = STAILQ_NEXT(temp, next);\n+\t}\n+\tRTE_LOG(ERR, PMD, \"VNIC %p is not found in pool[%d]\\n\", vnic, pool);\n+\treturn -EINVAL;\n+}\n+\n+struct bnxt_vnic_info *bnxt_alloc_vnic(struct bnxt *bp)\n+{\n+\tstruct bnxt_vnic_info *vnic;\n+\n+\t/* Find the 1st unused vnic from the free_vnic_list pool*/\n+\tvnic = STAILQ_FIRST(&bp->free_vnic_list);\n+\tif (!vnic) {\n+\t\tRTE_LOG(ERR, PMD, \"No more free VNIC resources\\n\");\n+\t\treturn NULL;\n+\t}\n+\tSTAILQ_REMOVE_HEAD(&bp->free_vnic_list, next);\n+\treturn vnic;\n+}\n+\n+void bnxt_free_all_vnics(struct bnxt *bp)\n+{\n+\tstruct bnxt_vnic_info *temp, *next;\n+\tint i;\n+\n+\tfor (i = 0; i < MAX_FF_POOLS; i++) {\n+\t\ttemp = STAILQ_FIRST(&bp->ff_pool[i]);\n+\t\twhile (temp) {\n+\t\t\tnext = STAILQ_NEXT(temp, next);\n+\t\t\tSTAILQ_REMOVE(&bp->ff_pool[i], temp, bnxt_vnic_info,\n+\t\t\t\t      next);\n+\t\t\tSTAILQ_INSERT_TAIL(&bp->free_vnic_list, temp, next);\n+\t\t\ttemp = next;\n+\t\t}\n+\t}\n+}\n+\n+void bnxt_free_vnic_attributes(struct bnxt *bp)\n+{\n+\tstruct bnxt_vnic_info *vnic;\n+\n+\tSTAILQ_FOREACH(vnic, &bp->free_vnic_list, next) {\n+\t\tif (vnic->rss_table) {\n+\t\t\t/* 'Unreserve' the rss_table */\n+\t\t\t/* N/A */\n+\n+\t\t\tvnic->rss_table = NULL;\n+\t\t}\n+\n+\t\tif (vnic->rss_hash_key) {\n+\t\t\t/* 'Unreserve' the rss_hash_key */\n+\t\t\t/* N/A */\n+\n+\t\t\tvnic->rss_hash_key = NULL;\n+\t\t}\n+\t}\n+}\n+\n+int bnxt_alloc_vnic_attributes(struct bnxt *bp)\n+{\n+\tstruct bnxt_vnic_info *vnic;\n+\tstruct rte_pci_device *pdev = bp->pdev;\n+\tconst struct rte_memzone *mz;\n+\tchar mz_name[RTE_MEMZONE_NAMESIZE];\n+\tint entry_length = RTE_CACHE_LINE_ROUNDUP(\n+\t\t\t\tHW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table) +\n+\t\t\t\tHW_HASH_KEY_SIZE);\n+\tuint16_t max_vnics;\n+\tint i;\n+\n+\tif (BNXT_PF(bp)) {\n+\t\tstruct bnxt_pf_info *pf = &bp->pf;\n+\n+\t\tmax_vnics = pf->max_vnics;\n+\t} else {\n+\t\tstruct bnxt_vf_info *vf = &bp->vf;\n+\n+\t\tmax_vnics = vf->max_vnics;\n+\t}\n+\tsnprintf(mz_name, RTE_MEMZONE_NAMESIZE,\n+\t\t \"bnxt_%04x:%02x:%02x:%02x_vnicattr\", pdev->addr.domain,\n+\t\t pdev->addr.bus, pdev->addr.devid, pdev->addr.function);\n+\tmz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;\n+\tmz = rte_memzone_lookup(mz_name);\n+\tif (!mz) {\n+\t\tmz = rte_memzone_reserve(mz_name,\n+\t\t\t\t\t entry_length * max_vnics,\n+\t\t\t\t\t SOCKET_ID_ANY,\n+\t\t\t\t\t RTE_MEMZONE_2MB |\n+\t\t\t\t\t RTE_MEMZONE_SIZE_HINT_ONLY);\n+\t\tif (!mz)\n+\t\t\treturn -ENOMEM;\n+\t}\n+\n+\tfor (i = 0; i < max_vnics; i++) {\n+\t\tvnic = &bp->vnic_info[i];\n+\n+\t\t/* Allocate rss table and hash key */\n+\t\tvnic->rss_table =\n+\t\t\t(void *)((char *)mz->addr + (entry_length * i));\n+\t\tmemset(vnic->rss_table, -1, entry_length);\n+\n+\t\tvnic->rss_table_dma_addr = mz->phys_addr + (entry_length * i);\n+\t\tvnic->rss_hash_key = (void *)((char *)vnic->rss_table +\n+\t\t\t     HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table));\n+\n+\t\tvnic->rss_hash_key_dma_addr = vnic->rss_table_dma_addr +\n+\t\t\t     HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+void bnxt_free_vnic_mem(struct bnxt *bp)\n+{\n+\tstruct bnxt_vnic_info *vnic;\n+\tuint16_t max_vnics, i;\n+\n+\tif (BNXT_PF(bp)) {\n+\t\tstruct bnxt_pf_info *pf = &bp->pf;\n+\n+\t\tmax_vnics = pf->max_vnics;\n+\t} else {\n+\t\tstruct bnxt_vf_info *vf = &bp->vf;\n+\n+\t\tmax_vnics = vf->max_vnics;\n+\t}\n+\tfor (i = 0; i < max_vnics; i++) {\n+\t\tvnic = &bp->vnic_info[i];\n+\t\tif (vnic->fw_vnic_id != (uint16_t)HWRM_NA_SIGNATURE) {\n+\t\t\tRTE_LOG(ERR, PMD, \"VNIC is not freed yet!\\n\");\n+\t\t\t/* TODO Call HWRM to free VNIC */\n+\t\t}\n+\t}\n+\n+\trte_free(bp->vnic_info);\n+\tbp->vnic_info = NULL;\n+}\n+\n+int bnxt_alloc_vnic_mem(struct bnxt *bp)\n+{\n+\tstruct bnxt_vnic_info *vnic_mem;\n+\tuint16_t max_vnics;\n+\n+\tif (BNXT_PF(bp)) {\n+\t\tstruct bnxt_pf_info *pf = &bp->pf;\n+\n+\t\tmax_vnics = pf->max_vnics;\n+\t} else {\n+\t\tstruct bnxt_vf_info *vf = &bp->vf;\n+\n+\t\tmax_vnics = vf->max_vnics;\n+\t}\n+\t/* Allocate memory for VNIC pool and filter pool */\n+\tvnic_mem = rte_zmalloc(\"bnxt_vnic_info\",\n+\t\t\t       max_vnics * sizeof(struct bnxt_vnic_info), 0);\n+\tif (vnic_mem == NULL) {\n+\t\tRTE_LOG(ERR, PMD, \"Failed to alloc memory for %d VNICs\",\n+\t\t\tmax_vnics);\n+\t\treturn -ENOMEM;\n+\t}\n+\tbp->vnic_info = vnic_mem;\n+\treturn 0;\n+}\ndiff --git a/drivers/net/bnxt/bnxt_vnic.h b/drivers/net/bnxt/bnxt_vnic.h\nnew file mode 100644\nindex 0000000..9671ba4\n--- /dev/null\n+++ b/drivers/net/bnxt/bnxt_vnic.h\n@@ -0,0 +1,80 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2014-2015 Broadcom Corporation.\n+ *   All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Broadcom Corporation nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _BNXT_VNIC_H_\n+#define _BNXT_VNIC_H_\n+\n+#include <sys/queue.h>\n+#include <stdbool.h>\n+\n+struct bnxt_vnic_info {\n+\tSTAILQ_ENTRY(bnxt_vnic_info)\tnext;\n+\tuint8_t\t\tff_pool_idx;\n+\n+\tuint16_t\tfw_vnic_id; /* returned by Chimp during alloc */\n+\tuint16_t\tfw_rss_cos_lb_ctx;\n+\tuint16_t\tctx_is_rss_cos_lb;\n+#define MAX_NUM_TRAFFIC_CLASSES\t\t8\n+#define MAX_NUM_RSS_QUEUES_PER_VNIC\t16\n+#define MAX_QUEUES_PER_VNIC\t(MAX_NUM_RSS_QUEUES_PER_VNIC + \\\n+\t\t\t\t MAX_NUM_TRAFFIC_CLASSES)\n+\tuint16_t\tstart_grp_id;\n+\tuint16_t\tend_grp_id;\n+\tuint16_t\tfw_grp_ids[MAX_QUEUES_PER_VNIC];\n+\tuint16_t\thash_type;\n+\tphys_addr_t\trss_table_dma_addr;\n+\tuint16_t\t*rss_table;\n+\tphys_addr_t\trss_hash_key_dma_addr;\n+\tvoid\t\t*rss_hash_key;\n+\tuint32_t\tflags;\n+#define BNXT_VNIC_INFO_PROMISC\t\t\t(1 << 0)\n+#define BNXT_VNIC_INFO_ALLMULTI\t\t\t(1 << 1)\n+\n+\tbool\t\tvlan_strip;\n+\tbool\t\tfunc_default;\n+\n+\tSTAILQ_HEAD(, bnxt_filter_info)\tfilter;\n+};\n+\n+struct bnxt;\n+void bnxt_init_vnics(struct bnxt *bp);\n+int bnxt_free_vnic(struct bnxt *bp, struct bnxt_vnic_info *vnic,\n+\t\t\t  int pool);\n+struct bnxt_vnic_info *bnxt_alloc_vnic(struct bnxt *bp);\n+void bnxt_free_all_vnics(struct bnxt *bp);\n+void bnxt_free_vnic_attributes(struct bnxt *bp);\n+int bnxt_alloc_vnic_attributes(struct bnxt *bp);\n+void bnxt_free_vnic_mem(struct bnxt *bp);\n+int bnxt_alloc_vnic_mem(struct bnxt *bp);\n+\n+#endif\ndiff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h\nindex cd2b14e..92e39ca 100644\n--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h\n+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h\n@@ -43,8 +43,11 @@\n  * Following is the signature for HWRM message field that indicates not\n  * applicable (All F's). Need to cast it the size of the field if needed.\n  */\n+#define HWRM_NA_SIGNATURE        ((uint32_t)(-1))\n #define HWRM_MAX_REQ_LEN\t(128)  /* hwrm_func_buf_rgtr */\n #define HWRM_MAX_RESP_LEN\t(176)  /* hwrm_func_qstats */\n+#define HW_HASH_INDEX_SIZE      0x80    /* 7 bit indirection table index. */\n+#define HW_HASH_KEY_SIZE        40\n #define HWRM_RESP_VALID_KEY\t1 /* valid key for HWRM response */\n \n /*\n",
    "prefixes": [
        "dpdk-dev",
        "v5",
        "06/38"
    ]
}