net/dpaa2: support using Tx queue descriptor size
[dpdk.git] / drivers / net / dpaa2 / dpaa2_ethdev.c
index e805ed7..b58add9 100644 (file)
@@ -643,7 +643,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev,
                         uint16_t rx_queue_id,
                         uint16_t nb_rx_desc,
                         unsigned int socket_id __rte_unused,
-                        const struct rte_eth_rxconf *rx_conf __rte_unused,
+                        const struct rte_eth_rxconf *rx_conf,
                         struct rte_mempool *mb_pool)
 {
        struct dpaa2_dev_priv *priv = dev->data->dev_private;
@@ -660,6 +660,13 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev,
        DPAA2_PMD_DEBUG("dev =%p, queue =%d, pool = %p, conf =%p",
                        dev, rx_queue_id, mb_pool, rx_conf);
 
+       /* Rx deferred start is not supported */
+       if (rx_conf->rx_deferred_start) {
+               DPAA2_PMD_ERR("%p:Rx deferred start not supported",
+                               (void *)dev);
+               return -EINVAL;
+       }
+
        if (!priv->bp_list || priv->bp_list->mp != mb_pool) {
                bpid = mempool_to_bpid(mb_pool);
                ret = dpaa2_attach_bp_list(priv,
@@ -786,9 +793,9 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev,
 static int
 dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
                         uint16_t tx_queue_id,
-                        uint16_t nb_tx_desc __rte_unused,
+                        uint16_t nb_tx_desc,
                         unsigned int socket_id __rte_unused,
-                        const struct rte_eth_txconf *tx_conf __rte_unused)
+                        const struct rte_eth_txconf *tx_conf)
 {
        struct dpaa2_dev_priv *priv = dev->data->dev_private;
        struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)
@@ -805,6 +812,13 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
        PMD_INIT_FUNC_TRACE();
 
+       /* Tx deferred start is not supported */
+       if (tx_conf->tx_deferred_start) {
+               DPAA2_PMD_ERR("%p:Tx deferred start not supported",
+                               (void *)dev);
+               return -EINVAL;
+       }
+
        /* Return if queue already configured */
        if (dpaa2_q->flow_id != 0xffff) {
                dev->data->tx_queues[tx_queue_id] = dpaa2_q;
@@ -859,11 +873,11 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
                struct dpni_congestion_notification_cfg cong_notif_cfg = {0};
 
                cong_notif_cfg.units = DPNI_CONGESTION_UNIT_FRAMES;
-               cong_notif_cfg.threshold_entry = CONG_ENTER_TX_THRESHOLD;
+               cong_notif_cfg.threshold_entry = nb_tx_desc;
                /* Notify that the queue is not congested when the data in
                 * the queue is below this thershold.
                 */
-               cong_notif_cfg.threshold_exit = CONG_EXIT_TX_THRESHOLD;
+               cong_notif_cfg.threshold_exit = nb_tx_desc - 24;
                cong_notif_cfg.message_ctx = 0;
                cong_notif_cfg.message_iova =
                                (size_t)DPAA2_VADDR_TO_IOVA(dpaa2_q->cscn);