net: Enable running without TX or RX threads
Set the default behaviour of the networking subsystem so that no TX or RX threads are created. This will save RAM as there is no need to allocate stack space for the RX/TX threads. Also this will give small improvement to network packet latency shown here: * with 1 traffic class (1 TX and RX thread) Avg TX net_pkt (42707) time 60 us [0->22->15->22=59 us] Avg RX net_pkt (42697) time 36 us [0->10->3->12->7=32 us] * with 0 traffic classes (no TX and RX threads) Avg TX net_pkt (41608) time 42 us [0->21->20=41 us] Avg RX net_pkt (41593) time 31 us [0->9->12->8=29 us] In this qemu_x86 test run, 40k UDP packets was transferred between echo-server and echo-client. In TX the speed increase was 30% and in RX it was 14%. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
ccadbe2e7d
commit
f5fb80750e
8 changed files with 108 additions and 21 deletions
|
@ -346,10 +346,11 @@ void net_if_queue_tx(struct net_if *iface, struct net_pkt *pkt)
|
|||
net_stats_update_tc_sent_priority(iface, tc, prio);
|
||||
|
||||
/* For highest priority packet, skip the TX queue and push directly to
|
||||
* the driver.
|
||||
* the driver. Also if there are no TX queue/thread, push the packet
|
||||
* directly to the driver.
|
||||
*/
|
||||
if (IS_ENABLED(CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO) &&
|
||||
prio == NET_PRIORITY_CA) {
|
||||
if ((IS_ENABLED(CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO) &&
|
||||
prio == NET_PRIORITY_CA) || NET_TC_TX_COUNT == 0) {
|
||||
net_pkt_set_tx_stats_tick(pkt, k_cycle_get_32());
|
||||
|
||||
net_if_tx(net_pkt_iface(pkt), pkt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue