File tree Expand file tree Collapse file tree 5 files changed +37
-17
lines changed
Expand file tree Collapse file tree 5 files changed +37
-17
lines changed Original file line number Diff line number Diff line change 33# Copyright (c) 2025 Nordic Semiconductor ASA
44# SPDX-License-Identifier: Apache-2.0
55
6+ mainmenu "Networking pkt_filter sample application"
7+
8+ config NET_SAMPLE_USE_PACKET_PRIORITIES
9+ bool "Use network packet priorities"
10+ help
11+ Create multiple traffic class queues in order to test
12+ network packet priorities.
13+
614source "samples/net/common/Kconfig"
715source "Kconfig.zephyr"
Original file line number Diff line number Diff line change 1+ # Enable network packet priority support in the sample
2+ CONFIG_NET_SAMPLE_USE_PACKET_PRIORITIES=y
3+ CONFIG_NET_TC_RX_COUNT=2
4+ CONFIG_NET_TC_RX_SKIP_FOR_HIGH_PRIO=y
Original file line number Diff line number Diff line change @@ -62,5 +62,4 @@ CONFIG_NET_IF_MAX_IPV6_COUNT=3
6262
6363# Network traffic class queues
6464CONFIG_NET_TC_THREAD_PREEMPTIVE=y
65- CONFIG_NET_TC_RX_COUNT=2
66- CONFIG_NET_TC_RX_SKIP_FOR_HIGH_PRIO=y
65+ CONFIG_NET_TC_RX_COUNT=1
Original file line number Diff line number Diff line change 11sample :
22 description : Network packet filtering functionality
33 name : Network packet filter sample app
4+ common :
5+ harness : net
6+ min_ram : 64
7+ tags :
8+ - net
9+ - statistics
10+ - net_pkt_filter
11+ depends_on : netif
12+ integration_platforms :
13+ - native_sim
414tests :
5- sample.net.pkt_filter :
6- harness : net
7- min_ram : 64
8- tags :
9- - net
10- - statistics
11- - net_pkt_filter
12- depends_on : netif
13- integration_platforms :
14- - native_sim
15+ sample.net.pkt_filter : {}
16+ sample.net.pkt_filter_priorities :
17+ extra_args : EXTRA_CONF_FILE="overlay-priority.conf"
Original file line number Diff line number Diff line change @@ -148,11 +148,17 @@ static void init_app(void)
148148 * First append the priority rules, so that they get evaluated before
149149 * deciding on the final verdict for the packet.
150150 */
151- npf_append_recv_rule (& eth_priority_default );
152- npf_append_recv_rule (& eth_priority_ptp );
153- npf_append_recv_rule (& eth_priority_vlan );
154- npf_append_recv_rule (& arp_priority_vlan1 );
155- npf_append_recv_rule (& arp_priority_vlan2 );
151+ if (IS_ENABLED (CONFIG_NET_SAMPLE_USE_PACKET_PRIORITIES )) {
152+ LOG_INF ("Using packet priorities" );
153+
154+ npf_append_recv_rule (& eth_priority_default );
155+ npf_append_recv_rule (& eth_priority_ptp );
156+ npf_append_recv_rule (& eth_priority_vlan );
157+ npf_append_recv_rule (& arp_priority_vlan1 );
158+ npf_append_recv_rule (& arp_priority_vlan2 );
159+ } else {
160+ LOG_INF ("Packet priorities are disabled" );
161+ }
156162
157163 /* We allow small IPv4 packets to the VLAN interface 1 */
158164 npf_append_recv_rule (& small_ipv4_pkt );
You can’t perform that action at this time.
0 commit comments