Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/60018/?format=api
http://patchwork.dpdk.org/api/patches/60018/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20190927100513.105674-4-mb@smartsharesystems.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": "<20190927100513.105674-4-mb@smartsharesystems.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190927100513.105674-4-mb@smartsharesystems.com", "date": "2019-09-27T10:05:13", "name": "[v3,3/3] mbuf: add bulk free function", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "53911a02cec63a3fd5cb9d514d9522f0e65d7320", "submitter": { "id": 591, "url": "http://patchwork.dpdk.org/api/people/591/?format=api", "name": "Morten Brørup", "email": "mb@smartsharesystems.com" }, "delegate": null, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20190927100513.105674-4-mb@smartsharesystems.com/mbox/", "series": [ { "id": 6580, "url": "http://patchwork.dpdk.org/api/series/6580/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=6580", "date": "2019-09-27T10:05:10", "name": "mbuf: add bulk free function", "version": 3, "mbox": "http://patchwork.dpdk.org/series/6580/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/60018/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/60018/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C35551BEED;\n\tFri, 27 Sep 2019 12:05:38 +0200 (CEST)", "from smartserver.smartsharesystems.com\n\t(smartserver.smartsharesystems.com [77.243.40.215])\n\tby dpdk.org (Postfix) with ESMTP id 3F8811BEDD\n\tfor <dev@dpdk.org>; Fri, 27 Sep 2019 12:05:30 +0200 (CEST)", "from dkrd2.smartsharesys.local ([192.168.4.12]) by\n\tsmartserver.smartsharesystems.com with Microsoft\n\tSMTPSVC(6.0.3790.4675); Fri, 27 Sep 2019 12:05:29 +0200" ], "From": "=?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>", "To": "olivier.matz@6wind.com", "Cc": "stephen@networkplumber.org, harry.van.haaren@intel.com,\n\tkonstantin.ananyev@intel.com, mattias.ronnblom@ericsson.com, \n\tbruce.richardson@intel.com, arybchenko@solarflare.com, dev@dpdk.org, \n\t=?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>", "Date": "Fri, 27 Sep 2019 10:05:13 +0000", "Message-Id": "<20190927100513.105674-4-mb@smartsharesystems.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190927100513.105674-1-mb@smartsharesystems.com>", "References": "<20190927100513.105674-1-mb@smartsharesystems.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-OriginalArrivalTime": "27 Sep 2019 10:05:29.0798 (UTC)\n\tFILETIME=[179C3E60:01D5751B]", "Subject": "[dpdk-dev] [PATCH v3 3/3] mbuf: add bulk free function", "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add function for freeing a bulk of mbufs.\n\nSigned-off-by: Morten Brørup <mb@smartsharesystems.com>\n---\n lib/librte_mbuf/rte_mbuf.c | 41 ++++++++++++++++++++++++++------------\n 1 file changed, 28 insertions(+), 13 deletions(-)", "diff": "diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c\nindex b63a0eced..008891720 100644\n--- a/lib/librte_mbuf/rte_mbuf.c\n+++ b/lib/librte_mbuf/rte_mbuf.c\n@@ -246,14 +246,35 @@ int rte_mbuf_check(const struct rte_mbuf *m, int is_header,\n }\n \n /**\n- * Maximum bulk of mbufs rte_pktmbuf_free_bulk() returns to mempool.\n+ * Size of the array holding mbufs from the same membool to be freed in bulk.\n */\n #define RTE_PKTMBUF_FREE_BULK_SZ 64\n \n+/**\n+ * @internal helper function for freeing a bulk of mbufs via an array holding\n+ * mbufs from the same mempool.\n+ */\n+static __rte_always_inline void\n+rte_pktmbuf_free_seg_via_array(struct rte_mbuf *m,\n+\tstruct rte_mbuf * * const free, unsigned int * const nb_free)\n+{\n+\tm = rte_pktmbuf_prefree_seg(m);\n+\tif (likely(m != NULL)) {\n+\t\tif (*nb_free >= RTE_PKTMBUF_FREE_BULK_SZ ||\n+\t\t (*nb_free > 0 && m->pool != free[0]->pool)) {\n+\t\t\trte_mempool_put_bulk(free[0]->pool, (void **)free,\n+\t\t\t\t\t *nb_free);\n+\t\t\t*nb_free = 0;\n+\t\t}\n+\n+\t\tfree[(*nb_free)++] = m;\n+\t}\n+}\n+\n /* Free a bulk of mbufs back into their original mempools. */\n void rte_pktmbuf_free_bulk(struct rte_mbuf **mbufs, unsigned int count)\n {\n-\tstruct rte_mbuf *m, *free[RTE_PKTMBUF_FREE_BULK_SZ];\n+\tstruct rte_mbuf *m, *m_next, *free[RTE_PKTMBUF_FREE_BULK_SZ];\n \tunsigned int idx, nb_free = 0;\n \n \tfor (idx = 0; idx < count; idx++) {\n@@ -262,18 +283,12 @@ void rte_pktmbuf_free_bulk(struct rte_mbuf **mbufs, unsigned int count)\n \t\t\tcontinue;\n \n \t\t__rte_mbuf_sanity_check(m, 1);\n-\t\tm = rte_pktmbuf_prefree_seg(m);\n-\t\tif (unlikely(m == NULL))\n-\t\t\tcontinue;\n-\n-\t\tif (nb_free >= RTE_PKTMBUF_FREE_BULK_SZ ||\n-\t\t (nb_free > 0 && m->pool != free[0]->pool)) {\n-\t\t\trte_mempool_put_bulk(free[0]->pool,\n-\t\t\t (void **)free, nb_free);\n-\t\t\tnb_free = 0;\n-\t\t}\n \n-\t\tfree[nb_free++] = m;\n+\t\tdo {\n+\t\t\tm_next = m->next;\n+\t\t\trte_pktmbuf_free_seg_via_array(m, free, &nb_free);\n+\t\t\tm = m_next;\n+\t\t} while (m != NULL);\n \t}\n \n \tif (nb_free > 0)\n", "prefixes": [ "v3", "3/3" ] }{ "id": 60018, "url": "