Imported Upstream version 17.05
[deb_dpdk.git] / drivers / mempool / ring / rte_mempool_ring.c
similarity index 92%
rename from lib/librte_mempool/rte_mempool_ring.c
rename to drivers/mempool/ring/rte_mempool_ring.c
index b9aa64d..5c132bf 100644 (file)
@@ -42,26 +42,30 @@ static int
 common_ring_mp_enqueue(struct rte_mempool *mp, void * const *obj_table,
                unsigned n)
 {
-       return rte_ring_mp_enqueue_bulk(mp->pool_data, obj_table, n);
+       return rte_ring_mp_enqueue_bulk(mp->pool_data,
+                       obj_table, n, NULL) == 0 ? -ENOBUFS : 0;
 }
 
 static int
 common_ring_sp_enqueue(struct rte_mempool *mp, void * const *obj_table,
                unsigned n)
 {
-       return rte_ring_sp_enqueue_bulk(mp->pool_data, obj_table, n);
+       return rte_ring_sp_enqueue_bulk(mp->pool_data,
+                       obj_table, n, NULL) == 0 ? -ENOBUFS : 0;
 }
 
 static int
 common_ring_mc_dequeue(struct rte_mempool *mp, void **obj_table, unsigned n)
 {
-       return rte_ring_mc_dequeue_bulk(mp->pool_data, obj_table, n);
+       return rte_ring_mc_dequeue_bulk(mp->pool_data,
+                       obj_table, n, NULL) == 0 ? -ENOBUFS : 0;
 }
 
 static int
 common_ring_sc_dequeue(struct rte_mempool *mp, void **obj_table, unsigned n)
 {
-       return rte_ring_sc_dequeue_bulk(mp->pool_data, obj_table, n);
+       return rte_ring_sc_dequeue_bulk(mp->pool_data,
+                       obj_table, n, NULL) == 0 ? -ENOBUFS : 0;
 }
 
 static unsigned