Comment 10 for bug 1765162

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/43939
Committed: http://github.com/Juniper/contrail-vrouter/commit/4db65eb46bacc78d264ac6239b665720cb93b3b8
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 4db65eb46bacc78d264ac6239b665720cb93b3b8
Author: Yi Yang <email address hidden>
Date: Tue Jun 19 08:21:08 2018 +0800

Fix nombufs issue in DPDK 17.11

DPDK API rte_ring_sp_enqueue_bulk and rte_ring_mp_enqueue_bulk have
change against its return value, 0 and -ERRORNUM mean success and
error respectively before DPDK 17.05, but return value is 0 or n
after DPDK 17.05 (including 17.05), 0 and n mean error and success
respectively. Details are as below:

/**
* Enqueue several objects on the ring (multi-producers safe).
*
* This function uses a "compare and set" instruction to move the
* producer index atomically.
*
* @param r
* A pointer to the ring structure.
* @param obj_table
* A pointer to a table of void * pointers (objects).
* @param n
* The number of objects to add in the ring from the obj_table.
* @param free_space
* if non-NULL, returns the amount of space in the ring after the
* enqueue operation has finished.
* @return
* The number of objects enqueued, either 0 or n
*/
static __rte_always_inline unsigned int
rte_ring_mp_enqueue_bulk(struct rte_ring *r, void * const *obj_table,
unsigned int n, unsigned int *free_space)

Previous code can work if no enqueue failure, this is why we can't
reproduce nombufs issue.

Closes-Bug: #1765162
Change-Id: Ieb48e216ca8136a8127d4dbaf33b999a181e09f7
Signed-off-by: Yi Yang <email address hidden>