From 6d22eeb468b273b5a9698903f598956c86202865 Mon Sep 17 00:00:00 2001 From: Mohit Khanna Date: Sat, 6 Apr 2019 22:51:26 -0700 Subject: [PATCH] qcacmn: Tx desc alloc: remove default wakeup action When the status is FLOW_POOL_ACTIVE_PAUSED, all queues are expected to be paused. Still some on the fly packet can make it to the driver. In such a case, the function dp_tx_desc_alloc takes a default action of WLAN_WAKE_NON_PRIORITY_QUEUE. This is incorrect, since it will wake all non priority queues, when they should be paused. Make default action as WLAN_NETIF_ACTION_TYPE_NONE. If this is the action to be taken, donot call the pause_cb from dp_tx_desc_alloc. Rate limit log levels in case dp_tx_desc_alloc fails. Change-Id: I1ef3018e90576d2c3aaa0d10d56e9b155681271b CRs-Fixed: 2421813 --- dp/inc/cdp_txrx_mob_def.h | 35 ++++++++++++++++++----------------- dp/wifi3.0/dp_tx.c | 5 ++--- dp/wifi3.0/dp_tx_desc.h | 22 +++++++++++++--------- 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/dp/inc/cdp_txrx_mob_def.h b/dp/inc/cdp_txrx_mob_def.h index ba7e994ae7..eeacb36956 100644 --- a/dp/inc/cdp_txrx_mob_def.h +++ b/dp/inc/cdp_txrx_mob_def.h @@ -84,24 +84,25 @@ * @WLAN_STOP_NON_PRIORITY_QUEUE: stop non priority netif queues */ enum netif_action_type { + WLAN_NETIF_ACTION_TYPE_NONE = 0, WLAN_STOP_ALL_NETIF_QUEUE = 1, - WLAN_START_ALL_NETIF_QUEUE, - WLAN_WAKE_ALL_NETIF_QUEUE, - WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER, - WLAN_START_ALL_NETIF_QUEUE_N_CARRIER, - WLAN_NETIF_TX_DISABLE, - WLAN_NETIF_TX_DISABLE_N_CARRIER, - WLAN_NETIF_CARRIER_ON, - WLAN_NETIF_CARRIER_OFF, - WLAN_NETIF_PRIORITY_QUEUE_ON, - WLAN_NETIF_PRIORITY_QUEUE_OFF, - WLAN_NETIF_VO_QUEUE_ON, - WLAN_NETIF_VO_QUEUE_OFF, - WLAN_NETIF_VI_QUEUE_ON, - WLAN_NETIF_VI_QUEUE_OFF, - WLAN_NETIF_BE_BK_QUEUE_OFF, - WLAN_WAKE_NON_PRIORITY_QUEUE, - WLAN_STOP_NON_PRIORITY_QUEUE, + WLAN_START_ALL_NETIF_QUEUE = 2, + WLAN_WAKE_ALL_NETIF_QUEUE = 3, + WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER = 4, + WLAN_START_ALL_NETIF_QUEUE_N_CARRIER = 5, + WLAN_NETIF_TX_DISABLE = 6, + WLAN_NETIF_TX_DISABLE_N_CARRIER = 7, + WLAN_NETIF_CARRIER_ON = 8, + WLAN_NETIF_CARRIER_OFF = 9, + WLAN_NETIF_PRIORITY_QUEUE_ON = 10, + WLAN_NETIF_PRIORITY_QUEUE_OFF = 11, + WLAN_NETIF_VO_QUEUE_ON = 12, + WLAN_NETIF_VO_QUEUE_OFF = 13, + WLAN_NETIF_VI_QUEUE_ON = 14, + WLAN_NETIF_VI_QUEUE_OFF = 15, + WLAN_NETIF_BE_BK_QUEUE_OFF = 16, + WLAN_WAKE_NON_PRIORITY_QUEUE = 17, + WLAN_STOP_NON_PRIORITY_QUEUE = 18, WLAN_NETIF_ACTION_TYPE_MAX, }; diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 06f599c6b4..bab2b26813 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -1431,9 +1431,8 @@ static qdf_nbuf_t dp_tx_send_msdu_single(struct dp_vdev *vdev, qdf_nbuf_t nbuf, tx_desc = dp_tx_prepare_desc_single(vdev, nbuf, tx_q->desc_pool_id, msdu_info, tx_exc_metadata); if (!tx_desc) { - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - "%s Tx_desc prepare Fail vdev %pK queue %d", - __func__, vdev, tx_q->desc_pool_id); + dp_err_rl("Tx_desc prepare Fail vdev %pK queue %d", + vdev, tx_q->desc_pool_id); dp_tx_get_tid(vdev, nbuf, msdu_info); tid_stats = &pdev->stats.tid_stats.tid_tx_stats[msdu_info->tid]; tid_stats->swdrop_cnt[TX_DESC_ERR]++; diff --git a/dp/wifi3.0/dp_tx_desc.h b/dp/wifi3.0/dp_tx_desc.h index b1e08ac621..bd95de96cc 100644 --- a/dp/wifi3.0/dp_tx_desc.h +++ b/dp/wifi3.0/dp_tx_desc.h @@ -217,7 +217,7 @@ dp_tx_desc_alloc(struct dp_soc *soc, uint8_t desc_pool_id) struct dp_tx_desc_s *tx_desc = NULL; struct dp_tx_desc_pool_s *pool = &soc->tx_desc[desc_pool_id]; bool is_pause = false; - enum netif_action_type act = WLAN_WAKE_NON_PRIORITY_QUEUE; + enum netif_action_type act = WLAN_NETIF_ACTION_TYPE_NONE; enum dp_fl_ctrl_threshold level = DP_TH_BE_BK; if (qdf_likely(pool)) { @@ -255,18 +255,22 @@ dp_tx_desc_alloc(struct dp_soc *soc, uint8_t desc_pool_id) level = DP_TH_HI; pool->status = FLOW_POOL_ACTIVE_PAUSED; break; + case FLOW_POOL_ACTIVE_PAUSED: + act = WLAN_NETIF_ACTION_TYPE_NONE; + break; default: - QDF_TRACE(QDF_MODULE_ID_DP, - QDF_TRACE_LEVEL_ERROR, - "%s %d pool is %d status!", - __func__, __LINE__, + dp_err_rl("pool status is %d!", pool->status); break; } - pool->latest_pause_time[level] = - qdf_get_system_timestamp(); - soc->pause_cb(desc_pool_id, - act, WLAN_DATA_FLOW_CONTROL); + + if (act != WLAN_NETIF_ACTION_TYPE_NONE) { + pool->latest_pause_time[level] = + qdf_get_system_timestamp(); + soc->pause_cb(desc_pool_id, + act, + WLAN_DATA_FLOW_CONTROL); + } } } else { pool->pkt_drop_no_desc++;