From f2d33c938be7ed85af75fd46f8474bec7011f744 Mon Sep 17 00:00:00 2001 From: syed touqeer pasha Date: Fri, 5 Jun 2020 21:10:29 +0530 Subject: [PATCH] qcacmn: Handle insufficient headroom If headroom is insufficient during ppdu metadata receive, reallocate headroom. Change-Id: Ib3c5295ce73eaab5a5ff6b37f0f37361e7135b9c --- dp/wifi3.0/dp_tx.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 6dce79aba8..e2d50da025 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -2786,6 +2786,7 @@ dp_get_completion_indication_for_stack(struct dp_soc *soc, uint32_t ppdu_id = ts->ppdu_id; uint8_t first_msdu = ts->first_msdu; uint8_t last_msdu = ts->last_msdu; + uint32_t txcap_hdr_size = sizeof(struct tx_capture_hdr); if (qdf_unlikely(!pdev->tx_sniffer_enable && !pdev->mcopy_mode && !pdev->latency_capture_enable)) @@ -2816,7 +2817,16 @@ dp_get_completion_indication_for_stack(struct dp_soc *soc, pdev->m_copy_id.tx_peer_id = peer_id; } - if (!qdf_nbuf_push_head(netbuf, sizeof(struct tx_capture_hdr))) { + if (qdf_unlikely(qdf_nbuf_headroom(netbuf) < txcap_hdr_size)) { + netbuf = qdf_nbuf_realloc_headroom(netbuf, txcap_hdr_size); + if (!netbuf) { + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, + FL("No headroom")); + return QDF_STATUS_E_NOMEM; + } + } + + if (!qdf_nbuf_push_head(netbuf, txcap_hdr_size)) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, FL("No headroom")); return QDF_STATUS_E_NOMEM;