From 80b307749037b3759bf1961771c6eb13a4640160 Mon Sep 17 00:00:00 2001 From: sandhu Date: Wed, 3 Feb 2021 21:18:44 -0800 Subject: [PATCH] qcacld-3.0: Initialize fisa flow entry napi id to other than zero value Zero initialization of Napi id can cause napi id zero context to flush flow that are uninitialized. Which may cause a race condition if some other napi context is using the uninitialized fisa flow entry during the flow learning phase. Change-Id: Iedca4ee112efa29c70a632c4a365e95f71e8f506 CRs-Fixed: 2864633 --- core/dp/txrx3.0/dp_rx_fst.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/dp/txrx3.0/dp_rx_fst.c b/core/dp/txrx3.0/dp_rx_fst.c index 800d7dbee465..aea89e98853a 100644 --- a/core/dp/txrx3.0/dp_rx_fst.c +++ b/core/dp/txrx3.0/dp_rx_fst.c @@ -28,6 +28,8 @@ /* Timeout in milliseconds to wait for CMEM FST HTT response */ #define DP_RX_FST_CMEM_RESP_TIMEOUT 2000 +#define INVALID_NAPI 0Xff + #ifdef WLAN_SUPPORT_RX_FISA void dp_fisa_rx_fst_update_work(void *arg); @@ -205,8 +207,10 @@ static QDF_STATUS dp_rx_fst_cmem_init(struct dp_rx_fst *fst) QDF_STATUS dp_rx_fst_attach(struct dp_soc *soc, struct dp_pdev *pdev) { struct dp_rx_fst *fst; + struct dp_fisa_rx_sw_ft *ft_entry; uint8_t *hash_key; struct wlan_cfg_dp_soc_ctxt *cfg = soc->wlan_cfg_ctx; + int i = 0; QDF_STATUS status; /* Check if it is enabled in the INI */ @@ -250,6 +254,10 @@ QDF_STATUS dp_rx_fst_attach(struct dp_soc *soc, struct dp_pdev *pdev) if (!fst->base) goto out2; + ft_entry = (struct dp_fisa_rx_sw_ft *)fst->base; + for (i = 0; i < fst->max_entries; i++) + ft_entry[i].napi_id = INVALID_NAPI; + fst->hal_rx_fst = hal_rx_fst_attach(soc->osdev, &fst->hal_rx_fst_base_paddr, fst->max_entries,