Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/8124/?format=api
https://patches.dpdk.org/api/patches/8124/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20151028105633.6a507c98@miho/", "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": "<20151028105633.6a507c98@miho>", "list_archive_url": "https://inbox.dpdk.org/dev/20151028105633.6a507c98@miho", "date": "2015-10-28T09:56:33", "name": "[dpdk-dev] rte_sched: release enqueued mbufs on rte_sched_port_free()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "71ccd7a16fc66251d522a74d6c202eb287c2422c", "submitter": { "id": 180, "url": "https://patches.dpdk.org/api/people/180/?format=api", "name": "Simon Kagstrom", "email": "simon.kagstrom@netinsight.net" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20151028105633.6a507c98@miho/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/8124/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/8124/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 CC8438D9E;\n\tWed, 28 Oct 2015 10:56:43 +0100 (CET)", "from ernst.netinsight.se (ernst.netinsight.se [194.16.221.21])\n\tby dpdk.org (Postfix) with SMTP id F0D5D9E7\n\tfor <dev@dpdk.org>; Wed, 28 Oct 2015 10:56:41 +0100 (CET)", "from miho (unverified [10.100.1.152]) by ernst.netinsight.se\n\t(EMWAC SMTPRS 0.83) with SMTP id <B0031433101@ernst.netinsight.se>;\n\tWed, 28 Oct 2015 10:56:33 +0100" ], "Date": "Wed, 28 Oct 2015 10:56:33 +0100", "From": "Simon Kagstrom <simon.kagstrom@netinsight.net>", "To": "cristian.dumitrescu@intel.com", "Message-ID": "<20151028105633.6a507c98@miho>", "X-Mailer": "Claws Mail 3.9.3 (GTK+ 2.24.27; x86_64-pc-linux-gnu)", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=US-ASCII", "Content-Transfer-Encoding": "7bit", "Cc": "dev@dpdk.org", "Subject": "[dpdk-dev] [PATCH] rte_sched: release enqueued mbufs on\n\trte_sched_port_free()", "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": "Otherwise mbufs will leak when the port is destroyed. The\nrte_sched_port_qbase() and rte_sched_port_qsize() functions are used\nin free now, so move them up.\n\nSigned-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>\n---\n lib/librte_sched/rte_sched.c | 44 +++++++++++++++++++++++++++-----------------\n 1 file changed, 27 insertions(+), 17 deletions(-)", "diff": "diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c\nindex 9c9419d..81462cd 100644\n--- a/lib/librte_sched/rte_sched.c\n+++ b/lib/librte_sched/rte_sched.c\n@@ -312,6 +312,23 @@ rte_sched_port_queues_per_port(struct rte_sched_port *port)\n \treturn RTE_SCHED_QUEUES_PER_PIPE * port->n_pipes_per_subport * port->n_subports_per_port;\n }\n \n+static inline struct rte_mbuf **\n+rte_sched_port_qbase(struct rte_sched_port *port, uint32_t qindex)\n+{\n+\tuint32_t pindex = qindex >> 4;\n+\tuint32_t qpos = qindex & 0xF;\n+\n+\treturn (port->queue_array + pindex * port->qsize_sum + port->qsize_add[qpos]);\n+}\n+\n+static inline uint16_t\n+rte_sched_port_qsize(struct rte_sched_port *port, uint32_t qindex)\n+{\n+\tuint32_t tc = (qindex >> 2) & 0x3;\n+\n+\treturn port->qsize[tc];\n+}\n+\n static int\n rte_sched_port_check_params(struct rte_sched_port_params *params)\n {\n@@ -717,11 +734,21 @@ rte_sched_port_config(struct rte_sched_port_params *params)\n void\n rte_sched_port_free(struct rte_sched_port *port)\n {\n+\tunsigned int queue;\n \t/* Check user parameters */\n \tif (port == NULL){\n \t\treturn;\n \t}\n \n+\t/* Free enqueued mbufs */\n+\tfor (queue = 0; queue < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; queue++) {\n+\t\tunsigned int i;\n+\t\tstruct rte_mbuf **mbufs = rte_sched_port_qbase(port, queue);\n+\n+\t\tfor (i = 0; i < rte_sched_port_qsize(port, queue); i++)\n+\t\t\trte_pktmbuf_free(mbufs[i]);\n+\t}\n+\n \trte_bitmap_free(port->bmp);\n \trte_free(port);\n }\n@@ -1032,23 +1059,6 @@ rte_sched_port_qindex(struct rte_sched_port *port, uint32_t subport, uint32_t pi\n \treturn result;\n }\n \n-static inline struct rte_mbuf **\n-rte_sched_port_qbase(struct rte_sched_port *port, uint32_t qindex)\n-{\n-\tuint32_t pindex = qindex >> 4;\n-\tuint32_t qpos = qindex & 0xF;\n-\n-\treturn (port->queue_array + pindex * port->qsize_sum + port->qsize_add[qpos]);\n-}\n-\n-static inline uint16_t\n-rte_sched_port_qsize(struct rte_sched_port *port, uint32_t qindex)\n-{\n-\tuint32_t tc = (qindex >> 2) & 0x3;\n-\n-\treturn port->qsize[tc];\n-}\n-\n #if RTE_SCHED_DEBUG\n \n static inline int\n", "prefixes": [ "dpdk-dev" ] }{ "id": 8124, "url": "