DPDK patches and discussions
 help / color / mirror / Atom feed
From: "John Daley (johndale)" <johndale@cisco.com>
To: Olivier Matz <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "bruce.richardson@intel.com" <bruce.richardson@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/enic: decrement Tx mbuf reference count before recycling
Date: Mon, 11 Jul 2016 19:41:02 +0000	[thread overview]
Message-ID: <eb3d65106f0c4da1b5b5c3679757d427@XCH-RCD-007.cisco.com> (raw)
In-Reply-To: <1ca338a4-a8fe-8149-2373-d02fee3199cb@6wind.com>



> -----Original Message-----
> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> Sent: Monday, July 11, 2016 3:04 AM
> To: John Daley (johndale) <johndale@cisco.com>; dev@dpdk.org
> Cc: bruce.richardson@intel.com
> Subject: Re: [dpdk-dev] [PATCH] net/enic: decrement Tx mbuf reference
> count before recycling
> 
> Hi John,
> 
> On 07/09/2016 12:22 AM, John Daley wrote:
> > In the Tx cleanup function, the reference count in mbufs to be
> > returned to the pool should to be decremented before they are
> > returned. Decrementing is not done by rte_mempool_put_bulk() so it
> > must be done separately using __rte_pktmbuf_prefree_seg().
> > If decrementing does not result in a 0 reference count the mbuf is not
> > returned to the pool and whatever has the last reference is
> > responsible for freeing.
> >
> > Fixes: 36935afbc53c ("net/enic: refactor Tx mbuf recycling")
> > Reviewed-by: Nelson Escobar <neescoba@cisco.com>
> > Signed-off-by: John Daley <johndale@cisco.com>
> > ---
> > Since reference counts are set to 0 when mbufs are reallocated from
> > the pool, and sending packets with reference count not equal to 1 is
> > probably an application error, this patch may not be critical. But a
> > debug ASSERT caught it and it would be nice to have it fixed in 16.07.
> 
> Sending a packet with refcnt != 1 is not an error. It can happen when using
> mbuf clones. So indeed it would be better to have in 16.07.
> 
> For the same reason, I also wonder if enic_free_wq_buf() should also be
> updated with:
> 
> -       rte_mempool_put(mbuf->pool, mbuf);
> +       rte_pktmbuf_free(mbuf);
That is a very good point, thank you. I'll use rte_pktmubf_free_seg(mbuf) though, since we are walking an array of all mbuf segments. V2 coming momentarily.
-john
> 
> 
> Regards,
> Olivier

  reply	other threads:[~2016-07-11 19:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08 22:22 John Daley
2016-07-08 22:22 ` [dpdk-dev] [PATCH] net/enic: increment filter failure counter John Daley
2016-07-15 21:26   ` Thomas Monjalon
2016-07-11 10:04 ` [dpdk-dev] [PATCH] net/enic: decrement Tx mbuf reference count before recycling Olivier Matz
2016-07-11 19:41   ` John Daley (johndale) [this message]
2016-07-11 19:45   ` [dpdk-dev] [PATCH v2] " John Daley
2016-07-15 21:27     ` Thomas Monjalon

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=eb3d65106f0c4da1b5b5c3679757d427@XCH-RCD-007.cisco.com \
    --to=johndale@cisco.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    /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).