-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: tc: Add a skip for rx-queues #84600
base: main
Are you sure you want to change the base?
Conversation
@@ -407,6 +407,13 @@ config NET_TC_SKIP_FOR_HIGH_PRIO | |||
be pushed directly to network driver and will skip the traffic class | |||
queues. This is currently not enabled by default. | |||
|
|||
config NET_TC_RX_SKIP_FOR_HIGH_PRIO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option seems a bit risky for drivers reporting packets directly from IRQ context, just as setting NET_TC_RX_COUNT to 0. IMHO it merits a warning in the help description, similar to
Line 392 in b80a058
If you select 0 here, then it means that all the network traffic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
8cc6d69
to
b0e8209
Compare
I would like to propose additionally, that an alias |
Sounds quite reasonable to me. |
Need this be done in this PR? If so, could you give some guidance on how to do it? |
Doesn't have to, but it could. Regarding deprecation:
|
To avoid starvation of a traffic class by another, limit the maximum amount of packets, that can sit in a single traffic-class-fifo to a fraction of the maximum amount of available packets. In the tx-case also reserve packets for direct sending, in the case, where CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO is enabled. Signed-off-by: Cla Mattia Galliard <[email protected]>
b0e8209
to
2d8d50b
Compare
Updated based on latest changes from: #84442 |
subsys/net/ip/net_core.c
Outdated
@@ -458,28 +458,23 @@ static void net_rx(struct net_if *iface, struct net_pkt *pkt) | |||
|
|||
void net_process_rx_packet(struct net_pkt *pkt) | |||
{ | |||
net_pkt_set_rx_stats_tick(pkt, k_cycle_get_32()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing this? It was originally placed here to calculate how long the packet processing takes for this tc. If you move it to net_queue_rx() then we are also calculating any extra processing in tc side which was not the point.
Also this commit was about adding statistics and this change is not related to that. If you think this line is incorrect now, please propose a change in another commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It happened in the caller in the if
and else
case. So I hoisted it there, now more stats updating happens in the same function. It has at least to do with the statistics. To me this seemed more logical. Will remove and make separate PR to not hold this one off any longer.
@@ -367,8 +366,6 @@ void net_if_queue_tx(struct net_if *iface, struct net_pkt *pkt) | |||
*/ | |||
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment to this one, why do we need to change this?
Add statistics about packets dropped in net_tc. Signed-off-by: Cla Mattia Galliard <[email protected]>
Add a configuration option to skip the rx-queues for high priority packets analogously to the tx-side. Signed-off-by: Cla Mattia Galliard <[email protected]>
2d8d50b
to
290e58d
Compare
Add a configuration option to skip the rx-queues for high priority packets
analogously to the tx-side.
Based on #84442, this PR proposes 8cc6d69 on top.
Implementation of: #84524