瀏覽代碼

qcacmn: Change the buffer manager

Change the buffer manager from HAL_RX_BUF_RBM_SW3_BM to
HAL_RX_BUF_RBM_SW1_BM to handle regular and error packets.

Change-Id: I696d41f6cf0be1d5045ab27841ccc3ee2afea7de
CRs-Fixed: 2189452
Venkata Sharath Chandra Manchala 7 年之前
父節點
當前提交
16fcceb7de
共有 7 個文件被更改,包括 29 次插入25 次删除
  1. 1 2
      dp/wifi3.0/dp_main.c
  2. 6 8
      dp/wifi3.0/dp_rx.c
  3. 6 3
      dp/wifi3.0/dp_rx.h
  4. 1 1
      dp/wifi3.0/dp_rx_defrag.c
  5. 5 6
      dp/wifi3.0/dp_rx_err.c
  6. 8 5
      dp/wifi3.0/dp_rx_mon_dest.c
  7. 2 0
      dp/wifi3.0/dp_types.h

+ 1 - 2
dp/wifi3.0/dp_main.c

@@ -977,8 +977,7 @@ static uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget)
 				dp_rx_buffers_replenish(soc, mac_for_pdev,
 					rx_refill_buf_ring,
 					&soc->rx_desc_buf[mac_for_pdev], 0,
-					&desc_list, &tail,
-					HAL_RX_BUF_RBM_SW3_BM);
+					&desc_list, &tail);
 			}
 		}
 	}

+ 6 - 8
dp/wifi3.0/dp_rx.c

@@ -27,7 +27,6 @@
 #endif
 #include "dp_internal.h"
 #include "dp_rx_mon.h"
-
 #ifdef RX_DESC_DEBUG_CHECK
 static inline void dp_rx_desc_prep(struct dp_rx_desc *rx_desc, qdf_nbuf_t nbuf)
 {
@@ -69,7 +68,6 @@ static inline bool dp_rx_check_ap_bridge(struct dp_vdev *vdev)
  *	       or NULL during dp rx initialization or out of buffer
  *	       interrupt.
  * @tail: tail of descs list
- * @owner: who owns the nbuf (host, NSS etc...)
  * Return: return success or failure
  */
 QDF_STATUS dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,
@@ -77,8 +75,7 @@ QDF_STATUS dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,
 				struct rx_desc_pool *rx_desc_pool,
 				uint32_t num_req_buffers,
 				union dp_rx_desc_list_elem_t **desc_list,
-				union dp_rx_desc_list_elem_t **tail,
-				uint8_t owner)
+				union dp_rx_desc_list_elem_t **tail)
 {
 	uint32_t num_alloc_desc;
 	uint16_t num_desc_to_free = 0;
@@ -207,7 +204,7 @@ QDF_STATUS dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,
 
 		hal_rxdma_buff_addr_info_set(rxdma_ring_entry, paddr,
 						(*desc_list)->rx_desc.cookie,
-						owner);
+						rx_desc_pool->owner);
 
 		*desc_list = next;
 	}
@@ -1393,8 +1390,7 @@ done:
 
 		dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng,
 					rx_desc_pool, rx_bufs_reaped[mac_id],
-					&head[mac_id], &tail[mac_id],
-					HAL_RX_BUF_RBM_SW3_BM);
+					&head[mac_id], &tail[mac_id]);
 	}
 
 	/* Peer can be NULL is case of LFR */
@@ -1681,10 +1677,12 @@ dp_rx_pdev_attach(struct dp_pdev *pdev)
 	rx_desc_pool = &soc->rx_desc_buf[pdev_id];
 
 	dp_rx_desc_pool_alloc(soc, pdev_id, rxdma_entries*3, rx_desc_pool);
+
+	rx_desc_pool->owner = DP_WBM2SW_RBM;
 	/* For Rx buffers, WBM release ring is SW RING 3,for all pdev's */
 	dp_rxdma_srng = &pdev->rx_refill_buf_ring;
 	dp_rx_buffers_replenish(soc, pdev_id, dp_rxdma_srng, rx_desc_pool,
-		0, &desc_list, &tail, HAL_RX_BUF_RBM_SW3_BM);
+		0, &desc_list, &tail);
 
 	return QDF_STATUS_SUCCESS;
 }

+ 6 - 3
dp/wifi3.0/dp_rx.h

@@ -30,6 +30,11 @@
 #define RX_BUFFER_ALIGNMENT     4
 #endif /* RXDMA_OPTIMIZATION */
 
+#ifdef QCA_HOST2FW_RXBUF_RING
+#define DP_WBM2SW_RBM HAL_RX_BUF_RBM_SW1_BM
+#else
+#define DP_WBM2SW_RBM HAL_RX_BUF_RBM_SW3_BM
+#endif
 #define RX_BUFFER_SIZE			2048
 #define RX_BUFFER_RESERVATION   0
 
@@ -676,7 +681,6 @@ static inline bool check_qwrap_multicast_loopback(struct dp_vdev *vdev,
  *	       or NULL during dp rx initialization or out of buffer
  *	       interrupt.
  * @tail: tail of descs list
- * @owner: who owns the nbuf (host, NSS etc...)
  * Return: return success or failure
  */
 QDF_STATUS dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,
@@ -684,8 +688,7 @@ QDF_STATUS dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,
 				 struct rx_desc_pool *rx_desc_pool,
 				 uint32_t num_req_buffers,
 				 union dp_rx_desc_list_elem_t **desc_list,
-				 union dp_rx_desc_list_elem_t **tail,
-				 uint8_t owner);
+				 union dp_rx_desc_list_elem_t **tail);
 
 /**
  * dp_rx_link_desc_return() - Return a MPDU link descriptor to HW

+ 1 - 1
dp/wifi3.0/dp_rx_defrag.c

@@ -129,7 +129,7 @@ void dp_rx_reorder_flush_frag(struct dp_peer *peer,
 		dp_rx_add_to_free_desc_list(&head, &tail,
 				peer->rx_tid[tid].head_frag_desc);
 		dp_rx_buffers_replenish(soc, 0, dp_rxdma_srng, rx_desc_pool,
-			1, &head, &tail, HAL_RX_BUF_RBM_SW3_BM);
+			1, &head, &tail);
 	}
 
 	dp_rx_defrag_cleanup(peer, tid);

+ 5 - 6
dp/wifi3.0/dp_rx_err.c

@@ -981,7 +981,7 @@ done:
 		rx_desc_pool = &soc->rx_desc_buf[0];
 
 		dp_rx_buffers_replenish(soc, 0, dp_rxdma_srng, rx_desc_pool,
-			rx_bufs_used, &head, &tail, HAL_RX_BUF_RBM_SW3_BM);
+			rx_bufs_used, &head, &tail);
 	}
 
 	return rx_bufs_used; /* Assume no scale factor for now */
@@ -1114,8 +1114,7 @@ done:
 
 			dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng,
 					rx_desc_pool, rx_bufs_reaped[mac_id],
-					&head[mac_id], &tail[mac_id],
-					HAL_RX_BUF_RBM_SW3_BM);
+					&head[mac_id], &tail[mac_id]);
 			rx_bufs_used += rx_bufs_reaped[mac_id];
 		}
 	}
@@ -1280,7 +1279,7 @@ dp_rx_err_mpdu_pop(struct dp_soc *soc, uint32_t mac_id,
 
 		if (msdu_list.sw_cookie[0] != HAL_RX_COOKIE_SPECIAL) {
 			/* if the msdus belongs to NSS offloaded radio &&
-			 * the rbm is not SW3_BM then return the msdu_link
+			 * the rbm is not SW1_BM then return the msdu_link
 			 * descriptor without freeing the msdus (nbufs). let
 			 * these buffers be given to NSS completion ring for
 			 * NSS to free them.
@@ -1401,8 +1400,8 @@ dp_rxdma_err_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota)
 		rx_desc_pool = &soc->rx_desc_buf[mac_id];
 
 		dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng,
-			rx_desc_pool, rx_bufs_used, &head, &tail,
-			HAL_RX_BUF_RBM_SW3_BM);
+			rx_desc_pool, rx_bufs_used, &head, &tail);
+
 		work_done += rx_bufs_used;
 	}
 

+ 8 - 5
dp/wifi3.0/dp_rx_mon_dest.c

@@ -809,8 +809,7 @@ void dp_rx_mon_dest_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota)
 	if (rx_bufs_used) {
 		dp_rx_buffers_replenish(soc, mac_id,
 			&pdev->rxdma_mon_buf_ring[mac_for_pdev],
-			&soc->rx_desc_mon[mac_id], rx_bufs_used, &head, &tail,
-			HAL_RX_BUF_RBM_SW3_BM);
+			&soc->rx_desc_mon[mac_id], rx_bufs_used, &head, &tail);
 	}
 }
 
@@ -846,16 +845,20 @@ dp_rx_pdev_mon_buf_attach(struct dp_pdev *pdev, int mac_id) {
 		return status;
 	}
 
+	rx_desc_pool->owner = HAL_RX_BUF_RBM_SW3_BM;
+
 	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_LOW,
 			  "%s: Mon RX Buffers Replenish pdev_id=%d",
 			  __func__, pdev_id);
 
+
 	status = dp_rx_buffers_replenish(soc, mac_id, rxdma_srng, rx_desc_pool,
-			rxdma_entries, &desc_list, &tail,
-			HAL_RX_BUF_RBM_SW3_BM);
+			rxdma_entries, &desc_list, &tail);
+
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
-			"%s: dp_rx_buffers_replenish() failed \n", __func__);
+				"%s: dp_rx_buffers_replenish() failed",
+				__func__);
 		return status;
 	}
 

+ 2 - 0
dp/wifi3.0/dp_types.h

@@ -212,12 +212,14 @@ enum dp_nss_cfg {
  * @array: pointer to array of RX descriptor
  * @freelist: pointer to free RX descriptor link list
  * @lock: Protection for the RX descriptor pool
+ * @owner: owner for nbuf
  */
 struct rx_desc_pool {
 	uint32_t pool_size;
 	union dp_rx_desc_list_elem_t *array;
 	union dp_rx_desc_list_elem_t *freelist;
 	qdf_spinlock_t lock;
+	uint8_t owner;
 };
 
 /**