Browse Source

qcacmn: Add support in DP for enabling multiqueue support

Enable multiqueue on VAP with 4 Tx and Rx queues in lithium.

In Rx path set the rx queue of skb based on the reo ring id on which it
is received.

In Tx path use the queue_mapping of skb to map to the hardware Tx ring
on which it has to be transmitted.

Change-Id: I103a21e91d1ed5c0e1d8441863d4fcd273b7bed9
Prathyusha Guduri 7 years ago
parent
commit
02ed94801a
5 changed files with 55 additions and 16 deletions
  1. 2 0
      dp/wifi3.0/dp_rx.c
  2. 19 0
      dp/wifi3.0/dp_rx.h
  3. 3 0
      dp/wifi3.0/dp_rx_err.c
  4. 17 16
      dp/wifi3.0/dp_tx.c
  5. 14 0
      dp/wifi3.0/dp_tx_desc.h

+ 2 - 0
dp/wifi3.0/dp_rx.c

@@ -1560,6 +1560,8 @@ done:
 
 		dp_rx_cksum_offload(nbuf, rx_tlv_hdr);
 
+		dp_set_rx_queue(nbuf, ring_id);
+
 		/*
 		 * HW structures call this L3 header padding --
 		 * even though this is actually the offset from

+ 19 - 0
dp/wifi3.0/dp_rx.h

@@ -136,6 +136,25 @@ static inline uint32_t dp_rx_rotr(uint32_t val, int bits)
 	return (val >> bits) | (val << (32 - bits));
 }
 
+/*
+ * dp_set_rx_queue() - set queue_mapping in skb
+ * @nbuf: skb
+ * @queue_id: rx queue_id
+ *
+ * Return: void
+ */
+#ifdef QCA_OL_RX_MULTIQ_SUPPORT
+static inline void dp_set_rx_queue(qdf_nbuf_t nbuf, uint8_t queue_id)
+{
+	qdf_nbuf_record_rx_queue(nbuf, queue_id);
+	return;
+}
+#else
+static inline void dp_set_rx_queue(qdf_nbuf_t nbuf, uint8_t queue_id)
+{
+}
+#endif
+
 /*
  *dp_rx_xswap() - swap the bits left
  *@val: unsigned integer input value

+ 3 - 0
dp/wifi3.0/dp_rx_err.c

@@ -1130,6 +1130,9 @@ done:
 		 */
 		hal_rx_wbm_err_info_get_from_tlv(rx_tlv_hdr, &wbm_err_info);
 
+		/* Set queue_mapping in nbuf to 0 */
+		dp_set_rx_queue(nbuf, 0);
+
 		next = nbuf->next;
 		if (wbm_err_info.wbm_err_src == HAL_RX_WBM_ERR_SRC_REO) {
 			if (wbm_err_info.reo_psh_rsn

+ 17 - 16
dp/wifi3.0/dp_tx.c

@@ -30,22 +30,7 @@
 #include "if_meta_hdr.h"
 #endif
 
-#ifdef TX_PER_PDEV_DESC_POOL
-#ifdef QCA_LL_TX_FLOW_CONTROL_V2
-#define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->vdev_id)
-#else /* QCA_LL_TX_FLOW_CONTROL_V2 */
-#define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->pdev->pdev_id)
-#endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
-	#define DP_TX_GET_RING_ID(vdev) (vdev->pdev->pdev_id)
-#else
-	#ifdef TX_PER_VDEV_DESC_POOL
-		#define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->vdev_id)
-		#define DP_TX_GET_RING_ID(vdev) (vdev->pdev->pdev_id)
-	#else
-		#define DP_TX_GET_DESC_POOL_ID(vdev) qdf_get_cpu()
-		#define DP_TX_GET_RING_ID(vdev) vdev->pdev->soc->tx_ring_map[qdf_get_cpu()]
-	#endif /* TX_PER_VDEV_DESC_POOL */
-#endif /* TX_PER_PDEV_DESC_POOL */
+#define DP_TX_QUEUE_MASK 0x3
 
 /* TODO Add support in TSO */
 #define DP_DESC_NUM_FRAG(x) 0
@@ -88,6 +73,21 @@ static const uint8_t sec_type_map[MAX_CDP_SEC_TYPE] = {
  *
  * Return: None
  */
+#ifdef QCA_OL_TX_MULTIQ_SUPPORT
+static inline void dp_tx_get_queue(struct dp_vdev *vdev,
+		qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
+{
+	uint16_t queue_offset = qdf_nbuf_get_queue_mapping(nbuf) & DP_TX_QUEUE_MASK;
+	queue->desc_pool_id = queue_offset;
+	queue->ring_id = vdev->pdev->soc->tx_ring_map[queue_offset];
+
+	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
+			"%s, pool_id:%d ring_id: %d",
+			__func__, queue->desc_pool_id, queue->ring_id);
+
+	return;
+}
+#else /* QCA_OL_TX_MULTIQ_SUPPORT */
 static inline void dp_tx_get_queue(struct dp_vdev *vdev,
 		qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
 {
@@ -101,6 +101,7 @@ static inline void dp_tx_get_queue(struct dp_vdev *vdev,
 
 	return;
 }
+#endif
 
 #if defined(FEATURE_TSO)
 /**

+ 14 - 0
dp/wifi3.0/dp_tx_desc.h

@@ -23,6 +23,20 @@
 #include "dp_tx.h"
 #include "dp_internal.h"
 
+#ifdef TX_PER_PDEV_DESC_POOL
+#ifdef QCA_LL_TX_FLOW_CONTROL_V2
+#define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->vdev_id)
+#else /* QCA_LL_TX_FLOW_CONTROL_V2 */
+#define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->pdev->pdev_id)
+#endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
+	#define DP_TX_GET_RING_ID(vdev) (vdev->pdev->pdev_id)
+#else
+	#ifdef TX_PER_VDEV_DESC_POOL
+		#define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->vdev_id)
+		#define DP_TX_GET_RING_ID(vdev) (vdev->pdev->pdev_id)
+	#endif /* TX_PER_VDEV_DESC_POOL */
+#endif /* TX_PER_PDEV_DESC_POOL */
+
 /**
  * 21 bits cookie
  * 2 bits pool id 0 ~ 3,