ring: create common structure for prod and cons metadata
[dpdk.git] / lib / librte_port / rte_port_ring.c
index d36e12d..0df1bcf 100644 (file)
@@ -73,8 +73,8 @@ rte_port_ring_reader_create_internal(void *params, int socket_id,
        /* Check input parameters */
        if ((conf == NULL) ||
                (conf->ring == NULL) ||
-               (conf->ring->cons.sc_dequeue && is_multi) ||
-               (!(conf->ring->cons.sc_dequeue) && !is_multi)) {
+               (conf->ring->cons.single && is_multi) ||
+               (!(conf->ring->cons.single) && !is_multi)) {
                RTE_LOG(ERR, PORT, "%s: Invalid Parameters\n", __func__);
                return NULL;
        }
@@ -179,7 +179,7 @@ rte_port_ring_reader_stats_read(void *port,
 struct rte_port_ring_writer {
        struct rte_port_out_stats stats;
 
-       struct rte_mbuf *tx_buf[RTE_PORT_IN_BURST_SIZE_MAX];
+       struct rte_mbuf *tx_buf[2 * RTE_PORT_IN_BURST_SIZE_MAX];
        struct rte_ring *ring;
        uint32_t tx_burst_sz;
        uint32_t tx_buf_count;
@@ -198,8 +198,8 @@ rte_port_ring_writer_create_internal(void *params, int socket_id,
        /* Check input parameters */
        if ((conf == NULL) ||
                (conf->ring == NULL) ||
-               (conf->ring->prod.sp_enqueue && is_multi) ||
-               (!(conf->ring->prod.sp_enqueue) && !is_multi) ||
+               (conf->ring->prod.single && is_multi) ||
+               (!(conf->ring->prod.single) && !is_multi) ||
                (conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX)) {
                RTE_LOG(ERR, PORT, "%s: Invalid Parameters\n", __func__);
                return NULL;
@@ -447,7 +447,7 @@ rte_port_ring_writer_stats_read(void *port,
 struct rte_port_ring_writer_nodrop {
        struct rte_port_out_stats stats;
 
-       struct rte_mbuf *tx_buf[RTE_PORT_IN_BURST_SIZE_MAX];
+       struct rte_mbuf *tx_buf[2 * RTE_PORT_IN_BURST_SIZE_MAX];
        struct rte_ring *ring;
        uint32_t tx_burst_sz;
        uint32_t tx_buf_count;
@@ -467,8 +467,8 @@ rte_port_ring_writer_nodrop_create_internal(void *params, int socket_id,
        /* Check input parameters */
        if ((conf == NULL) ||
                (conf->ring == NULL) ||
-               (conf->ring->prod.sp_enqueue && is_multi) ||
-               (!(conf->ring->prod.sp_enqueue) && !is_multi) ||
+               (conf->ring->prod.single && is_multi) ||
+               (!(conf->ring->prod.single) && !is_multi) ||
                (conf->tx_burst_sz > RTE_PORT_IN_BURST_SIZE_MAX)) {
                RTE_LOG(ERR, PORT, "%s: Invalid Parameters\n", __func__);
                return NULL;