Skip to content

Commit

Permalink
drivers: wifi: Add an assert for enforcing proper TX buffer sizes
Browse files Browse the repository at this point in the history
The TX buffers should accomodate MTU size and headroom needed, so, add a
build assert to avoid dropping packets at runtime.

Fixes SHEL-2175.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
  • Loading branch information
krish2718 authored and rlubos committed Nov 23, 2023
1 parent ecc5f8f commit 0e67ad4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/wifi/nrf700x/src/fmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep;
#define MAX_RX_QUEUES 3

#define MAX_TX_FRAME_SIZE \
(CONFIG_NRF700X_TX_MAX_DATA_SIZE + TX_BUF_HEADROOM)
(CONFIG_NRF_WIFI_IFACE_MTU + TX_BUF_HEADROOM)
#define TOTAL_TX_SIZE \
(CONFIG_NRF700X_MAX_TX_TOKENS * CONFIG_NRF700X_TX_MAX_DATA_SIZE)
#define TOTAL_RX_SIZE \
Expand All @@ -64,6 +64,9 @@ BUILD_ASSERT(CONFIG_NRF700X_RX_NUM_BUFS >= 1,
BUILD_ASSERT(RPU_PKTRAM_SIZE - TOTAL_RX_SIZE >= TOTAL_TX_SIZE,
"Packet RAM overflow: not enough memory for TX");

BUILD_ASSERT(CONFIG_NRF700X_TX_MAX_DATA_SIZE >= MAX_TX_FRAME_SIZE,
"TX buffer size must be at least as big as the MTU and headroom");

static const unsigned char aggregation = 1;
static const unsigned char wmm = 1;
static const unsigned char max_num_tx_agg_sessions = 4;
Expand Down

0 comments on commit 0e67ad4

Please sign in to comment.