On Thu, Dec 04, 2014 at 06:11:41PM +0100, Jean-Mickael Guerin wrote:
> >>Which makes me think, that we probably shouldn't overwrite buf_len by 
> >>rxq->mbuf_initializer.
> >>
> >I believe that it is perfectly safe to do so. All buffers from a mempool are 
> >meant
> >to be the same size, therefore reading the length of one buffer should tell 
> >you
> >what size all buffers are. If we do hit a scenario where we do need to 
> >support
> >variable size buffers from a single mempool, we can do that via the older 
> >unoptimized
> >code paths, I think, since it's a definite edge case.
> >
> 
> I agree, and there is a place to store some values unique for all mbufs in a
> pool:
> 
> struct rte_pktmbuf_pool_private {
>         uint16_t mbuf_data_room_size; /**< Size of data space in each
> mbuf.*/
> };
> 
> We could add a new field mbuf_buf_len here, it looks definitely better than
> new callbacks in rte_mempool.
> 
> What do you think?

I think it's overkill.
I like the original suggest to allocate a buffer and pull the length settings 
from
there. Just add the checking so that if the allocation fails the whole setup 
fails.
If we can't allocate one mbuf from a pool, it's a pretty catastrophic error that
needs to be flagged ASAP. I wouldn't look to do anything up and above that.

/Bruce

Reply via email to