From: Stephen Hemminger <stephen@networkplumber.org>
To: Simon Kagstrom <simon.kagstrom@netinsight.net>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] rte_sched: release enqueued mbufs on rte_sched_port_free()
Date: Wed, 4 Nov 2015 10:14:26 -0800 [thread overview]
Message-ID: <20151104101426.2f771b45@xeon-e3> (raw)
In-Reply-To: <20151028105633.6a507c98@miho>
On Wed, 28 Oct 2015 10:56:33 +0100
Simon Kagstrom <simon.kagstrom@netinsight.net> wrote:
> Otherwise mbufs will leak when the port is destroyed. The
> rte_sched_port_qbase() and rte_sched_port_qsize() functions are used
> in free now, so move them up.
>
> Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Overall it looks good, and fixes a long standing bug.
Maybe good to expose it as a API function rte_sched_port_flush
to allow use from applications.
> +static inline struct rte_mbuf **
> +rte_sched_port_qbase(struct rte_sched_port *port, uint32_t qindex)
> +{
> + uint32_t pindex = qindex >> 4;
> + uint32_t qpos = qindex & 0xF;
> +
> + return (port->queue_array + pindex * port->qsize_sum + port->qsize_add[qpos]);
Please long expression over 80 characters onto multiple lines.
> static int
> rte_sched_port_check_params(struct rte_sched_port_params *params)
> {
> @@ -717,11 +734,21 @@ rte_sched_port_config(struct rte_sched_port_params *params)
> void
> rte_sched_port_free(struct rte_sched_port *port)
> {
> + unsigned int queue;
> /* Check user parameters */
> if (port == NULL){
> return;
> }
Please add blank line after declaration.
Ps: the rte_sched needs to be run through a reformatter. lots of whitespace issues.
next prev parent reply other threads:[~2015-11-04 18:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 9:56 Simon Kagstrom
2015-11-04 7:49 ` Simon Kågström
2015-11-04 18:14 ` Stephen Hemminger [this message]
2015-11-17 7:53 ` Simon Kågström
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151104101426.2f771b45@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=simon.kagstrom@netinsight.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).