From 6e1fe7f344e86e4874a56b5137e9a285c4625e8d Mon Sep 17 00:00:00 2001 From: Karthik Kantamneni Date: Tue, 8 Aug 2023 14:14:15 +0530 Subject: [PATCH] qcacmn: Reset nbuf data pointer properly in RX fast path handling Currently RX nbuf data pointer is reset considering headroom reserve size of NET_SKB_PAD. So while reattaching buffer back to H.W always data pointer is reset back to head plus NET_SKB_PAD offset. But if skb is not allocated with head room reserve then we should not reset data pointer taking NET_SKB_PAD as consideration. Fix this by pushing nbuf data pointer back to the state when nbuf entered the host. Change-Id: Ie96f99fdd92deaa921619a45cd5993a42f7b8f6e CRs-Fixed: 3582873 --- dp/wifi3.0/rh/dp_rh_htt.c | 4 ++-- qdf/linux/src/qdf_nbuf.c | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dp/wifi3.0/rh/dp_rh_htt.c b/dp/wifi3.0/rh/dp_rh_htt.c index 9507d703b8..7d7a7998ef 100644 --- a/dp/wifi3.0/rh/dp_rh_htt.c +++ b/dp/wifi3.0/rh/dp_rh_htt.c @@ -31,8 +31,8 @@ #define HTT_T2H_MSG_BUF_REINIT(_buf, dev) \ do { \ - QDF_NBUF_CB_PADDR(_buf) -= (HTC_HEADER_LEN + \ - HTC_HDR_ALIGNMENT_PADDING); \ + qdf_nbuf_push_head(_buf, (HTC_HEADER_LEN) + \ + HTC_HDR_ALIGNMENT_PADDING); \ qdf_nbuf_init_fast((_buf)); \ qdf_mem_dma_sync_single_for_device(dev, \ (QDF_NBUF_CB_PADDR(_buf)), \ diff --git a/qdf/linux/src/qdf_nbuf.c b/qdf/linux/src/qdf_nbuf.c index 86d713f12a..f57a67c854 100644 --- a/qdf/linux/src/qdf_nbuf.c +++ b/qdf/linux/src/qdf_nbuf.c @@ -5798,7 +5798,6 @@ qdf_export_symbol(__qdf_nbuf_init); void qdf_nbuf_init_fast(qdf_nbuf_t nbuf) { qdf_nbuf_users_set(&nbuf->users, 1); - nbuf->data = nbuf->head + NET_SKB_PAD; skb_reset_tail_pointer(nbuf); } qdf_export_symbol(qdf_nbuf_init_fast);