> -----Original Message-----
> From: Ananyev, Konstantin [mailto:konstantin.ananyev at intel.com] 
> Sent: Thursday, June 09, 2016 8:45 AM
> To: Thomas Monjalon <thomas.monjalon at 6wind.com>
> Cc: dev at dpdk.org; Olivier Matz <olivier.matz at 6wind.com>; Adrien 
> Mazarguil <adrien.mazarguil at 6wind.com>; Zhang, Helin <helin.zhang at 
> intel.com>
> Subject: Re: [dpdk-dev] [PATCH] mbuf: remove inconsistent assert statements
>...
> But as I said, if everyone are that desperate about symmetry, we can just 
> create a new public function:
>
> void
> rte_mbuf_raw_free(stuct rte_mbuf *m)
> {
>       if (rte_mbuf_refcnt_update(m, -1) == 0)
>                 __rte_mbuf_raw_free(m);
> }

Well, if you're going to do that, let's recognize that rte_mbuf_raw_free() was 
misnamed:
it doesn't free an mbuf, it returns an mbuf that's already free back to the 
pool. So instead
of "__rte_mbuf_raw_free", I'd call it "rte_mbuf_raw_release".

Logically I like this solution, as I'm very uncomfortable with the idea that a 
free mbuf
might sometimes have refcnt set to one. On the other hand, if mbufs can often 
be freed
without touching refcnt, that could be a big win that might persuade me to 
accept being
uncomfortable.

-don provan
dprovan at bivio.net

Reply via email to