[dpdk-dev] [RFC PATCH DRAFT 1/2] ethdev: add buffered single pkt TX function to API

Richardson, Bruce bruce.richardson at intel.com
Wed Jun 25 02:05:06 CEST 2014


> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Tuesday, June 24, 2014 4:06 PM
> To: Richardson, Bruce
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [RFC PATCH DRAFT 1/2] ethdev: add buffered single pkt
> TX function to API
> 
> On Tue, 24 Jun 2014 23:32:15 +0100
> Bruce Richardson <bruce.richardson at intel.com> wrote:
> 
> >
> > +static void
> > +free_unsent_pkts(struct rte_mbuf **pkts, uint16_t unsent,
> > +		void *userdata __rte_unused)
> > +{
> > +	unsigned i;
> > +	for (i = 0; i < unsent; i++)
> > +		rte_pktmbuf_free(pkts[i]);
> > +}
> > +
> 
> This should be moved into mbuf layer, and there it could be
> optimized to do a rte_mempool_mp_put_bulk. This would speed
> up operations becuase it would mean a single ring operation
> per set rather per mbuf segment.
> 
> Of course, the optimization would have to handle the refcnt
> issues.

I'm not sure how we can improve this by bringing it into the mbuf layer. As well as handling of refcounts, we also have no guarantee than each mbuf queued up for a particular port comes from the same mempool.
Can you please clarify how you think this might be better done?


More information about the dev mailing list