net/dpaa2: fix congestion ID for multiple traffic classes
authorJun Yang <jun.yang@nxp.com>
Fri, 8 May 2020 13:02:09 +0000 (18:32 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 May 2020 20:27:39 +0000 (22:27 +0200)
When using a single TC, flow id is same as congestion group id.
However in case of multiple traffic classes, same flow id values
are used within each traffic class, which causes incorrect
traffic behavior e.g. halting of traffic.
This patches changes to use the cgid as the index which works
for single as well as multiple traffic classes.

Fixes: 13b856ac02a8 ("net/dpaa2: support taildrop on frame count basis")
Cc: stable@dpdk.org
Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
drivers/net/dpaa2/dpaa2_ethdev.c

index 08f9832..d9960b0 100644 (file)
@@ -669,7 +669,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev,
                                                DPNI_CP_CONGESTION_GROUP,
                                                DPNI_QUEUE_RX,
                                                dpaa2_q->tc_index,
-                                               flow_id, &taildrop);
+                                               dpaa2_q->cgid, &taildrop);
                } else {
                        /*enabling per rx queue congestion control */
                        taildrop.threshold = CONG_THRESHOLD_RX_BYTES_Q;
@@ -696,7 +696,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev,
                        ret = dpni_set_taildrop(dpni, CMD_PRI_LOW, priv->token,
                                        DPNI_CP_CONGESTION_GROUP, DPNI_QUEUE_RX,
                                        dpaa2_q->tc_index,
-                                       flow_id, &taildrop);
+                                       dpaa2_q->cgid, &taildrop);
                } else {
                        ret = dpni_set_taildrop(dpni, CMD_PRI_LOW, priv->token,
                                        DPNI_CP_QUEUE, DPNI_QUEUE_RX,