net/dpaa2: enable Tx congestion state check

For larger packet size congestion is observed on Tx Queues.
This patch enables Tx Queue congestion state check support.
If congested, try to resend the packet few times.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
This commit is contained in:
Hemant Agrawal 2017-07-24 13:01:46 +05:30 committed by Thomas Monjalon
parent a2c0df7503
commit a084096398
3 changed files with 12 additions and 5 deletions

View File

@ -488,7 +488,7 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
}
dpaa2_q->tc_index = tc_id;
if (priv->flags & DPAA2_TX_CGR_SUPPORT) {
if (!(priv->flags & DPAA2_TX_CGR_OFF)) {
struct dpni_congestion_notification_cfg cong_notif_cfg;
cong_notif_cfg.units = DPNI_CONGESTION_UNIT_FRAMES;

View File

@ -55,6 +55,8 @@
*/
#define CONG_EXIT_TX_THRESHOLD 480
#define CONG_RETRY_COUNT 18000
/* RX queue tail drop threshold
* currently considering 32 KB packets
*/
@ -66,7 +68,7 @@
/* Enable TX Congestion control support
* default is disable
*/
#define DPAA2_TX_CGR_SUPPORT 0x01
#define DPAA2_TX_CGR_OFF 0x01
/* Disable RX tail drop, default is enable */
#define DPAA2_RX_TAILDROP_OFF 0x04

View File

@ -524,7 +524,7 @@ uint16_t
dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
{
/* Function to transmit the frames to given device and VQ*/
uint32_t loop;
uint32_t loop, retry_count;
int32_t ret;
struct qbman_fd fd_arr[MAX_TX_RING_SLOTS];
struct rte_mbuf *mi;
@ -559,8 +559,13 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
/*Clear the unused FD fields before sending*/
while (nb_pkts) {
/*Check if the queue is congested*/
if (qbman_result_SCN_state_in_mem(dpaa2_q->cscn))
goto skip_tx;
retry_count = 0;
if (qbman_result_SCN_state_in_mem(dpaa2_q->cscn)) {
retry_count++;
/* Retry for some time before giving up */
if (retry_count > CONG_RETRY_COUNT)
goto skip_tx;
}
frames_to_send = (nb_pkts >> 3) ? MAX_TX_RING_SLOTS : nb_pkts;