LS1028ARDB: "tc filter add dev swp0 chain 30000 protocol 802.1Q parent ffff" commond doesn't working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LS1028ARDB: "tc filter add dev swp0 chain 30000 protocol 802.1Q parent ffff" commond doesn't working

526 Views
xu
Contributor II

Hi
I want to run this kernel on LS1028ARDB,system version is REALTIMEEDGEUG_Rev2.1

to use the TSN function of tc.
I have already turned on the configuration file with 'NET', 'NET_SCHED', 'NET_CLS_BASIC', 'NET_CLS_TCINDEX', 'NET_CLS_ROUTE4', 'NET_CLS_FW', 'NET_CLS_U32'. 'NET_CLS_RSVP', 'NET_CLS_RSVP6', 'NET_CLS_BPF'. 'NET_CLS_FLOWER', 'NET_EMATCH', 'NET_CLS_ACT', 'NET_CLS_FLOW'. 'NET_CLS_CGROUP'. 'NET_CLS_MATCHALL' to use the NET_CLS function.
With the kernel log. I can see the function tc_filter_init has been initialized during boot.

according to the doc REALTIMEEDGEUG_Rev2.1.pdf,page 117 to config QCI

xu_0-1665392130549.png

 

But when I use the following command line:

tc filter add dev swp0 chain 30000 protocol 802.1Q parent ffff: flower skip_sw dst_mac CA:9C:00:BC:6D:68 vlan_id 1 action gate index 1 base-time 0 sched-entry CLOSE 6000 -1 -1

tc filter add dev swp0 chain 30000 protocol 802.1Q parent ffff: flower skip_sw dst_mac CA:9C:00:BC:6D:68 vlan_id 1 action police index 1 rate 10Mbit burst 10000

it throws an error: RTNETLINK answers: Invalid argument
We have an error talking to the kernel

xu_2-1665392314406.png

 

Is there any misconduct in my setup?
Looking forward to your reply.
Best wishes!

 

 

0 Kudos
3 Replies

493 Views
xu
Contributor II

thank you for your reply,I will have a try

0 Kudos

508 Views
xu
Contributor II

in REALTIMEEDGEUG_Rev2.3,the command is changed to 

tc filter add dev swp0 ingress chain 30000 protocol 802.1Q flower skip_sw dst_mac CA:9C:00:BC:6D:68 vlan_id 1 action gate index 1 base-time 0 sched-entry CLOSE 6000 -1 -1

but it still throws an error:

xu_0-1665479963069.png

 

0 Kudos

499 Views
yipingwang
NXP TechSupport
NXP TechSupport

For Real-time-edge-v2.1:

1. should configure kernel, refer to "4.1.2.1 Using Linux traffic control (tc)" on page 71:

Enable the following configurations in kernel when using Linux traffic control (tc):
Symbol: NET_SCH_MQPRIO [=y] && NET_SCH_CBS [=y] && NET_SCH_TAPRIO [=y]
[*] Networking support --->
Networking options --->
[*] QoS and/or fair queueing --->
<*> Credit Based Shaper (CBS)
<*> Time Aware Priority (taprio) Scheduler
<*> Multi-queue priority scheduler (MQPRIO)
[*] Actions --->
<*> Traffic Policing
<*> Generic actions
<*> Redirecting and Mirroring
<*> SKB Editing
<*> Vlan manipulation
<*> Frame gate entry list control tc action
On lS1028A platform, ENETC QoS driver needs to be set to support tc configuration.
Symbol: FSL_ENETC_QOS [=y]
Device Drivers--->
[*] Network device support --->
[*] Ethernet driver support --->
[*] Freescale devices
[*] ENETC hardware Time-sensitive Network support

2. About Qci usage, should comply with the following NOTE on page 118:

• Each stream can only be added only once. If a user wants to update it, delete the rule and add a new one.
• MAC and VID of stream must have been learned in switch MAC table if the stream is required to be added.
• Qci gate cycle time is expected to be more than 5 μs.
• Qci flow meter can only set cir and cbs now, and the policers are shared with ACL VCAPs.

3. Should register TC chain, refer to “4.4.2 VCAP on LS1028A Felix switch” on page 178:

Before using chains, users should register each chain and set chain pipeline order for a packet. The hardware ingress order
is: IS1->IS2->PSFP.

tc qdisc add dev swp0 clsact
tc filter add dev swp0 ingress chain 0 pref 49152 flower skip_sw action goto chain 10000
tc filter add dev swp0 ingress chain 10000 pref 49152 flower skip_sw action goto chain 11000
tc filter add dev swp0 ingress chain 11000 pref 49152 flower skip_sw action goto chain 12000
tc filter add dev swp0 ingress chain 12000 pref 49152 flower skip_sw action goto chain 20000
tc filter add dev swp0 ingress chain 20000 pref 49152 flower skip_sw action goto chain 21000
tc filter add dev swp0 ingress chain 21000 pref 49152 flower skip_sw action goto chain 30000

thanks