net/dpaa2: support 16 Rx queues per traffic class
authorAshish Jain <ashish.jain@nxp.com>
Fri, 22 Feb 2019 11:16:02 +0000 (11:16 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 1 Mar 2019 17:17:35 +0000 (18:17 +0100)
Adding support for 16 queues per TC per DPNI port
which is required for LX2 platform.

Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
drivers/net/dpaa2/dpaa2_ethdev.c
drivers/net/dpaa2/dpaa2_ethdev.h

index 0ab43ca..f8c2983 100644 (file)
@@ -266,6 +266,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev)
        struct dpaa2_dev_priv *priv = dev->data->dev_private;
        uint16_t dist_idx;
        uint32_t vq_id;
+       uint8_t num_rxqueue_per_tc;
        struct dpaa2_queue *mc_q, *mcq;
        uint32_t tot_queues;
        int i;
@@ -273,6 +274,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev)
 
        PMD_INIT_FUNC_TRACE();
 
+       num_rxqueue_per_tc = (priv->nb_rx_queues / priv->num_rx_tc);
        tot_queues = priv->nb_rx_queues + priv->nb_tx_queues;
        mc_q = rte_malloc(NULL, sizeof(struct dpaa2_queue) * tot_queues,
                          RTE_CACHE_LINE_SIZE);
@@ -311,8 +313,8 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev)
        vq_id = 0;
        for (dist_idx = 0; dist_idx < priv->nb_rx_queues; dist_idx++) {
                mcq = (struct dpaa2_queue *)priv->rx_vq[vq_id];
-               mcq->tc_index = DPAA2_DEF_TC;
-               mcq->flow_id = dist_idx;
+               mcq->tc_index = dist_idx / num_rxqueue_per_tc;
+               mcq->flow_id = dist_idx % num_rxqueue_per_tc;
                vq_id++;
        }
 
index 313cbe4..13259be 100644 (file)
@@ -20,7 +20,7 @@
 #define DPAA2_MAX_RX_PKT_LEN  10240 /*WRIOP support*/
 
 #define MAX_TCS                        DPNI_MAX_TC
-#define MAX_RX_QUEUES          16
+#define MAX_RX_QUEUES          128
 #define MAX_TX_QUEUES          16
 
 /*default tc to be used for ,congestion, distribution etc configuration. */