qcacmn: Add handler for near-full irqs for consumer rings

Add the handlers to process the near-full irqs for
the rx, tx_completion, wbm_error and reo_status rings.

Change-Id: Ia5a2abb6d66a96e8dcb5c651d24769382db0d666
CRs-Fixed: 2965081
This commit is contained in:
Rakesh Pillai
2021-03-25 07:56:21 -07:00
committed by Madan Koyyalamudi
parent 47af4d320f
commit 20dddcb585
7 changed files with 180 additions and 2 deletions

View File

@@ -492,6 +492,96 @@ dp_rxdma_ring_sel_cfg_be(struct dp_soc *soc)
}
#ifdef WLAN_FEATURE_NEAR_FULL_IRQ
/**
* dp_service_near_full_srngs_be() - Main bottom half callback for the
* near-full IRQs.
* @soc: Datapath SoC handle
* @int_ctx: Interrupt context
* @dp_budget: Budget of the work that can be done in the bottom half
*
* Return: work done in the handler
*/
static uint32_t
dp_service_near_full_srngs_be(struct dp_soc *soc, struct dp_intr *int_ctx,
uint32_t dp_budget)
{
int ring = 0;
int budget = dp_budget;
uint32_t work_done = 0;
uint32_t remaining_quota = dp_budget;
struct dp_intr_stats *intr_stats = &int_ctx->intr_stats;
int tx_ring_near_full_mask = int_ctx->tx_ring_near_full_mask;
int rx_near_full_grp_1_mask = int_ctx->rx_near_full_grp_1_mask;
int rx_near_full_grp_2_mask = int_ctx->rx_near_full_grp_2_mask;
int rx_near_full_mask = rx_near_full_grp_1_mask |
rx_near_full_grp_2_mask;
dp_verbose_debug("rx_ring_near_full 0x%x tx_ring_near_full 0x%x",
rx_near_full_mask,
tx_ring_near_full_mask);
if (rx_near_full_mask) {
for (ring = 0; ring < soc->num_reo_dest_rings; ring++) {
if (!(rx_near_full_mask & (1 << ring)))
continue;
work_done = dp_rx_nf_process(int_ctx,
soc->reo_dest_ring[ring].hal_srng,
ring, remaining_quota);
if (work_done) {
intr_stats->num_rx_ring_near_full_masks[ring]++;
dp_verbose_debug("rx NF mask 0x%x ring %d, work_done %d budget %d",
rx_near_full_mask, ring,
work_done,
budget);
budget -= work_done;
if (budget <= 0)
goto budget_done;
remaining_quota = budget;
}
}
}
if (tx_ring_near_full_mask) {
for (ring = 0; ring < MAX_TCL_DATA_RINGS; ring++) {
if (!(tx_ring_near_full_mask & (1 << ring)))
continue;
work_done = dp_tx_comp_nf_handler(int_ctx, soc,
soc->tx_comp_ring[ring].hal_srng,
ring, remaining_quota);
if (work_done) {
intr_stats->num_tx_comp_ring_near_full_masks[ring]++;
dp_verbose_debug("tx NF mask 0x%x ring %d, work_done %d budget %d",
tx_ring_near_full_mask, ring,
work_done, budget);
budget -= work_done;
if (budget <= 0)
break;
remaining_quota = budget;
}
}
}
intr_stats->num_near_full_masks++;
budget_done:
return dp_budget - budget;
}
static inline void
dp_init_near_full_arch_ops_be(struct dp_arch_ops *arch_ops)
{
arch_ops->dp_service_near_full_srngs = dp_service_near_full_srngs_be;
}
#else
static inline void
dp_init_near_full_arch_ops_be(struct dp_arch_ops *arch_ops)
{
}
#endif
void dp_initialize_arch_ops_be(struct dp_arch_ops *arch_ops)
{
#ifndef QCA_HOST_MODE_WIFI_DISABLED
@@ -520,4 +610,5 @@ void dp_initialize_arch_ops_be(struct dp_arch_ops *arch_ops)
arch_ops->txrx_vdev_detach = dp_vdev_detach_be;
arch_ops->dp_rxdma_ring_sel_cfg = dp_rxdma_ring_sel_cfg_be;
dp_init_near_full_arch_ops_be(arch_ops);
}

View File

@@ -980,3 +980,13 @@ struct dp_rx_desc *dp_rx_desc_cookie_2_va_be(struct dp_soc *soc,
{
return (struct dp_rx_desc *)dp_cc_desc_find(soc, cookie, true);
}
#ifdef WLAN_FEATURE_NEAR_FULL_IRQ
uint32_t dp_rx_nf_process(struct dp_intr *int_ctx,
hal_ring_handle_t hal_ring_hdl,
uint8_t reo_ring_num,
uint32_t quota)
{
return 0;
}
#endif

View File

@@ -104,4 +104,29 @@ dp_rx_desc_sw_cc_check(struct dp_soc *soc,
{
}
#endif /* DP_FEATURE_HW_COOKIE_CONVERSION && DP_HW_COOKIE_CONVERT_EXCEPTION */
#ifdef WLAN_FEATURE_NEAR_FULL_IRQ
/**
* dp_rx_nf_process() - Near Full state handler for RX rings.
* @int_ctx: interrupt context
* @hal_ring_hdl: Rx ring handle
* @reo_ring_num: RX ring number
* @quota: Quota of work to be done
*
* Return: work done in the handler
*/
uint32_t dp_rx_nf_process(struct dp_intr *int_ctx,
hal_ring_handle_t hal_ring_hdl,
uint8_t reo_ring_num,
uint32_t quota);
#else
static inline
uint32_t dp_rx_nf_process(struct dp_intr *int_ctx,
hal_ring_handle_t hal_ring_hdl,
uint8_t reo_ring_num,
uint32_t quota)
{
return 0;
}
#endif /*WLAN_FEATURE_NEAR_FULL_IRQ */
#endif

View File

@@ -429,3 +429,12 @@ void dp_tx_desc_pool_deinit_be(struct dp_soc *soc,
page_desc_list->num_spt_pages);
page_desc_list->num_spt_pages = 0;
}
#ifdef WLAN_FEATURE_NEAR_FULL_IRQ
uint32_t dp_tx_comp_nf_handler(struct dp_intr *int_ctx, struct dp_soc *soc,
hal_ring_handle_t hal_ring_hdl, uint8_t ring_id,
uint32_t quota)
{
return 0;
}
#endif

View File

@@ -132,4 +132,28 @@ QDF_STATUS dp_tx_desc_pool_init_be(struct dp_soc *soc,
void dp_tx_desc_pool_deinit_be(struct dp_soc *soc,
struct dp_tx_desc_pool_s *tx_desc_pool,
uint8_t pool_id);
#ifdef WLAN_FEATURE_NEAR_FULL_IRQ
/**
* dp_tx_comp_nf_handler() - Tx completion ring Near full scenario handler
* @int_ctx: Interrupt context
* @soc: Datapath SoC handle
* @hal_ring_hdl: TX completion ring handle
* @ring_id: TX completion ring number
* @quota: Quota of the work to be done
*
* Return: work done
*/
uint32_t dp_tx_comp_nf_handler(struct dp_intr *int_ctx, struct dp_soc *soc,
hal_ring_handle_t hal_ring_hdl, uint8_t ring_id,
uint32_t quota);
#else
static inline
uint32_t dp_tx_comp_nf_handler(struct dp_intr *int_ctx, struct dp_soc *soc,
hal_ring_handle_t hal_ring_hdl, uint8_t ring_id,
uint32_t quota)
{
return 0;
}
#endif /* WLAN_FEATURE_NEAR_FULL_IRQ */
#endif

View File

@@ -2433,7 +2433,15 @@ budget_done:
*/
static uint32_t dp_service_near_full_srngs(void *dp_ctx, uint32_t dp_budget)
{
return 0;
struct dp_intr *int_ctx = (struct dp_intr *)dp_ctx;
struct dp_soc *soc = int_ctx->soc;
/*
* dp_service_near_full_srngs arch ops should be initialized always
* if the NEAR FULL IRQ feature is enabled.
*/
return soc->arch_ops.dp_service_near_full_srngs(soc, int_ctx,
dp_budget);
}
#endif

View File

@@ -806,8 +806,10 @@ struct dp_rx_tid {
* @num_reo_status_ring_masks: interrupts with reo_status_ring_mask set
* @num_rxdma2host_ring_masks: interrupts with rxdma2host_ring_mask set
* @num_host2rxdma_ring_masks: interrupts with host2rxdma_ring_mask set
* @num_host2rxdma_ring_masks: interrupts with host2rxdma_ring_mask set
* @num_rx_ring_near_full_masks: Near-full interrupts for REO DST ring
* @num_tx_comp_ring_near_full_masks: Near-full interrupts for TX completion
* @num_masks: total number of times the interrupt was received
* @num_masks: total number of times the near full interrupt was received
*
* Counter for individual masks are incremented only if there are any packets
* on that ring.
@@ -821,7 +823,12 @@ struct dp_intr_stats {
uint32_t num_reo_status_ring_masks;
uint32_t num_rxdma2host_ring_masks;
uint32_t num_host2rxdma_ring_masks;
uint32_t num_rx_ring_near_full_masks[MAX_REO_DEST_RINGS];
uint32_t num_tx_comp_ring_near_full_masks[MAX_TCL_DATA_RINGS];
uint32_t num_rx_wbm_rel_ring_near_full_masks;
uint32_t num_reo_status_ring_near_full_masks;
uint32_t num_masks;
uint32_t num_near_full_masks;
};
/* per interrupt context */
@@ -1546,6 +1553,7 @@ enum dp_context_type {
* @tx_hw_enqueue: enqueue TX data to HW
* @tx_comp_get_params_from_hal_desc: get software tx descriptor and release
* source from HAL desc for wbm release ring
* @dp_service_near_full_srngs: Handler for servicing the near full IRQ
* @txrx_set_vdev_param: target specific ops while setting vdev params
*/
struct dp_arch_ops {
@@ -1598,6 +1606,9 @@ struct dp_arch_ops {
struct dp_rx_desc *(*dp_rx_desc_cookie_2_va)(struct dp_soc *soc,
uint32_t cookie);
uint32_t (*dp_service_near_full_srngs)(struct dp_soc *soc,
struct dp_intr *int_ctx,
uint32_t dp_budget);
/* Control Arch Ops */
QDF_STATUS (*txrx_set_vdev_param)(struct dp_soc *soc,