This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VH-Q1: Validate EST functionality under native driver.

Part Number: TDA4VH-Q1
Other Parts Discussed in Thread: TDA4VH

Hi experts,

        I am currently using the TDA4VH development board with SDK 8.6.

I am using the switch mode under native driver and specifically using the k3-j784s4-quad-port-eth1-exp subboard.

I have encountered two issues.

Firstly, I am unable to recognize VLAN priority. I have tried using

“tc filter add dev eth0 egress protocol 802.1Q flower vlan_id 11 action skbedit priority 3”

as well as using the u32 matcher to match the byte where VLAN is located, but I still cannot successfully place the packets in the corresponding priority queue.

The second issue is that during the validation process, if I connect two boards using the two ports of cpsw9g, I am unable to use the tc filter to match packets.

However, if I connect the two switches using a bridge as shown in the diagram below, I can achieve the filtering functionality.

The commands I am using are as follows:

          ifconfig eth0 down;

          ifconfig eth1 down;  ifconfig eth2 down;  ifconfig eth3 down; ifconfig eth4 down;

          ethtool -L eth0 tx 4;

          ethtool -L eth3 tx 4

          ethtool --set-priv-flags eth0 p0-rx-ptype-rrobin off

          ethtool --set-priv-flags eth3 p0-rx-ptype-rrobin off

          devlink dev param set platform/c000000.ethernet name switch_mode value true cmode runtime

          ip link add name br0 type bridge

          ip link set dev br0 type bridge ageing_time 1000

          ip link set dev eth0 up; ip link set dev eth3 up

          ip link set dev eth0 master br0; ip link set dev eth3 master br0

          ip link set dev br0 up

          ip link set dev br0 type bridge vlan_filtering 1

          bridge vlan add dev br0 vid 1 pvid untagged self

          tc qdisc replace dev eth3 parent root handle 100 taprio \

          num_tc 3 map 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 queues 1@0 1@1 1@2 base-time 0 \

          sched-entry S 4 400000 sched-entry S 2 200000 sched-entry S 1 100000 flags 2

          tc qdisc add dev eth3 clsact

          tc filter add dev eth3 egress protocol ip prio 1 u32 match ip dport 5003 0xffff action skbedit priority 3

I have verified that the configuration mentioned above is correct. However, when I replace cpsw2g's eth0 with cpsw9g's eth2, the functionality of tc filter disappears.

Why does the command tc filter add dev eth0 egress protocol 802.1Q not have any effect and why does using two ports on the same switch cause the tc filter to become ineffective?

 

regards

yrq

  • Hi,

    The "tc filter" is completely software command and it does not have a callback to CPSW driver. Only "taprio qdisc" will make changes to the hardware.

    I have verified that the configuration mentioned above is correct. However, when I replace cpsw2g's eth0 with cpsw9g's eth2, the functionality of tc filter disappears.

    Can you explain what do you mean when you say "functionality of tc filter disappears"? Can you still see the tc filter, or are the packets not being tagged with the correct priority?

    “tc filter add dev eth0 egress protocol 802.1Q flower vlan_id 11 action skbedit priority 3”

    You are trying to match the vlan id with a priority for this. Is that correct?

    Usually, this is not how it goes. With VLAN, the pcp priority field in the VLAN tag are mapped to the queue priority levels. This can be done by ip link command like following:

    ip link set eth0.100 type vlan egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7"

    Hope this points you in the correct direction.

    Regards,
    Tanmay

  • Hi,

    Can you explain what do you mean when you say "functionality of tc filter disappears"? Can you still see the tc filter, or are the packets not being tagged with the correct priority

    yes, I can still see tc filters, but I’m unable to associate packets with priorities, it seems like they are all treated as the default priority.

    Usually, this is not how it goes. With VLAN, the pcp priority field in the VLAN tag are mapped to the queue priority levels. This can be done by ip link command like following:

    ip link set eth0.100 type vlan egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7"

    I will try this feature in mac mode, but how can I achieve the same functionality in switch mode?

    Regards,

    yrq

  • Hi,

    I will try this feature in mac mode, but how can I achieve the same functionality in switch mode?

    It will be the same in switch mode with whatever vlan interface you are using.

    it seems like they are all treated as the default priority.

    How are you confirming this?

    Regards,
    Tanmay

  • Hi,

    It will be the same in switch mode with whatever vlan interface you are using

    in switch mode,I plan to configure as follows.(The basic commands are omitted.)

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    ip link add name br0 type bridge
    ip link set dev br0 type bridge ageing_time 1000
    ip link set dev eth1 master br0
    ip link set dev eth2 master br0
    ip link set dev eth3 master br0
    ip link set dev eth4 master br0
    ip link set dev br0 type bridge vlan_filtering 1
    bridge vlan add dev br0 vid 1 pvid untagged self
    bridge vlan add dev eth2 vid 11 master
    bridge vlan add dev eth3 vid 12 master
    tc qdisc replace dev eth2 parent root handle 100 taprio \
    num_tc 8 \
    map 1 0 2 3 4 5 6 7 0 0 0 0 0 0 0 0 \
    queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \
    base-time $base \
    sched-entry 64 2 250000 \
    sched-entry 191 2 4750000 \
    flags 2
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    In the given situation, which command should I use to configure the mapping between VLAN priority and traffic class?

    How are you confirming this?

    I performed some verification based on the connectivity situation depicted in the following diagram.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ifconfig eth1 down
    ifconfig eth2 down
    ifconfig eth3 down
    ifconfig eth4 down
    ethtool -L eth2 tx 4
    ethtool -L eth3 tx 4
    ethtool --set-priv-flags eth0 p0-rx-ptype-rrobin off
    ethtool --set-priv-flags eth3 p0-rx-ptype-rrobin off
    devlink dev param set platform/c000000.ethernet name switch_mode value true cmode runtime
    ip link add name br0 type bridge
    ip link set dev br0 type bridge ageing_time 1000
    ip link set dev eth2 up
    ip link set dev eth3 up
    ip link set dev eth2 master br0
    ip link set dev eth3 master br0
    ip link set dev br0 up; ip link set dev br0 type bridge vlan_filtering 1
    bridge vlan add dev br0 vid 1 pvid untagged self
    # setset gatecontrol
    tc qdisc replace dev eth3 parent root handle 100 taprio \
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    when I send udp port 5003 packet,the tc filter doesn't work,

    but when I replaced eth2 with eth0 of cpsw2g, this functionality started working properly.

    So, I suspect that it might be because the ports are on the same switch, and they are directly doing MAC forwarding without going through the filtering step.

    Regards,

    yrq

  • Hi Yang,

    I see that you have multiple thread open on the various TSN functionalities. Can we get together on a call so that I would be able to understand and resolve your queries all at the same time.

    Please let me know about the same.

    Regards,
    Tanmay