ring: return free space when enqueuing
[dpdk.git] / lib / librte_port / rte_port_ring.c
index 0df1bcf..c5dbe07 100644 (file)
@@ -241,7 +241,7 @@ send_burst(struct rte_port_ring_writer *p)
        uint32_t nb_tx;
 
        nb_tx = rte_ring_sp_enqueue_burst(p->ring, (void **)p->tx_buf,
-                       p->tx_buf_count);
+                       p->tx_buf_count, NULL);
 
        RTE_PORT_RING_WRITER_STATS_PKTS_DROP_ADD(p, p->tx_buf_count - nb_tx);
        for ( ; nb_tx < p->tx_buf_count; nb_tx++)
@@ -256,7 +256,7 @@ send_burst_mp(struct rte_port_ring_writer *p)
        uint32_t nb_tx;
 
        nb_tx = rte_ring_mp_enqueue_burst(p->ring, (void **)p->tx_buf,
-                       p->tx_buf_count);
+                       p->tx_buf_count, NULL);
 
        RTE_PORT_RING_WRITER_STATS_PKTS_DROP_ADD(p, p->tx_buf_count - nb_tx);
        for ( ; nb_tx < p->tx_buf_count; nb_tx++)
@@ -318,11 +318,11 @@ rte_port_ring_writer_tx_bulk_internal(void *port,
 
                RTE_PORT_RING_WRITER_STATS_PKTS_IN_ADD(p, n_pkts);
                if (is_multi)
-                       n_pkts_ok = rte_ring_mp_enqueue_burst(p->ring, (void **)pkts,
-                               n_pkts);
+                       n_pkts_ok = rte_ring_mp_enqueue_burst(p->ring,
+                                       (void **)pkts, n_pkts, NULL);
                else
-                       n_pkts_ok = rte_ring_sp_enqueue_burst(p->ring, (void **)pkts,
-                               n_pkts);
+                       n_pkts_ok = rte_ring_sp_enqueue_burst(p->ring,
+                                       (void **)pkts, n_pkts, NULL);
 
                RTE_PORT_RING_WRITER_STATS_PKTS_DROP_ADD(p, n_pkts - n_pkts_ok);
                for ( ; n_pkts_ok < n_pkts; n_pkts_ok++) {
@@ -517,7 +517,7 @@ send_burst_nodrop(struct rte_port_ring_writer_nodrop *p)
        uint32_t nb_tx = 0, i;
 
        nb_tx = rte_ring_sp_enqueue_burst(p->ring, (void **)p->tx_buf,
-                               p->tx_buf_count);
+                               p->tx_buf_count, NULL);
 
        /* We sent all the packets in a first try */
        if (nb_tx >= p->tx_buf_count) {
@@ -527,7 +527,8 @@ send_burst_nodrop(struct rte_port_ring_writer_nodrop *p)
 
        for (i = 0; i < p->n_retries; i++) {
                nb_tx += rte_ring_sp_enqueue_burst(p->ring,
-                               (void **) (p->tx_buf + nb_tx), p->tx_buf_count - nb_tx);
+                               (void **) (p->tx_buf + nb_tx),
+                               p->tx_buf_count - nb_tx, NULL);
 
                /* We sent all the packets in more than one try */
                if (nb_tx >= p->tx_buf_count) {
@@ -550,7 +551,7 @@ send_burst_mp_nodrop(struct rte_port_ring_writer_nodrop *p)
        uint32_t nb_tx = 0, i;
 
        nb_tx = rte_ring_mp_enqueue_burst(p->ring, (void **)p->tx_buf,
-                               p->tx_buf_count);
+                               p->tx_buf_count, NULL);
 
        /* We sent all the packets in a first try */
        if (nb_tx >= p->tx_buf_count) {
@@ -560,7 +561,8 @@ send_burst_mp_nodrop(struct rte_port_ring_writer_nodrop *p)
 
        for (i = 0; i < p->n_retries; i++) {
                nb_tx += rte_ring_mp_enqueue_burst(p->ring,
-                               (void **) (p->tx_buf + nb_tx), p->tx_buf_count - nb_tx);
+                               (void **) (p->tx_buf + nb_tx),
+                               p->tx_buf_count - nb_tx, NULL);
 
                /* We sent all the packets in more than one try */
                if (nb_tx >= p->tx_buf_count) {
@@ -633,10 +635,12 @@ rte_port_ring_writer_nodrop_tx_bulk_internal(void *port,
                RTE_PORT_RING_WRITER_NODROP_STATS_PKTS_IN_ADD(p, n_pkts);
                if (is_multi)
                        n_pkts_ok =
-                               rte_ring_mp_enqueue_burst(p->ring, (void **)pkts, n_pkts);
+                               rte_ring_mp_enqueue_burst(p->ring,
+                                               (void **)pkts, n_pkts, NULL);
                else
                        n_pkts_ok =
-                               rte_ring_sp_enqueue_burst(p->ring, (void **)pkts, n_pkts);
+                               rte_ring_sp_enqueue_burst(p->ring,
+                                               (void **)pkts, n_pkts, NULL);
 
                if (n_pkts_ok >= n_pkts)
                        return 0;