Skip to content

Commit

Permalink
net: offload: Do not need to enable TC threads for NET_OFFLOAD
Browse files Browse the repository at this point in the history
Net offloading doesn't need net TC threads to be enabled as they're used
by the native stack. This fixes build if CONFIG_NET_OFFLOAD is enabled
but native stack is disabled.

Signed-off-by: Robert Lubos <[email protected]>
  • Loading branch information
rlubos committed Sep 30, 2024
1 parent 4074e9c commit 2e3b2b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion subsys/net/ip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ zephyr_library_sources(
)

if(CONFIG_NET_OFFLOAD)
zephyr_library_sources(net_context.c net_pkt.c net_tc.c)
zephyr_library_sources(net_context.c net_pkt.c)
endif()

zephyr_library_sources_ifdef(CONFIG_NET_MGMT_EVENT net_mgmt.c)
Expand Down
9 changes: 5 additions & 4 deletions subsys/net/ip/net_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,12 @@ extern bool net_context_is_v6only_set(struct net_context *context);
extern bool net_context_is_recv_pktinfo_set(struct net_context *context);
extern bool net_context_is_timestamping_set(struct net_context *context);
extern void net_pkt_init(void);
extern void net_tc_tx_init(void);
extern void net_tc_rx_init(void);
int net_context_get_local_addr(struct net_context *context,
struct sockaddr *addr,
socklen_t *addrlen);
#else
static inline void net_context_init(void) { }
static inline void net_pkt_init(void) { }
static inline void net_tc_tx_init(void) { }
static inline void net_tc_rx_init(void) { }
static inline const char *net_context_state(struct net_context *context)
{
ARG_UNUSED(context);
Expand Down Expand Up @@ -149,6 +145,8 @@ static inline void mdns_init_responder(void) { }
#if defined(CONFIG_NET_NATIVE)
enum net_verdict net_ipv4_input(struct net_pkt *pkt, bool is_loopback);
enum net_verdict net_ipv6_input(struct net_pkt *pkt, bool is_loopback);
extern void net_tc_tx_init(void);
extern void net_tc_rx_init(void);
#else
static inline enum net_verdict net_ipv4_input(struct net_pkt *pkt,
bool is_loopback)
Expand All @@ -167,6 +165,9 @@ static inline enum net_verdict net_ipv6_input(struct net_pkt *pkt,

return NET_CONTINUE;
}

static inline void net_tc_tx_init(void) { }
static inline void net_tc_rx_init(void) { }
#endif

Check notice on line 171 in subsys/net/ip/net_private.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/net/ip/net_private.h:171 -static inline void net_tc_tx_init(void) { } -static inline void net_tc_rx_init(void) { } +static inline void net_tc_tx_init(void) +{ +} +static inline void net_tc_rx_init(void) +{ +}
extern bool net_tc_submit_to_tx_queue(uint8_t tc, struct net_pkt *pkt);
extern void net_tc_submit_to_rx_queue(uint8_t tc, struct net_pkt *pkt);
Expand Down

0 comments on commit 2e3b2b3

Please sign in to comment.