|
@@ -256,13 +256,13 @@ dp_rx_link_desc_return(struct dp_soc *soc, void *ring_desc, uint8_t bm_action)
|
|
|
*/
|
|
|
static uint32_t dp_rx_msdus_drop(struct dp_soc *soc, void *ring_desc,
|
|
|
struct hal_rx_mpdu_desc_info *mpdu_desc_info,
|
|
|
- union dp_rx_desc_list_elem_t **head,
|
|
|
- union dp_rx_desc_list_elem_t **tail,
|
|
|
+ uint8_t *mac_id,
|
|
|
uint32_t quota)
|
|
|
{
|
|
|
uint32_t rx_bufs_used = 0;
|
|
|
void *link_desc_va;
|
|
|
struct hal_buf_info buf_info;
|
|
|
+ struct dp_pdev *pdev;
|
|
|
struct hal_rx_msdu_list msdu_list; /* MSDU's per MPDU */
|
|
|
int i;
|
|
|
uint8_t *rx_tlv_hdr;
|
|
@@ -281,7 +281,11 @@ static uint32_t dp_rx_msdus_drop(struct dp_soc *soc, void *ring_desc,
|
|
|
dp_rx_cookie_2_va_rxdma_buf(soc,
|
|
|
msdu_list.sw_cookie[i]);
|
|
|
|
|
|
- qdf_assert(rx_desc);
|
|
|
+ qdf_assert_always(rx_desc);
|
|
|
+
|
|
|
+ /* all buffers from a MSDU link link belong to same pdev */
|
|
|
+ *mac_id = rx_desc->pool_id;
|
|
|
+ pdev = soc->pdev_list[rx_desc->pool_id];
|
|
|
|
|
|
if (!dp_rx_desc_check_magic(rx_desc)) {
|
|
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
|
@@ -303,7 +307,8 @@ static uint32_t dp_rx_msdus_drop(struct dp_soc *soc, void *ring_desc,
|
|
|
/* Just free the buffers */
|
|
|
qdf_nbuf_free(rx_desc->nbuf);
|
|
|
|
|
|
- dp_rx_add_to_free_desc_list(head, tail, rx_desc);
|
|
|
+ dp_rx_add_to_free_desc_list(&pdev->free_list_head,
|
|
|
+ &pdev->free_list_tail, rx_desc);
|
|
|
}
|
|
|
|
|
|
/* Return link descriptor through WBM ring (SW2WBM)*/
|
|
@@ -333,8 +338,7 @@ static uint32_t dp_rx_msdus_drop(struct dp_soc *soc, void *ring_desc,
|
|
|
static uint32_t
|
|
|
dp_rx_pn_error_handle(struct dp_soc *soc, void *ring_desc,
|
|
|
struct hal_rx_mpdu_desc_info *mpdu_desc_info,
|
|
|
- union dp_rx_desc_list_elem_t **head,
|
|
|
- union dp_rx_desc_list_elem_t **tail,
|
|
|
+ uint8_t *mac_id,
|
|
|
uint32_t quota)
|
|
|
{
|
|
|
uint16_t peer_id;
|
|
@@ -369,7 +373,7 @@ dp_rx_pn_error_handle(struct dp_soc *soc, void *ring_desc,
|
|
|
if (!peer_pn_policy)
|
|
|
rx_bufs_used = dp_rx_msdus_drop(soc, ring_desc,
|
|
|
mpdu_desc_info,
|
|
|
- head, tail, quota);
|
|
|
+ mac_id, quota);
|
|
|
|
|
|
return rx_bufs_used;
|
|
|
}
|
|
@@ -397,12 +401,10 @@ dp_rx_pn_error_handle(struct dp_soc *soc, void *ring_desc,
|
|
|
static uint32_t
|
|
|
dp_rx_2k_jump_handle(struct dp_soc *soc, void *ring_desc,
|
|
|
struct hal_rx_mpdu_desc_info *mpdu_desc_info,
|
|
|
- union dp_rx_desc_list_elem_t **head,
|
|
|
- union dp_rx_desc_list_elem_t **tail,
|
|
|
- uint32_t quota)
|
|
|
+ uint8_t *mac_id, uint32_t quota)
|
|
|
{
|
|
|
return dp_rx_msdus_drop(soc, ring_desc, mpdu_desc_info,
|
|
|
- head, tail, quota);
|
|
|
+ mac_id, quota);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -958,9 +960,10 @@ dp_rx_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota)
|
|
|
{
|
|
|
void *hal_soc;
|
|
|
void *ring_desc;
|
|
|
- union dp_rx_desc_list_elem_t *head = NULL;
|
|
|
- union dp_rx_desc_list_elem_t *tail = NULL;
|
|
|
+ uint32_t count = 0;
|
|
|
uint32_t rx_bufs_used = 0;
|
|
|
+ uint32_t rx_bufs_reaped[MAX_PDEV_CNT] = { 0 };
|
|
|
+ uint8_t mac_id = 0;
|
|
|
uint8_t buf_type;
|
|
|
uint8_t error, rbm;
|
|
|
struct hal_rx_mpdu_desc_info mpdu_desc_info;
|
|
@@ -1046,9 +1049,11 @@ dp_rx_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota)
|
|
|
|
|
|
if (mpdu_desc_info.mpdu_flags & HAL_MPDU_F_FRAGMENT) {
|
|
|
/* TODO */
|
|
|
- rx_bufs_used += dp_rx_frag_handle(soc,
|
|
|
- ring_desc, &mpdu_desc_info,
|
|
|
- &head, &tail, quota);
|
|
|
+ count = dp_rx_frag_handle(soc,
|
|
|
+ ring_desc, &mpdu_desc_info,
|
|
|
+ &mac_id, quota);
|
|
|
+
|
|
|
+ rx_bufs_reaped[mac_id] += count;
|
|
|
DP_STATS_INC(soc, rx.rx_frags, 1);
|
|
|
continue;
|
|
|
}
|
|
@@ -1059,9 +1064,12 @@ dp_rx_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota)
|
|
|
rx.err.
|
|
|
reo_error[HAL_REO_ERR_PN_CHECK_FAILED],
|
|
|
1);
|
|
|
- rx_bufs_used += dp_rx_pn_error_handle(soc,
|
|
|
- ring_desc, &mpdu_desc_info,
|
|
|
- &head, &tail, quota);
|
|
|
+ count = dp_rx_pn_error_handle(soc,
|
|
|
+ ring_desc,
|
|
|
+ &mpdu_desc_info, &mac_id,
|
|
|
+ quota);
|
|
|
+
|
|
|
+ rx_bufs_reaped[mac_id] += count;
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -1071,9 +1079,12 @@ dp_rx_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota)
|
|
|
rx.err.
|
|
|
reo_error[HAL_REO_ERR_REGULAR_FRAME_2K_JUMP],
|
|
|
1);
|
|
|
- rx_bufs_used += dp_rx_2k_jump_handle(soc,
|
|
|
- ring_desc, &mpdu_desc_info,
|
|
|
- &head, &tail, quota);
|
|
|
+
|
|
|
+ count = dp_rx_2k_jump_handle(soc,
|
|
|
+ ring_desc, &mpdu_desc_info,
|
|
|
+ &mac_id, quota);
|
|
|
+
|
|
|
+ rx_bufs_reaped[mac_id] += count;
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
@@ -1084,14 +1095,19 @@ done:
|
|
|
if (soc->rx.flags.defrag_timeout_check)
|
|
|
dp_rx_defrag_waitlist_flush(soc);
|
|
|
|
|
|
- /* Assume MAC id = 0, owner = 0 */
|
|
|
- if (rx_bufs_used) {
|
|
|
- dp_pdev = soc->pdev_list[0];
|
|
|
- dp_rxdma_srng = &dp_pdev->rx_refill_buf_ring;
|
|
|
- rx_desc_pool = &soc->rx_desc_buf[0];
|
|
|
+ for (mac_id = 0; mac_id < MAX_PDEV_CNT; mac_id++) {
|
|
|
+ if (rx_bufs_reaped[mac_id]) {
|
|
|
+ dp_pdev = soc->pdev_list[mac_id];
|
|
|
+ dp_rxdma_srng = &dp_pdev->rx_refill_buf_ring;
|
|
|
+ rx_desc_pool = &soc->rx_desc_buf[mac_id];
|
|
|
|
|
|
- dp_rx_buffers_replenish(soc, 0, dp_rxdma_srng, rx_desc_pool,
|
|
|
- rx_bufs_used, &head, &tail);
|
|
|
+ dp_rx_buffers_replenish(soc, mac_id, dp_rxdma_srng,
|
|
|
+ rx_desc_pool,
|
|
|
+ rx_bufs_reaped[mac_id],
|
|
|
+ &dp_pdev->free_list_head,
|
|
|
+ &dp_pdev->free_list_tail);
|
|
|
+ rx_bufs_used += rx_bufs_reaped[mac_id];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return rx_bufs_used; /* Assume no scale factor for now */
|
|
@@ -1186,7 +1202,7 @@ dp_rx_wbm_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota)
|
|
|
rx_buf_cookie = HAL_RX_WBM_BUF_COOKIE_GET(ring_desc);
|
|
|
|
|
|
rx_desc = dp_rx_cookie_2_va_rxdma_buf(soc, rx_buf_cookie);
|
|
|
- qdf_assert(rx_desc);
|
|
|
+ qdf_assert_always(rx_desc);
|
|
|
|
|
|
if (!dp_rx_desc_check_magic(rx_desc)) {
|
|
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
|
@@ -1440,7 +1456,7 @@ dp_rx_err_mpdu_pop(struct dp_soc *soc, uint32_t mac_id,
|
|
|
struct dp_rx_desc *rx_desc =
|
|
|
dp_rx_cookie_2_va_rxdma_buf(soc,
|
|
|
msdu_list.sw_cookie[i]);
|
|
|
- qdf_assert(rx_desc);
|
|
|
+ qdf_assert_always(rx_desc);
|
|
|
msdu = rx_desc->nbuf;
|
|
|
|
|
|
qdf_nbuf_unmap_single(soc->osdev, msdu,
|