Skip to content

Commit

Permalink
Ensure static assertion in config file correctly represents size of n…
Browse files Browse the repository at this point in the history
…et queue structure

Signed-off-by: Courtney Darville <[email protected]>
  • Loading branch information
Courtney3141 committed Oct 31, 2024
1 parent 2c4a507 commit 19b2f1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions examples/kitty/src/config/ethernet_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ _Static_assert(NET_RX_DATA_REGION_SIZE_CLI1 >=
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif

#define ETH_MAX_QUEUE_CAPACITY MAX(NET_TX_QUEUE_CAPACITY_DRIV, \
#define NET_MAX_QUEUE_CAPACITY MAX(NET_TX_QUEUE_CAPACITY_DRIV, \
MAX(NET_RX_QUEUE_CAPACITY_DRIV, \
MAX(NET_RX_QUEUE_CAPACITY_CLI0, \
NET_RX_QUEUE_CAPACITY_CLI1)))
Expand All @@ -86,8 +86,8 @@ _Static_assert(NET_RX_QUEUE_CAPACITY_COPY0 >= NET_RX_QUEUE_CAPACITY_DRIV,
"Network Copy0 queue must have capacity to fit all RX buffers.");
_Static_assert(NET_RX_QUEUE_CAPACITY_COPY1 >= NET_RX_QUEUE_CAPACITY_DRIV,
"Network Copy1 queue must have capacity to fit all RX buffers.");
_Static_assert(sizeof(net_queue_t) <= NET_DATA_REGION_CAPACITY,
"Netowkr Queue must fit into a single data region.");
_Static_assert(sizeof(net_queue_t) + NET_MAX_QUEUE_CAPACITY * sizeof(net_buff_desc_t) <= NET_DATA_REGION_SIZE,
"net_queue_t must fit into a single data region.");

static inline uint64_t net_cli_mac_addr(char *pd_name)
{
Expand Down
6 changes: 3 additions & 3 deletions examples/webserver/config/ethernet_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ _Static_assert(NET_RX_DATA_REGION_SIZE_CLI1 >=
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif

#define ETH_MAX_QUEUE_CAPACITY MAX(NET_TX_QUEUE_CAPACITY_DRIV, \
#define NET_MAX_QUEUE_CAPACITY MAX(NET_TX_QUEUE_CAPACITY_DRIV, \
MAX(NET_RX_QUEUE_CAPACITY_DRIV, \
MAX(NET_RX_QUEUE_CAPACITY_CLI0, \
NET_RX_QUEUE_CAPACITY_CLI1)))
Expand All @@ -86,8 +86,8 @@ _Static_assert(NET_RX_QUEUE_CAPACITY_COPY0 >= NET_RX_QUEUE_CAPACITY_DRIV,
"Network Copy0 queue must have capacity to fit all RX buffers.");
_Static_assert(NET_RX_QUEUE_CAPACITY_COPY1 >= NET_RX_QUEUE_CAPACITY_DRIV,
"Network Copy1 queue must have capacity to fit all RX buffers.");
_Static_assert(sizeof(net_queue_t) <= NET_DATA_REGION_CAPACITY,
"Netowkr Queue must fit into a single data region.");
_Static_assert(sizeof(net_queue_t) + NET_MAX_QUEUE_CAPACITY * sizeof(net_buff_desc_t) <= NET_DATA_REGION_SIZE,
"net_queue_t must fit into a single data region.");

static inline uint64_t net_cli_mac_addr(char *pd_name)
{
Expand Down

0 comments on commit 19b2f1b

Please sign in to comment.