get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 12565,
    "url": "http://patches.dpdk.org/api/patches/12565/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1462562780-47991-19-git-send-email-stephen.hurd@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": "<1462562780-47991-19-git-send-email-stephen.hurd@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1462562780-47991-19-git-send-email-stephen.hurd@broadcom.com",
    "date": "2016-05-06T19:25:59",
    "name": "[dpdk-dev,19/40] bnxt: add HWRM vnic cfg function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5eb7cfaa19e4f5217e0ae5db8eebb17f232ed7cd",
    "submitter": {
        "id": 438,
        "url": "http://patches.dpdk.org/api/people/438/?format=api",
        "name": "Stephen Hurd",
        "email": "stephen.hurd@broadcom.com"
    },
    "delegate": {
        "id": 10,
        "url": "http://patches.dpdk.org/api/users/10/?format=api",
        "username": "bruce",
        "first_name": "Bruce",
        "last_name": "Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1462562780-47991-19-git-send-email-stephen.hurd@broadcom.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/12565/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/12565/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 57B675AA7;\n\tFri,  6 May 2016 21:27:08 +0200 (CEST)",
            "from mail-gw1-out.broadcom.com (mail-gw1-out.broadcom.com\n\t[216.31.210.62]) by dpdk.org (Postfix) with ESMTP id 396495A03\n\tfor <dev@dpdk.org>; Fri,  6 May 2016 21:26:54 +0200 (CEST)",
            "from mail-irv-18.broadcom.com ([10.15.198.37])\n\tby mail-gw1-out.broadcom.com with ESMTP; 06 May 2016 13:17:12 -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 E4B2882026\n\tfor <dev@dpdk.org>; Fri,  6 May 2016 12:26:53 -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 3AEA4127640\n\tfor <dev@dpdk.org>; Fri,  6 May 2016 12:26:50 -0700 (PDT)"
        ],
        "X-IronPort-AV": "E=Sophos;i=\"5.24,587,1455004800\"; d=\"scan'208\";a=\"94560738\"",
        "From": "Stephen Hurd <stephen.hurd@broadcom.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri,  6 May 2016 12:25:59 -0700",
        "Message-Id": "<1462562780-47991-19-git-send-email-stephen.hurd@broadcom.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1462562780-47991-1-git-send-email-stephen.hurd@broadcom.com>",
        "References": "<20160421100005.GA976@bricha3-MOBL3>\n\t<1462562780-47991-1-git-send-email-stephen.hurd@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH 19/40] bnxt: add HWRM vnic cfg function",
        "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": "Configurs a vnic allocaed by vnic_alloc function.\n\nSigned-off-by: Stephen Hurd <stephen.hurd@broadcom.com>\nReviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/bnxt_hwrm.c           |  34 ++++++++\n drivers/net/bnxt/bnxt_hwrm.h           |   3 +-\n drivers/net/bnxt/hsi_struct_def_dpdk.h | 155 +++++++++++++++++++++++++++++++++\n 3 files changed, 191 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex d716b67..2a18cf3 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -510,6 +510,40 @@ int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic)\n \treturn rc;\n }\n \n+int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic)\n+{\n+\tint rc = 0;\n+\tstruct hwrm_vnic_cfg_input req = {.req_type = 0 };\n+\tstruct hwrm_vnic_cfg_output *resp = bp->hwrm_cmd_resp_addr;\n+\n+\tHWRM_PREP(req, VNIC_CFG, -1, resp);\n+\n+\t/* Only RSS support for now TBD: COS & LB */\n+\treq.enables =\n+\t    rte_cpu_to_le_32(HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP |\n+\t\t\t     HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE |\n+\t\t\t     HWRM_VNIC_CFG_INPUT_ENABLES_MRU);\n+\treq.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);\n+\treq.dflt_ring_grp =\n+\t\trte_cpu_to_le_16(bp->grp_info[vnic->start_grp_id].fw_grp_id);\n+\treq.rss_rule = rte_cpu_to_le_16(vnic->fw_rss_cos_lb_ctx);\n+\treq.cos_rule = rte_cpu_to_le_16(0xffff);\n+\treq.lb_rule = rte_cpu_to_le_16(0xffff);\n+\treq.mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN +\n+\t\t\t\t   ETHER_CRC_LEN + VLAN_TAG_SIZE);\n+\tif (vnic->func_default)\n+\t\treq.flags = 1;\n+\tif (vnic->vlan_strip)\n+\t\treq.flags |=\n+\t\t    rte_cpu_to_le_32(HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE);\n+\n+\trc = bnxt_hwrm_send_message(bp, &req, sizeof(req));\n+\n+\tHWRM_CHECK_RESULT;\n+\n+\treturn rc;\n+}\n+\n int bnxt_hwrm_vnic_free(struct bnxt *bp, struct bnxt_vnic_info *vnic)\n {\n \tint rc = 0;\ndiff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h\nindex 887ad2d..b5cf090 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.h\n+++ b/drivers/net/bnxt/bnxt_hwrm.h\n@@ -59,8 +59,9 @@ int bnxt_hwrm_stat_clear(struct bnxt *bp, struct bnxt_cp_ring_info *cpr);\n \n int bnxt_hwrm_ver_get(struct bnxt *bp);\n \n-int bnxt_hwrm_vnic_free(struct bnxt *bp, struct bnxt_vnic_info *vnic);\n int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic);\n+int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic);\n+int bnxt_hwrm_vnic_free(struct bnxt *bp, struct bnxt_vnic_info *vnic);\n \n int bnxt_clear_all_hwrm_stat_ctxs(struct bnxt *bp);\n void bnxt_free_hwrm_resources(struct bnxt *bp);\ndiff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h\nindex 93d50fb..b74f9f9 100644\n--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h\n+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h\n@@ -91,6 +91,7 @@ typedef struct ctx_hw_stats64 {\n #define HWRM_QUEUE_QPORTCFG\t\t(UINT32_C(0x30))\n #define HWRM_VNIC_ALLOC\t\t\t(UINT32_C(0x40))\n #define HWRM_VNIC_FREE\t\t\t(UINT32_C(0x41))\n+#define HWRM_VNIC_CFG\t\t\t(UINT32_C(0x42))\n #define HWRM_CFA_L2_FILTER_ALLOC\t(UINT32_C(0x90))\n #define HWRM_CFA_L2_FILTER_FREE\t\t(UINT32_C(0x91))\n #define HWRM_CFA_L2_FILTER_CFG\t\t(UINT32_C(0x92))\n@@ -3268,6 +3269,160 @@ struct hwrm_vnic_alloc_output {\n \tuint8_t valid;\n } __attribute__((packed));\n \n+/* hwrm_vnic_cfg */\n+/* Description: Configure the RX VNIC structure. */\n+\n+/* Input (40 bytes) */\n+struct hwrm_vnic_cfg_input {\n+\t/*\n+\t * This value indicates what type of request this is. The format for the\n+\t * rest of the command is determined by this field.\n+\t */\n+\tuint16_t req_type;\n+\n+\t/*\n+\t * This value indicates the what completion ring the request will be\n+\t * optionally completed on. If the value is -1, then no CR completion\n+\t * will be generated. Any other value must be a valid CR ring_id value\n+\t * for this function.\n+\t */\n+\tuint16_t cmpl_ring;\n+\n+\t/* This value indicates the command sequence number. */\n+\tuint16_t seq_id;\n+\n+\t/*\n+\t * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids\n+\t * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM\n+\t */\n+\tuint16_t target_id;\n+\n+\t/*\n+\t * This is the host address where the response will be written when the\n+\t * request is complete. This area must be 16B aligned and must be\n+\t * cleared to zero before the request is made.\n+\t */\n+\tuint64_t resp_addr;\n+\n+\t/*\n+\t * When this bit is '1', the VNIC is requested to be the default VNIC\n+\t * for the function.\n+\t */\n+\t#define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT\t\tUINT32_C(0x1)\n+\t/*\n+\t * When this bit is '1', the VNIC is being configured to strip VLAN in\n+\t * the RX path. If set to '0', then VLAN stripping is disabled on this\n+\t * VNIC.\n+\t */\n+\t#define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE\tUINT32_C(0x2)\n+\t/*\n+\t * When this bit is '1', the VNIC is being configured to buffer receive\n+\t * packets in the hardware until the host posts new receive buffers. If\n+\t * set to '0', then bd_stall is being configured to be disabled on this\n+\t * VNIC.\n+\t */\n+\t#define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE\t\tUINT32_C(0x4)\n+\t/*\n+\t * When this bit is '1', the VNIC is being configured to receive both\n+\t * RoCE and non-RoCE traffic. If set to '0', then this VNIC is not\n+\t * configured to be operating in dual VNIC mode.\n+\t */\n+\t#define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE\tUINT32_C(0x8)\n+\t/*\n+\t * When this flag is set to '1', the VNIC is requested to be configured\n+\t * to receive only RoCE traffic. If this flag is set to '0', then this\n+\t * flag shall be ignored by the HWRM. If roce_dual_vnic_mode flag is set\n+\t * to '1', then the HWRM client shall not set this flag to '1'.\n+\t */\n+\t#define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE\tUINT32_C(0x10)\n+\tuint32_t flags;\n+\n+\t/* This bit must be '1' for the dflt_ring_grp field to be configured. */\n+\t#define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP\tUINT32_C(0x1)\n+\t/* This bit must be '1' for the rss_rule field to be configured. */\n+\t#define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE\t\tUINT32_C(0x2)\n+\t/* This bit must be '1' for the cos_rule field to be configured. */\n+\t#define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE\t\tUINT32_C(0x4)\n+\t/* This bit must be '1' for the lb_rule field to be configured. */\n+\t#define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE\t\tUINT32_C(0x8)\n+\t/* This bit must be '1' for the mru field to be configured. */\n+\t#define HWRM_VNIC_CFG_INPUT_ENABLES_MRU\t\t\tUINT32_C(0x10)\n+\tuint32_t enables;\n+\n+\t/* Logical vnic ID */\n+\tuint16_t vnic_id;\n+\n+\t/*\n+\t * Default Completion ring for the VNIC. This ring will be chosen if\n+\t * packet does not match any RSS rules and if there is no COS rule.\n+\t */\n+\tuint16_t dflt_ring_grp;\n+\n+\t/*\n+\t * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if there is no\n+\t * RSS rule.\n+\t */\n+\tuint16_t rss_rule;\n+\n+\t/*\n+\t * RSS ID for COS rule/table structure. 0xFF... (All Fs) if there is no\n+\t * COS rule.\n+\t */\n+\tuint16_t cos_rule;\n+\n+\t/*\n+\t * RSS ID for load balancing rule/table structure. 0xFF... (All Fs) if\n+\t * there is no LB rule.\n+\t */\n+\tuint16_t lb_rule;\n+\n+\t/*\n+\t * The maximum receive unit of the vnic. Each vnic is associated with a\n+\t * function. The vnic mru value overwrites the mru setting of the\n+\t * associated function. The HWRM shall make sure that vnic mru does not\n+\t * exceed the mru of the port the function is associated with.\n+\t */\n+\tuint16_t mru;\n+\n+\tuint32_t unused_0;\n+} __attribute__((packed));\n+\n+/* Output (16 bytes) */\n+struct hwrm_vnic_cfg_output {\n+\t/*\n+\t * Pass/Fail or error type Note: receiver to verify the in parameters,\n+\t * and fail the call with an error when appropriate\n+\t */\n+\tuint16_t error_code;\n+\n+\t/* This field returns the type of original request. */\n+\tuint16_t req_type;\n+\n+\t/* This field provides original sequence number of the command. */\n+\tuint16_t seq_id;\n+\n+\t/*\n+\t * This field is the length of the response in bytes. The last byte of\n+\t * the response is a valid flag that will read as '1' when the command\n+\t * has been completely written to memory.\n+\t */\n+\tuint16_t resp_len;\n+\n+\tuint32_t unused_0;\n+\tuint8_t unused_1;\n+\tuint8_t unused_2;\n+\tuint8_t unused_3;\n+\n+\t/*\n+\t * This field is used in Output records to indicate that the output is\n+\t * completely written to RAM. This field should be read as '1' to\n+\t * indicate that the output has been completely written. When writing a\n+\t * command completion or response to an internal processor, the order of\n+\t * writes has to be such that this field is written last.\n+\t */\n+\tuint8_t valid;\n+} __attribute__((packed));\n+\n /* hwrm_vnic_free */\n /*\n  * Description: Free a VNIC resource. Idle any resources associated with the\n",
    "prefixes": [
        "dpdk-dev",
        "19/40"
    ]
}