Re: [PATCH v4 net-next 8/9] net: add a hardware buffer management helper API

2016-03-07 Thread Gregory CLEMENT
Hi Marcin, On dim., mars 06 2016, Marcin Wojtas wrote: > Hi Gregory, > > >> +int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num, gfp_t >> gfp) >> +{ >> + int err, i; >> + unsigned long flags; >> + >> + spin_lock_irqsave(_pool->lock, flags);

Re: [PATCH v4 net-next 8/9] net: add a hardware buffer management helper API

2016-03-06 Thread Marcin Wojtas
Hi Gregory, > +int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num, gfp_t gfp) > +{ > + int err, i; > + unsigned long flags; > + > + spin_lock_irqsave(_pool->lock, flags); > + if (bm_pool->buf_num == bm_pool->size) { 'size' field is used as a 'frag_size'

[PATCH v4 net-next 8/9] net: add a hardware buffer management helper API

2016-03-05 Thread Gregory CLEMENT
This basic implementation allows to share code between driver using hardware buffer management. As the code is hardware agnostic, there is few helpers, most of the optimization brought by the an HW BM has to be done at driver level. Signed-off-by: Gregory CLEMENT