Thanks Honnappa, will work on the changes suggested.
> -----Original Message----- > From: Honnappa Nagarahalli <honnappa.nagaraha...@arm.com> > Sent: Tuesday, June 11, 2019 9:48 AM > To: Varghese, Vipin <vipin.vargh...@intel.com>; olivier.m...@6wind.com; > Pattan, Reshma <reshma.pat...@intel.com>; Wiles, Keith > <keith.wi...@intel.com>; dev@dpdk.org > Cc: Padubidri, Sanjay A <sanjay.padubi...@intel.com>; Honnappa Nagarahalli > <honnappa.nagaraha...@arm.com>; nd <n...@arm.com>; nd <n...@arm.com> > Subject: RE: [dpdk-dev] [PATCH v1 1/2] lib/ring: add enqueue-dequeue callabck > > > > > Hi Honnappa, > > > > snipped > > > > > > > > Add callback event handler for enqueue dequeue operation on ring. > > > > The pre-enqueue and post-dequeue operation on ring is selected to > > > > invoke user callback handler. > > > Can you provide a use case for this to better understand the need? > > Use cases: > > - allow user to investigate the contents pre-enqueue. > > - allow user to investigate the contents post-dequeue. > > - modify pre-enqueue and post-dequeue stage content. > > - investigate PMD meta data for debug in field nodes. > > > > snipped > > > > + struct rte_ring_enq_cb_list enq_cbs; > > > > + struct rte_ring_deq_cb_list deq_cbs; }; > > > This breaks ABI compatibility > > Can you help me understand this more clearly? > 'struct rte_ring' is exposed to the application. It is possible that the > application has > declared a variable of type 'struct rte_ring'. Any addition to this structure > will > increase the size of 'struct rte_ring'. Hence, it won't be compatible. > > > > > snipped > > > > -rte_ring_enqueue_burst(struct rte_ring *r, void * const > > > > *obj_table, > > > > +rte_ring_enqueue_burst(struct rte_ring *r, void **obj_table, > > > > unsigned int n, unsigned int *free_space) { > > > > +#ifdef RTE_RING_ENQDEQ_CALLBACKS > > > > + struct rte_ring_callback *cb = NULL; > > > > + > > > > + TAILQ_FOREACH(cb, &(r->enq_cbs), next) { > > > Need to take the TAILQ lock before this. For ex: what happens if a > > > un-register is called concurrently? > > Let me check this, using rx|tx callback as reference. > > > > > Also, traversing a linked list for every enqueue call would be too > > > costly. May be, understanding the use case will help. > > Internal testing with SP-SC is 0.1% (with extra cost of user > > function). But I will try to explore other alternatives too. > > > > Snipped