net/dpaa2: use LFQIDs in Tx instead of QDID
authorSachin Saxena <sachin.saxena@nxp.com>
Thu, 29 Aug 2019 10:27:26 +0000 (15:57 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 8 Oct 2019 10:14:31 +0000 (12:14 +0200)
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
drivers/net/dpaa2/dpaa2_ethdev.c
drivers/net/dpaa2/dpaa2_rxtx.c

index d0e4d06..dcad180 100644 (file)
@@ -679,6 +679,7 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
        struct dpni_queue tx_conf_cfg;
        struct dpni_queue tx_flow_cfg;
        uint8_t options = 0, flow_id;
+       struct dpni_queue_id qid;
        uint32_t tc_id;
        int ret;
 
@@ -720,6 +721,15 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
        }
        dpaa2_q->tc_index = tc_id;
 
+       ret = dpni_get_queue(dpni, CMD_PRI_LOW, priv->token,
+                            DPNI_QUEUE_TX, dpaa2_q->tc_index,
+                            dpaa2_q->flow_id, &tx_flow_cfg, &qid);
+       if (ret) {
+               DPAA2_PMD_ERR("Error in getting LFQID err=%d", ret);
+               return -1;
+       }
+       dpaa2_q->fqid = qid.fqid;
+
        if (!(priv->flags & DPAA2_TX_CGR_OFF)) {
                struct dpni_congestion_notification_cfg cong_notif_cfg = {0};
 
index 1983818..2209b78 100644 (file)
@@ -869,8 +869,8 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
        /*Prepare enqueue descriptor*/
        qbman_eq_desc_clear(&eqdesc);
        qbman_eq_desc_set_no_orp(&eqdesc, DPAA2_EQ_RESP_ERR_FQ);
-       qbman_eq_desc_set_qd(&eqdesc, priv->qdid,
-                            dpaa2_q->flow_id, dpaa2_q->tc_index);
+       qbman_eq_desc_set_fq(&eqdesc, dpaa2_q->fqid);
+
        /*Clear the unused FD fields before sending*/
        while (nb_pkts) {
                /*Check if the queue is congested*/
@@ -1021,8 +1021,7 @@ dpaa2_set_enqueue_descriptor(struct dpaa2_queue *dpaa2_q,
        uint16_t orpid, seqnum;
        uint8_t dq_idx;
 
-       qbman_eq_desc_set_qd(eqdesc, priv->qdid, dpaa2_q->flow_id,
-                            dpaa2_q->tc_index);
+       qbman_eq_desc_set_fq(eqdesc, dpaa2_q->fqid);
 
        if (m->seqn & DPAA2_ENQUEUE_FLAG_ORP) {
                orpid = (m->seqn & DPAA2_EQCR_OPRID_MASK) >>
@@ -1128,9 +1127,8 @@ dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
                        } else {
                                qbman_eq_desc_set_no_orp(&eqdesc[loop],
                                                         DPAA2_EQ_RESP_ERR_FQ);
-                               qbman_eq_desc_set_qd(&eqdesc[loop], priv->qdid,
-                                                    dpaa2_q->flow_id,
-                                                    dpaa2_q->tc_index);
+                               qbman_eq_desc_set_fq(&eqdesc[loop],
+                                                    dpaa2_q->fqid);
                        }
 
                        if (likely(RTE_MBUF_DIRECT(*bufs))) {