Browse Source

qcacld-3.0: Cleanup fastpath changes

Do following cleanup on fastpath code changes:
1) Remove reaping of Tx HIF buffers in Rx handling, instead handle
   reaping in Tx fastpath itself.
2) In ce_per_engine_service_fast check for more Rx packets after
   packet processing.
3) Make stub functions as static inline for non-fastpath enabled case.

Change-Id: If07c4344a424ce13b94128bf28931a24255b661a
CRs-Fixed: 987182
Manjunathappa Prakash 9 years ago
parent
commit
585178db34
5 changed files with 24 additions and 30 deletions
  1. 2 4
      core/dp/htt/htt.c
  2. 10 2
      core/dp/htt/htt_internal.h
  3. 11 22
      core/dp/htt/htt_t2h.c
  4. 0 2
      core/hdd/src/wlan_hdd_main.c
  5. 1 0
      uapi/linux/osapi_linux.h

+ 2 - 4
core/dp/htt/htt.c

@@ -195,6 +195,8 @@ htt_pdev_alloc(ol_txrx_pdev_handle txrx_pdev,
 #ifndef AR6004_HW
 	if (htt_htc_attach(pdev))
 		goto fail2;
+	if (hif_ce_fastpath_cb_register(htt_t2h_msg_handler_fast, pdev))
+		qdf_print("failed to register fastpath callback\n");
 #endif
 
 	return pdev;
@@ -397,10 +399,6 @@ int htt_htc_attach(struct htt_pdev_t *pdev)
 	HTC_SERVICE_CONNECT_RESP response;
 	A_STATUS status;
 
-	if (QDF_STATUS_SUCCESS !=
-	    hif_ce_fastpath_cb_register(htt_t2h_msg_handler_fast, pdev))
-		qdf_print("failed to register fastpath callback\n");
-
 	qdf_mem_set(&connect, sizeof(connect), 0);
 	qdf_mem_set(&response, sizeof(response), 0);
 

+ 10 - 2
core/dp/htt/htt_internal.h

@@ -431,8 +431,16 @@ void htt_rx_detach(struct htt_pdev_t *pdev);
 int htt_htc_attach(struct htt_pdev_t *pdev);
 
 void htt_t2h_msg_handler(void *context, HTC_PACKET *pkt);
-int htt_t2h_msg_handler_fast(void *htt_pdev, qdf_nbuf_t *cmpl_msdus,
-			     uint32_t num_cmpls);
+#ifdef WLAN_FEATURE_FASTPATH
+void htt_t2h_msg_handler_fast(void *htt_pdev, qdf_nbuf_t *cmpl_msdus,
+			      uint32_t num_cmpls);
+#else
+static inline void htt_t2h_msg_handler_fast(void *htt_pdev,
+					   qdf_nbuf_t *cmpl_msdus,
+					   uint32_t num_cmpls)
+{
+}
+#endif
 
 void htt_h2t_send_complete(void *context, HTC_PACKET *pkt);
 

+ 11 - 22
core/dp/htt/htt_t2h.c

@@ -44,7 +44,6 @@
 #include <ol_htt_tx_api.h>
 #include <ol_txrx_htt_api.h>    /* htt_tx_status */
 
-#include <osdep.h>
 #include <htt_internal.h>       /* HTT_TX_SCHED, etc. */
 #include <pktlog_ac_fmt.h>
 #include <wdi_event.h>
@@ -133,8 +132,8 @@ static void htt_rx_frag_set_last_msdu(struct htt_pdev_t *pdev, qdf_nbuf_t msg)
 }
 
 /* Target to host Msg/event  handler  for low priority messages*/
-void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg, bool
-			    free_msg_buf)
+void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg,
+			    bool free_msg_buf)
 {
 	struct htt_pdev_t *pdev = (struct htt_pdev_t *)context;
 	uint32_t *msg_word;
@@ -698,10 +697,11 @@ void htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
 		QDF_NBUF_CB_PADDR(_buf) -= (HTC_HEADER_LEN +		\
 					HTC_HDR_ALIGNMENT_PADDING);	\
 		qdf_nbuf_init_fast((_buf));				\
-		OS_SYNC_SINGLE_FOR_DEVICE(dev, (QDF_NBUF_CB_PADDR(_buf)),	\
-					  (skb_end_pointer(_buf) -	\
-					   (_buf)->data) ,		\
-					   PCI_DMA_FROMDEVICE);         \
+		qdf_mem_dma_sync_single_for_device(dev,			\
+					(QDF_NBUF_CB_PADDR(_buf)),	\
+					(skb_end_pointer(_buf) -	\
+					(_buf)->data) ,			\
+					PCI_DMA_FROMDEVICE);		\
 	} while (0)
 
 /**
@@ -710,11 +710,10 @@ void htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
  * @cmpl_msdus: netbuf completions
  * @num_cmpls: number of completions to be handled
  *
- * Return: Number of completions handled
+ * Return: None
  */
-int
-htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus,
-			 uint32_t num_cmpls)
+void htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus,
+			      uint32_t num_cmpls)
 {
 	struct htt_pdev_t *pdev = (struct htt_pdev_t *)context;
 	qdf_nbuf_t htt_t2h_msg;
@@ -722,7 +721,6 @@ htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus,
 	uint32_t i;
 	enum htt_t2h_msg_type msg_type;
 	uint32_t msg_len;
-	uint32_t num_htt_tx_cmpls = 0;
 
 	for (i = 0; i < num_cmpls; i++) {
 		htt_t2h_msg = cmpl_msdus[i];
@@ -807,7 +805,6 @@ htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus,
 			ol_tx_completion_handler(pdev->txrx_pdev, num_msdus,
 						 status, msg_word + 1);
 
-			num_htt_tx_cmpls += SLOTS_PER_TX;
 			break;
 		}
 		case HTT_T2H_MSG_TYPE_RX_PN_IND:
@@ -866,7 +863,6 @@ htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus,
 			}
 			ol_tx_inspect_handler(pdev->txrx_pdev,
 					      num_msdus, msg_word + 1);
-			num_htt_tx_cmpls += SLOTS_PER_TX;
 			break;
 		}
 		case HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND:
@@ -915,16 +911,9 @@ htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus,
 		};
 
 		/* Re-initialize the indication buffer */
-		HTT_T2H_MSG_BUF_REINIT(htt_t2h_msg, pdev->osdev->dev);
+		HTT_T2H_MSG_BUF_REINIT(htt_t2h_msg, pdev->osdev);
 		qdf_nbuf_set_pktlen(htt_t2h_msg, 0);
 	}
-	return num_htt_tx_cmpls;
-}
-#else
-int htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus,
-			     uint32_t num_cmpls)
-{
-	return 0;
 }
 #endif /* WLAN_FEATURE_FASTPATH */
 

+ 0 - 2
core/hdd/src/wlan_hdd_main.c

@@ -5609,8 +5609,6 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
 	if (IS_ERR(hdd_ctx))
 		return PTR_ERR(hdd_ctx);
 
-	hif_update_fastpath_recv_bufs_cnt(hif_sc);
-
 	if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
 		ret = hdd_enable_ftm(hdd_ctx);
 

+ 1 - 0
uapi/linux/osapi_linux.h

@@ -231,6 +231,7 @@ void a_netbuf_queue_init(A_NETBUF_QUEUE_T *q);
 #include "ath_carr_pltfrm.h"
 #endif /* QCA_PARTNER_PLATFORM */
 
+#define SLOTS_PER_DATAPATH_TX 2
 #else                           /* __KERNEL__ */
 
 #ifdef __GNUC__