> > +
> > +                               /** 0: User area content may be
> overwritten when
> > +                                      packet is stored in the pool. If
> init
> > +                                      callback function is defined, it
> is
> > +                                      called to (re)initialize user
> area when
> > +                                      ever ODP has overwritten it. Init
> is not
> > +                                      necessarily called on every
> alloc, only
> > +                                      when needed (in pool creation and
> after
> > +                                      each overwrite).
> 
> How does the implementation know about the overwrite of the user-area?
> wouldn't it be better for the application to handle initialisation of
> user-are before freeing the buffer back to the pool.
> Maybe some example could explain the use-case this proposal is trying to
> solve.

"... whenever ODP has overwritten it." If *implementation* overwrites it, it 
calls init before passing it back to app.


> > +                                   1: User area content must remain
> constant
> > +                                      when packet is stored in the
> pool. If
> > +                                      init callback function is
> defined, it is
> > +                                      called once in pool creation.
> > +                                      */
> 
> IMO, instead of specifying that the user-area remains constant we can
> specify that implementation does not modify the content when the
> buffer is returned and reallocated from the pool.

API spec is from application point of view. App sees that all bytes have 
remained the same while the packet was in the pool. Of course implementation 
can store entire area, overwrite and restore it before returning the packet 
back to the app.

Another word can be used, but "constant" is application view.

-Petri

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to