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.

DRA829J: Configuring CPSW9G with systemd-networkd/ debug CPSW9G

Part Number: DRA829J

Hello,

We are able to configure the switch for our use case with the tools suggested by TI (i.e. 'iproute2'). For a few reasons, we would like to transfere this 'shell configuration' to systemd-networkd. Somehow the bridge configuration of systemd-networkd doesn't work on the hardware.

Do you have any feedback on using systemd-networkd with this switch?

Can you suggest a tool to debug the switch configuration/ switch registers? 

So far, we used TI's 'switch-config' tool. Is this still valid? Can you please provide us some documentation on the registers we can see in the register dumps?

Best regards,

Matthias Hörger

  • Hi Matthias,

    The "switch-config" tool is depracated SDK 9.0 onwards.

    Can you share what is it that you are trying to do with systemd. I have tried bridge configuration multiple times with systemd and haven't faced any issues.

    You will have to add an additional patch to have switch mode in the driver by default : https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/enable_2D00_switch_2D00_mode_2D00_by_2D00_default.patch

    Can you try with this.

    Regards,
    Tanmay

  • Hi Tanmay,

    With the patch we are able to debug our configuration more reliably. Before, we used udev to change to switch_mode and got some weird behavior.

    I'll update this thread as soon as I know if the error is in our configuration or if we suspect the switch.

    Regards,

    Matthias

  • Hi Tanmay,

    I broke our issue down to a small example. In short, the switch port drops any VLAN tagged packet on ingress, when configured with systemd-networkd. Despite being configured to use a specific VID.

    Here the networkd configuration. Ingress packets with VID 2 are dropped in swp6.

    > ethtool -S swp6 | grep rx_port_mask_drop
    p0_rx_port_mask_drop: 0
    rx_port_mask_drop: 13

    # switch.netdev
    [NetDev]
    Name=switch
    Kind=bridge
    [Bridge]
    DefaultPVID=1
    VLANFiltering=1
    AgeingTimeSec=1000

    # switch.network
    [Match]
    Name=switch
    [Network]
    VLAN=vlan2
    [BridgeVLAN]
    VLAN=2

    # swp6.network
    [Match]
    Name=swp6
    [Network]
    Bridge=switch
    [BridgeVLAN]
    VLAN=2

    # vlan2.netdev
    [NetDev]
    Name=vlan2
    Kind=vlan
    [VLAN]
    Id=2

    # vlan2.network
    [Match]
    Name=vlan2
    [Network]
    Address=192.168.2.2/24

    > bridge -d vlan show
    port     vlan-id
    swp6   1 PVID Egress Untagged
                   state forwarding mcast_router 1
                2
                   state forwarding mcast_router 1
    switch  1 PVID Egress Untagged
                   state forwarding mcast_router 1
                2
                   state forwarding mcast_router 1


    > ip -d a
    8: swp6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master switch state UP group default qlen 1000
    link/ether 00:60:c8:fe:89:a7 brd ff:ff:ff:ff:ff:ff promiscuity 1 allmulti 1 minmtu 64 maxmtu 1522
    bridge_slave state forwarding priority 32 cost 5 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8001 port_no 0x1 designated_port 32769 designated_cost 0 designated_bridge 8000.9a:9d:c7:19:70:ad designated_root 8000.9a:9d:c7:19:70:ad hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on bcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off locked off numtxqueues 8 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536 portname p6 switchid 000000000c000000 parentbus platform parentdev c000000.ethernet
    10: switch: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 9a:9d:c7:19:70:ad brd ff:ff:ff:ff:ff:ff promiscuity 0 allmulti 0 minmtu 68 maxmtu 65535
    bridge forward_delay 1500 hello_time 200 max_age 2000 ageing_time 100000 stp_state 0 priority 32768 vlan_filtering 1 vlan_protocol 802.1Q bridge_id 8000.9a:9d:c7:19:70:ad designated_root 8000.9a:9d:c7:19:70:ad root_port 0 root_path_cost 0 topology_change 0 topology_change_detected 0 hello_timer 0.00 tcn_timer 0.00 topology_change_timer 0.00 gc_timer 889.53 vlan_default_pvid 1 vlan_stats_enabled 0 vlan_stats_per_port 0 group_fwd_mask 0 group_address 01:80:c2:00:00:00 mcast_snooping 1 no_linklocal_learn 0 mcast_vlan_snooping 0 mcast_router 1 mcast_query_use_ifaddr 0 mcast_querier 0 mcast_hash_elasticity 16 mcast_hash_max 4096 mcast_last_member_count 2 mcast_startup_query_count 2 mcast_last_member_interval 100 mcast_membership_interval 26000 mcast_querier_interval 25500 mcast_query_interval 12500 mcast_query_response_interval 1000 mcast_startup_query_interval 3124 mcast_stats_enabled 0 mcast_igmp_version 2 nf_call_iptables 0 nf_call_ip6tables 0 nf_call_arptables 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536
    11: vlan2@switch: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 9a:9d:c7:19:70:ad brd ff:ff:ff:ff:ff:ff promiscuity 0 allmulti 0 minmtu 0 maxmtu 65535
    vlan protocol 802.1Q id 2 <REORDER_HDR> numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536
    inet 192.168.2.2/24 brd 192.168.2.255 scope global vlan2
    valid_lft forever preferred_lft forever

    Here the script configuration. Ingress packets with VID 2 are handled as expected.

    # script.sh
    #!/bin/bash

    ip link set dev swp6 down
    ip link add name switch type bridge
    ip link set dev switch type bridge ageing_time 1000
    ip link set dev switch type bridge vlan_stats_enabled 1
    ip link set dev switch type bridge vlan_stats_per_port 1
    ip link set dev swp6 up
    ip link set dev swp6 master switch
    ip link set dev switch type bridge vlan_filtering 1 vlan_default_pvid 1
    ip link set dev switch up

    bridge vlan add dev swp6 vid 2
    bridge vlan add dev switch vid 2 self
    ip link add link switch name vlan2 type vlan id 2
    ip link set dev vlan2 up
    ip addr add "192.168.2.2/24" brd "192.168.1.255" dev vlan2


    > bridge -d vlan show
    port     vlan-id
    swp6  1 PVID Egress Untagged
                  state forwarding mcast_router 1
               2
                  state forwarding mcast_router 1
    switch 1 PVID Egress Untagged
                  state forwarding mcast_router 1
               2
                   state forwarding mcast_router 1

    > ip -d a
    8: swp6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master switch state UP group default qlen 1000
    link/ether 00:60:c8:fe:89:a7 brd ff:ff:ff:ff:ff:ff promiscuity 1 allmulti 1 minmtu 64 maxmtu 1522
    bridge_slave state forwarding priority 32 cost 5 hairpin off guard off root_block off fastleave off learning on flood on port_id 0x8001 port_no 0x1 designated_port 32769 designated_cost 0 designated_bridge 8000.6e:2e:47:12:a0:cc designated_root 8000.6e:2e:47:12:a0:cc hold_timer 0.00 message_age_timer 0.00 forward_delay_timer 0.00 topology_change_ack 0 config_pending 0 proxy_arp off proxy_arp_wifi off mcast_router 1 mcast_fast_leave off mcast_flood on bcast_flood on mcast_to_unicast off neigh_suppress off group_fwd_mask 0 group_fwd_mask_str 0x0 vlan_tunnel off isolated off locked off numtxqueues 8 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536 portname p6 switchid 000000000c000000 parentbus platform parentdev c000000.ethernet
    10: switch: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 6e:2e:47:12:a0:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 allmulti 0 minmtu 68 maxmtu 65535
    bridge forward_delay 1500 hello_time 200 max_age 2000 ageing_time 1000 stp_state 0 priority 32768 vlan_filtering 1 vlan_protocol 802.1Q bridge_id 8000.6e:2e:47:12:a0:cc designated_root 8000.6e:2e:47:12:a0:cc root_port 0 root_path_cost 0 topology_change 0 topology_change_detected 0 hello_timer 0.00 tcn_timer 0.00 topology_change_timer 0.00 gc_timer 9.72 vlan_default_pvid 1 vlan_stats_enabled 1 vlan_stats_per_port 1 group_fwd_mask 0 group_address 01:80:c2:00:00:00 mcast_snooping 1 no_linklocal_learn 0 mcast_vlan_snooping 0 mcast_router 1 mcast_query_use_ifaddr 0 mcast_querier 0 mcast_hash_elasticity 16 mcast_hash_max 4096 mcast_last_member_count 2 mcast_startup_query_count 2 mcast_last_member_interval 100 mcast_membership_interval 26000 mcast_querier_interval 25500 mcast_query_interval 12500 mcast_query_response_interval 1000 mcast_startup_query_interval 3124 mcast_stats_enabled 0 mcast_igmp_version 2 nf_call_iptables 0 nf_call_ip6tables 0 nf_call_arptables 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536
    11: vlan2@switch: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 6e:2e:47:12:a0:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 allmulti 0 minmtu 0 maxmtu 65535
    vlan protocol 802.1Q id 2 <REORDER_HDR> numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536
    inet 192.168.2.2/24 brd 192.168.1.255 scope global vlan2
    valid_lft forever preferred_lft forever

    Regards,

    Matthias

  • Hi Matthias,

    I have this configuration which is working on my setup for a bridge with a VLAN interface on top. Can you take a look at this and see if there are any differences in the setup.

    working_network.zip

    Regards,
    Tanmay

  • Hi Tanmay,

    I tried to update my config according to yours and also copied your config to my system. We still see packets with VLAN tag beeing dropped on ingress.

    Do you have any suggestions on how we could further debug our issue? 

    Regards,

    Matthias

  • Hi Matthias,

    Sorry for the delayed response.

    Is this issue still being observed? If so can you give me a diff between my config and your updated config.

    Regards,
    Tanmay