Skip to content

Commit 1acfdf2

Browse files
committed
nrf_wifi: Fix RX batch processing
When processing in a batch, any failure should still process the entire batch. This was manifesting as "RX deinit called for unmapped RX buffer" as the buffer is marked unmapped but not replenished. Signed-off-by: Chaitanya Tata <[email protected]>
1 parent c1c448d commit 1acfdf2

File tree

1 file changed

+11
-8
lines changed
  • drivers/nrf_wifi/fw_if/umac_if/src

1 file changed

+11
-8
lines changed

drivers/nrf_wifi/fw_if/umac_if/src/rx.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ enum nrf_wifi_status nrf_wifi_fmac_rx_event_process(struct nrf_wifi_fmac_dev_ctx
249249
__func__,
250250
desc_id);
251251
status = NRF_WIFI_STATUS_FAIL;
252-
goto out;
252+
continue;
253253
}
254254

255255
status = nrf_wifi_fmac_map_desc_to_pool(fmac_dev_ctx,
@@ -259,7 +259,8 @@ enum nrf_wifi_status nrf_wifi_fmac_rx_event_process(struct nrf_wifi_fmac_dev_ctx
259259
if (status != NRF_WIFI_STATUS_SUCCESS) {
260260
nrf_wifi_osal_log_err("%s: nrf_wifi_fmac_map_desc_to_pool failed",
261261
__func__);
262-
goto out;
262+
status = NRF_WIFI_STATUS_FAIL;
263+
continue;
263264
}
264265

265266
nwb_data = (void *)nrf_wifi_hal_buf_unmap_rx(fmac_dev_ctx->hal_dev_ctx,
@@ -270,7 +271,8 @@ enum nrf_wifi_status nrf_wifi_fmac_rx_event_process(struct nrf_wifi_fmac_dev_ctx
270271
if (!nwb_data) {
271272
nrf_wifi_osal_log_err("%s: nrf_wifi_hal_buf_unmap_rx failed",
272273
__func__);
273-
goto out;
274+
status = NRF_WIFI_STATUS_FAIL;
275+
continue;
274276
}
275277

276278
rx_buf_info = &def_dev_ctx->rx_buf_info[desc_id];
@@ -345,7 +347,7 @@ enum nrf_wifi_status nrf_wifi_fmac_rx_event_process(struct nrf_wifi_fmac_dev_ctx
345347
__func__,
346348
(config->rx_buff_info[i].pkt_type));
347349
status = NRF_WIFI_STATUS_FAIL;
348-
goto out;
350+
continue;
349351
}
350352
def_priv->callbk_fns.rx_frm_callbk_fn(vif_ctx->os_vif_ctx,
351353
nwb);
@@ -360,7 +362,7 @@ enum nrf_wifi_status nrf_wifi_fmac_rx_event_process(struct nrf_wifi_fmac_dev_ctx
360362
#endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS */
361363
nrf_wifi_osal_nbuf_free(nwb);
362364
#ifdef NRF_WIFI_MGMT_BUFF_OFFLOAD
363-
goto out;
365+
continue;
364366
#endif /* NRF_WIFI_MGMT_BUFF_OFFLOAD */
365367
}
366368
#if defined(NRF70_RAW_DATA_RX) || defined(NRF70_PROMISC_DATA_RX)
@@ -396,7 +398,7 @@ enum nrf_wifi_status nrf_wifi_fmac_rx_event_process(struct nrf_wifi_fmac_dev_ctx
396398
__func__,
397399
config->rx_pkt_type);
398400
status = NRF_WIFI_STATUS_FAIL;
399-
goto out;
401+
continue;
400402
}
401403

402404
status = nrf_wifi_fmac_rx_cmd_send(fmac_dev_ctx,
@@ -406,9 +408,10 @@ enum nrf_wifi_status nrf_wifi_fmac_rx_event_process(struct nrf_wifi_fmac_dev_ctx
406408
if (status != NRF_WIFI_STATUS_SUCCESS) {
407409
nrf_wifi_osal_log_err("%s: nrf_wifi_fmac_rx_cmd_send failed",
408410
__func__);
409-
goto out;
411+
continue;
410412
}
411413
}
412-
out:
414+
415+
/* A single failure returns failure for the entire event */
413416
return status;
414417
}

0 commit comments

Comments
 (0)