Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/73746/?format=api
http://patchwork.dpdk.org/api/patches/73746/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200710143658.498979-1-ferruh.yigit@intel.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20200710143658.498979-1-ferruh.yigit@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200710143658.498979-1-ferruh.yigit@intel.com", "date": "2020-07-10T14:36:57", "name": "[v5,1/2] ethdev: add function to release HW rings", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "8f65496121e413067e4d7776071c499d16bce9d6", "submitter": { "id": 324, "url": "http://patchwork.dpdk.org/api/people/324/?format=api", "name": "Ferruh Yigit", "email": "ferruh.yigit@intel.com" }, "delegate": { "id": 319, "url": "http://patchwork.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200710143658.498979-1-ferruh.yigit@intel.com/mbox/", "series": [ { "id": 10951, "url": "http://patchwork.dpdk.org/api/series/10951/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=10951", "date": "2020-07-10T14:36:57", "name": "[v5,1/2] ethdev: add function to release HW rings", "version": 5, "mbox": "http://patchwork.dpdk.org/series/10951/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/73746/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/73746/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 9CEEEA052A;\n\tFri, 10 Jul 2020 16:37:06 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D3CE31DB08;\n\tFri, 10 Jul 2020 16:37:05 +0200 (CEST)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by dpdk.org (Postfix) with ESMTP id 2DEAD1DAFB\n for <dev@dpdk.org>; Fri, 10 Jul 2020 16:37:04 +0200 (CEST)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Jul 2020 07:37:03 -0700", "from silpixa00399752.ir.intel.com (HELO\n silpixa00399752.ger.corp.intel.com) ([10.237.222.180])\n by fmsmga001.fm.intel.com with ESMTP; 10 Jul 2020 07:37:01 -0700" ], "IronPort-SDR": [ "\n 3gthzEZi/h5R46/ku+FoFIwxNHRde0hZ0TrYp+P6oh+X9eYJyzNBwsMKVGyH9wZvXHiCC5rJqy\n QKW4gw2DD1Ug==", "\n dIKS8Fwlosqsjtehi67ZCLfUeNOOegDyX4iUjfx8VqT7u5PAdahoHWFU65p/Q04LsETEQEF+gz\n kcuHjPwyFWGQ==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9678\"; a=\"233070316\"", "E=Sophos;i=\"5.75,336,1589266800\"; d=\"scan'208\";a=\"233070316\"", "E=Sophos;i=\"5.75,336,1589266800\"; d=\"scan'208\";a=\"389546641\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Ferruh Yigit <ferruh.yigit@intel.com>", "To": "Thomas Monjalon <thomas@monjalon.net>,\n Andrew Rybchenko <arybchenko@solarflare.com>, Ray Kinsella <mdr@ashroe.eu>,\n Neil Horman <nhorman@tuxdriver.com>", "Cc": "dev@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>,\n Renata Saiakhova <renata.saiakhova@ekinops.com>", "Date": "Fri, 10 Jul 2020 15:36:57 +0100", "Message-Id": "<20200710143658.498979-1-ferruh.yigit@intel.com>", "X-Mailer": "git-send-email 2.25.4", "In-Reply-To": "<20200622095443.26136-1-Renata.Saiakhova@ekinops.com>", "References": "<20200622095443.26136-1-Renata.Saiakhova@ekinops.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v5 1/2] ethdev: add function to release HW rings", "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: Renata Saiakhova <renata.saiakhova@ekinops.com>\n\nFree previously allocated memzone for HW rings\n\nSigned-off-by: Renata Saiakhova <renata.saiakhova@ekinops.com>\nReviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>\nAcked-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\nv5:\n* Converted macro to static inline function\n* Updated API return error value\n---\n lib/librte_ethdev/rte_ethdev.c | 36 ++++++++++++++++++++++--\n lib/librte_ethdev/rte_ethdev_driver.h | 17 +++++++++++\n lib/librte_ethdev/rte_ethdev_version.map | 7 +++++\n 3 files changed, 58 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 5ff52046dc..049d0a684c 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -4200,6 +4200,14 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id)\n \treturn fd;\n }\n \n+static inline int\n+eth_dma_mzone_name(char *name, size_t len, uint16_t port_id, uint16_t queue_id,\n+\t\tconst char *ring_name)\n+{\n+\treturn snprintf(name, len, \"eth_p%d_q%d_%s\",\n+\t\t\tport_id, queue_id, ring_name);\n+}\n+\n const struct rte_memzone *\n rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name,\n \t\t\t uint16_t queue_id, size_t size, unsigned align,\n@@ -4209,8 +4217,8 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name,\n \tconst struct rte_memzone *mz;\n \tint rc;\n \n-\trc = snprintf(z_name, sizeof(z_name), \"eth_p%d_q%d_%s\",\n-\t\t dev->data->port_id, queue_id, ring_name);\n+\trc = eth_dma_mzone_name(z_name, sizeof(z_name), dev->data->port_id,\n+\t\t\tqueue_id, ring_name);\n \tif (rc >= RTE_MEMZONE_NAMESIZE) {\n \t\tRTE_ETHDEV_LOG(ERR, \"ring name too long\\n\");\n \t\trte_errno = ENAMETOOLONG;\n@@ -4235,6 +4243,30 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name,\n \t\t\tRTE_MEMZONE_IOVA_CONTIG, align);\n }\n \n+int\n+rte_eth_dma_zone_free(const struct rte_eth_dev *dev, const char *ring_name,\n+\t\tuint16_t queue_id)\n+{\n+\tchar z_name[RTE_MEMZONE_NAMESIZE];\n+\tconst struct rte_memzone *mz;\n+\tint rc = 0;\n+\n+\trc = eth_dma_mzone_name(z_name, sizeof(z_name), dev->data->port_id,\n+\t\t\tqueue_id, ring_name);\n+\tif (rc >= RTE_MEMZONE_NAMESIZE) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"ring name too long\\n\");\n+\t\treturn -ENAMETOOLONG;\n+\t}\n+\n+\tmz = rte_memzone_lookup(z_name);\n+\tif (mz)\n+\t\trc = rte_memzone_free(mz);\n+\telse\n+\t\trc = -ENOENT;\n+\n+\treturn rc;\n+}\n+\n int\n rte_eth_dev_create(struct rte_device *device, const char *name,\n \tsize_t priv_data_size,\ndiff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h\nindex 99d4cd6cd0..13fd049c0d 100644\n--- a/lib/librte_ethdev/rte_ethdev_driver.h\n+++ b/lib/librte_ethdev/rte_ethdev_driver.h\n@@ -180,6 +180,23 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name,\n \t\t\t uint16_t queue_id, size_t size,\n \t\t\t unsigned align, int socket_id);\n \n+/**\n+ * Free previously allocated memzone for HW rings.\n+ *\n+ * @param eth_dev\n+ * The *eth_dev* pointer is the address of the *rte_eth_dev* structure\n+ * @param name\n+ * The name of the memory zone\n+ * @param queue_id\n+ * The index of the queue to add to name\n+ * @return\n+ * Negative errno value on error, 0 on success.\n+ */\n+__rte_internal\n+int\n+rte_eth_dma_zone_free(const struct rte_eth_dev *eth_dev, const char *name,\n+\t\t uint16_t queue_id);\n+\n /**\n * @internal\n * Atomically set the link status for the specific device.\ndiff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map\nindex 7155056045..664d6b86a2 100644\n--- a/lib/librte_ethdev/rte_ethdev_version.map\n+++ b/lib/librte_ethdev/rte_ethdev_version.map\n@@ -242,3 +242,10 @@ EXPERIMENTAL {\n \t__rte_ethdev_trace_tx_burst;\n \trte_flow_get_aged_flows;\n };\n+\n+INTERNAL {\n+\tglobal:\n+\n+\trte_eth_dma_zone_free;\n+};\n+\n", "prefixes": [ "v5", "1/2" ] }{ "id": 73746, "url": "