qcacld-3.0: Use appropriate nbuf push type for tx_mon/rx_mon

Currently for rx packet delivery whether it is from monitor mode or
local packet capture path, is handled in NAPI softirq context and
netif_receive_skb() is called without disabling local bh.

In case of local packet capture, for tx packets after the tx_mon tlvs are
parsed, ppdu queue is handled in workqueue context and nbuf is passed
up the stack in rx_mon callback. Because the nbuf push type NAPI is used
this is causing 'BUG: using __this_cpu_add() in preemptible' for
nbuf coming from tx_mon workqueue context.

Fix is to identify the appropriate nbuf push type based on the context.
if caller is from softirq context then use DP_NBUF_PUSH_NAPI or
if caller is from non irq context use DP_NBUF_PUSH_BH_DISABLE.

Change-Id: I71b3be70febed1c077e7d4d36274a4805a33b722
CRs-Fixed: 3631536
This commit is contained in:
Srinivas Girigowda
2023-10-05 19:49:22 -07:00
committed by Rahul Choudhary
parent a277444aba
commit 69428aa5c5

View File

@@ -834,6 +834,7 @@ QDF_STATUS dp_mon_rx_packet_cbk(void *context, qdf_nbuf_t rxbuf)
qdf_nbuf_t nbuf_next; qdf_nbuf_t nbuf_next;
unsigned int cpu_index; unsigned int cpu_index;
struct dp_tx_rx_stats *stats; struct dp_tx_rx_stats *stats;
enum dp_nbuf_push_type type;
/* Sanity check on inputs */ /* Sanity check on inputs */
if ((!context) || (!rxbuf)) { if ((!context) || (!rxbuf)) {
@@ -879,8 +880,10 @@ QDF_STATUS dp_mon_rx_packet_cbk(void *context, qdf_nbuf_t rxbuf)
* This is the last packet on the chain * This is the last packet on the chain
* Scheduling rx sirq * Scheduling rx sirq
*/ */
type = qdf_in_atomic() ? DP_NBUF_PUSH_NAPI :
DP_NBUF_PUSH_BH_DISABLE;
status = dp_intf->dp_ctx->dp_ops.dp_nbuf_push_pkt(nbuf, status = dp_intf->dp_ctx->dp_ops.dp_nbuf_push_pkt(nbuf,
DP_NBUF_PUSH_NAPI); type);
} }
if (QDF_IS_STATUS_SUCCESS(status)) if (QDF_IS_STATUS_SUCCESS(status))