Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/13227/?format=api
http://patches.dpdk.org/api/patches/13227/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1465250923-78695-26-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": "<1465250923-78695-26-git-send-email-stephen.hurd@broadcom.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1465250923-78695-26-git-send-email-stephen.hurd@broadcom.com", "date": "2016-06-06T22:08:30", "name": "[dpdk-dev,v4,26/39] bnxt: add HWRM stat context free function", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "d7ff03d9f5698e39faa1e4ff2cbdf15f1516bf3b", "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/1465250923-78695-26-git-send-email-stephen.hurd@broadcom.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/13227/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/13227/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 A3E446CB3;\n\tTue, 7 Jun 2016 00:09:48 +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 9026A377C\n\tfor <dev@dpdk.org>; Tue, 7 Jun 2016 00:09:30 +0200 (CEST)", "from mail-irv-18.broadcom.com ([10.15.198.37])\n\tby mail-gw1-out.broadcom.com with ESMTP; 06 Jun 2016 16:16:29 -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 0478582027;\n\tMon, 6 Jun 2016 15:09:30 -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 A9579127622;\n\tMon, 6 Jun 2016 15:09:28 -0700 (PDT)" ], "X-IronPort-AV": "E=Sophos;i=\"5.26,429,1459839600\"; d=\"scan'208\";a=\"96627873\"", "From": "Stephen Hurd <stephen.hurd@broadcom.com>", "To": "dev@dpdk.org,\n\tajit.khaparde@broadcom.com,\n\tbruce.richardson@intel.com", "Date": "Mon, 6 Jun 2016 15:08:30 -0700", "Message-Id": "<1465250923-78695-26-git-send-email-stephen.hurd@broadcom.com>", "X-Mailer": "git-send-email 1.9.1", "In-Reply-To": "<1465250923-78695-1-git-send-email-stephen.hurd@broadcom.com>", "References": "<1465250923-78695-1-git-send-email-stephen.hurd@broadcom.com>", "Subject": "[dpdk-dev] [PATCH v4 26/39] bnxt: add HWRM stat context free\n\tfunction", "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 function and associated structures and definitions to free\nstatistics context from the ASIC.\n\nv4:\nAddress review comments and fix issues pointed out by checkpatch.\n\nSigned-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\nReviewed-by: David Christensen <david.christensen@broadcom.com>\nSigned-off-by: Stephen Hurd <stephen.hurd@broadcom.com>\n---\n drivers/net/bnxt/bnxt_hwrm.c | 44 ++++++++++++++++++\n drivers/net/bnxt/bnxt_hwrm.h | 3 ++\n drivers/net/bnxt/hsi_struct_def_dpdk.h | 81 ++++++++++++++++++++++++++++++++++\n 3 files changed, 128 insertions(+)", "diff": "diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex 4c4f707..d3e77d5 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -699,6 +699,28 @@ int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp,\n \treturn rc;\n }\n \n+int bnxt_hwrm_stat_ctx_free(struct bnxt *bp,\n+\t\t\t struct bnxt_cp_ring_info *cpr, unsigned int idx)\n+{\n+\tint rc;\n+\tstruct hwrm_stat_ctx_free_input req = {.req_type = 0 };\n+\tstruct hwrm_stat_ctx_free_output *resp = bp->hwrm_cmd_resp_addr;\n+\n+\tHWRM_PREP(req, STAT_CTX_FREE, -1, resp);\n+\n+\treq.stat_ctx_id = rte_cpu_to_le_16(cpr->hw_stats_ctx_id);\n+\treq.seq_id = rte_cpu_to_le_16(bp->hwrm_cmd_seq++);\n+\n+\trc = bnxt_hwrm_send_message(bp, &req, sizeof(req));\n+\n+\tHWRM_CHECK_RESULT;\n+\n+\tcpr->hw_stats_ctx_id = HWRM_NA_SIGNATURE;\n+\tbp->grp_info[idx].fw_stats_ctx = cpr->hw_stats_ctx_id;\n+\n+\treturn rc;\n+}\n+\n int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic)\n {\n \tint rc = 0, i, j;\n@@ -875,6 +897,28 @@ int bnxt_clear_all_hwrm_stat_ctxs(struct bnxt *bp)\n \treturn 0;\n }\n \n+int bnxt_free_all_hwrm_stat_ctxs(struct bnxt *bp)\n+{\n+\tint rc;\n+\tunsigned int i;\n+\tstruct bnxt_cp_ring_info *cpr;\n+\n+\tfor (i = 0; i < bp->rx_cp_nr_rings + bp->tx_cp_nr_rings; i++) {\n+\t\tunsigned int idx = i + 1;\n+\n+\t\tif (i >= bp->rx_cp_nr_rings)\n+\t\t\tcpr = bp->tx_queues[i - bp->rx_cp_nr_rings]->cp_ring;\n+\t\telse\n+\t\t\tcpr = bp->rx_queues[i]->cp_ring;\n+\t\tif (cpr->hw_stats_ctx_id != HWRM_NA_SIGNATURE) {\n+\t\t\trc = bnxt_hwrm_stat_ctx_free(bp, cpr, idx);\n+\t\t\tif (rc)\n+\t\t\t\treturn rc;\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n int bnxt_alloc_all_hwrm_stat_ctxs(struct bnxt *bp)\n {\n \tunsigned int i;\ndiff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h\nindex fb088cf..5665762 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.h\n+++ b/drivers/net/bnxt/bnxt_hwrm.h\n@@ -70,6 +70,8 @@ int bnxt_hwrm_ring_grp_free(struct bnxt *bp, unsigned int idx);\n int bnxt_hwrm_stat_clear(struct bnxt *bp, struct bnxt_cp_ring_info *cpr);\n int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp,\n \t\t\t struct bnxt_cp_ring_info *cpr, unsigned int idx);\n+int bnxt_hwrm_stat_ctx_free(struct bnxt *bp,\n+\t\t\t struct bnxt_cp_ring_info *cpr, unsigned int idx);\n \n int bnxt_hwrm_ver_get(struct bnxt *bp);\n \n@@ -83,6 +85,7 @@ int bnxt_hwrm_vnic_rss_cfg(struct bnxt *bp,\n \n int bnxt_alloc_all_hwrm_stat_ctxs(struct bnxt *bp);\n int bnxt_clear_all_hwrm_stat_ctxs(struct bnxt *bp);\n+int bnxt_free_all_hwrm_stat_ctxs(struct bnxt *bp);\n int bnxt_free_all_hwrm_ring_grps(struct bnxt *bp);\n int bnxt_alloc_all_hwrm_ring_grps(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 4e2eb9f..d58295a 100644\n--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h\n+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h\n@@ -104,6 +104,7 @@ struct ctx_hw_stats64 {\n #define HWRM_CFA_L2_FILTER_CFG\t\t(UINT32_C(0x92))\n #define HWRM_CFA_L2_SET_RX_MASK\t\t(UINT32_C(0x93))\n #define HWRM_STAT_CTX_ALLOC\t\t(UINT32_C(0xb0))\n+#define HWRM_STAT_CTX_FREE\t\t(UINT32_C(0xb1))\n #define HWRM_STAT_CTX_CLR_STATS\t\t(UINT32_C(0xb3))\n #define HWRM_EXEC_FWD_RESP\t\t(UINT32_C(0xd0))\n \n@@ -3839,6 +3840,86 @@ struct hwrm_stat_ctx_clr_stats_output {\n \tuint8_t valid;\n } __attribute__((packed));\n \n+/* hwrm_stat_ctx_free */\n+/* Description: This command is used to free a stat context. */\n+/* Input (24 bytes) */\n+\n+struct hwrm_stat_ctx_free_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/* ID of the statistics context that is being queried. */\n+\tuint32_t stat_ctx_id;\n+\n+\tuint32_t unused_0;\n+} __attribute__((packed));\n+\n+/* Output (16 bytes) */\n+\n+struct hwrm_stat_ctx_free_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+\t/* This is the statistics context ID value. */\n+\tuint32_t stat_ctx_id;\n+\n+\tuint8_t unused_0;\n+\tuint8_t unused_1;\n+\tuint8_t unused_2;\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_alloc */\n /*\n * Description: This VNIC is a resource in the RX side of the chip that is used\n", "prefixes": [ "dpdk-dev", "v4", "26/39" ] }{ "id": 13227, "url": "