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.

AM3352: Unable to make simple VLAN

Part Number: AM3352
Other Parts Discussed in Thread: DP83848C

Hello. We have a custom AM3352-based design where I have been trying to test VLAN functionality. But I am unable to get it to work. We are using systemd-networkd

Systemd-networkd config files

Here are the essentials of the config files I'm using. I adapted it slightly for the laptop I was using it in.

root@am335x-evm:/etc/systemd/network# cat 10-eth0.network

[Match]
Name=eth0

[Network]
VLAN=comvlan


LinkLocalAddressing=no
LLDP=no
EmitLLDP=no
IPv6AcceptRA=no
IPv6SendRA=no


root@am335x-evm:/etc/systemd/network# cat 20-comvlan.netdev

[NetDev]
Name=comvlan
Kind=vlan

[VLAN]
Id=100

root@am335x-evm:/etc/systemd/network# cat 30-settings.network

[Match]
Name=comvlan

[Network]
DHCP=yes
ConfigureWithoutCarrier=true

[DHCP]
ClientIdentifier=mac



Working test system: Thinkpad X270 with SystemrescueCD 8.05 x86_64

[root@sysrescue ~]# uname -a
Linux sysrescue 5.10.70-1-lts #1 SMP Thu, 30 Sep 2021 09:43:10 +0000 x86_64 GNU/Linux
[root@sysrescue ~]#
[root@sysrescue ~]#
[root@sysrescue ~]# systemctl --version
systemd 249 (249.4-1-arch)
+PAM +AUDIT -SELINUX -APPARMOR -IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified
[root@sysrescue ~]#
[root@sysrescue ~]# ip a show dev comvlan
5: comvlan@enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 54:e1:ad:db:2f:95 brd ff:ff:ff:ff:ff:ff
    inet 172.16.8.109/24 metric 1024 brd 172.16.8.255 scope global dynamic comvlan
       valid_lft 42853sec preferred_lft 42853sec
    inet6 fde4:c20d:5b5::9d5/128 scope global dynamic noprefixroute
       valid_lft 42856sec preferred_lft 42856sec
    inet6 fdc6:55cb:47ce:0:56e1:adff:fedb:2f95/64 scope global mngtmpaddr noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fde4:c20d:5b5:0:56e1:adff:fedb:2f95/64 scope global mngtmpaddr noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::56e1:adff:fedb:2f95/64 scope link
       valid_lft forever preferred_lft forever
[root@sysrescue ~]#
[root@sysrescue ~]#
[root@sysrescue ~]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=58 time=10.0 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=58 time=10.0 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 10.034/10.040/10.046/0.006 ms

Non-working AM3352 system

root@am335x-evm:~#
root@am335x-evm:~# uname -a
Linux am335x-evm 4.19.94-gbe5389fd85 #1 PREEMPT Fri Aug 25 09:49:20 UTC 2023 armv7l GNU/Linux
root@am335x-evm:~#
root@am335x-evm:~#
root@am335x-evm:~# systemctl --version
systemd 239
+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid
root@am335x-evm:~#
root@am335x-evm:~#
root@am335x-evm:~# systemctl start systemd-networkd
root@am335x-evm:~# [ 7188.631916] 8021q: 802.1Q VLAN Support v1.8
[ 7188.659886] net eth0: Adding vlanid 100 to vlan filter
[ 7188.741536] net eth0: initializing cpsw version 1.12 (0)
[ 7188.899513] NS DP83848C 10/100 Mbps PHY 4a101000.mdio:01: attached PHY driver [NS DP83848C 10/100 Mbps PHY] (mii_bus:phy_addr=4a101000.mdio:01, irq=POLL)
[ 7188.953321] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 7188.978688] 8021q: adding VLAN 0 to HW filter on device eth0
[ 7191.049979] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[ 7191.058850] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
root@am335x-evm:~# dmesg | grep cpsw
[    1.222659] cpsw 4a100000.ethernet: No slave[1] phy_id, phy-handle, or fixed-link property
[    1.231163] cpsw 4a100000.ethernet: Missing dual_emac_res_vlan in DT.
[    1.237645] cpsw 4a100000.ethernet: Using 2 as Reserved VLAN for 1 slave
[    1.244487] cpsw 4a100000.ethernet: Detected MACID = 00:12:b0:01:9b:24
[    1.251250] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[    1.257644] cpsw 4a100000.ethernet: ALE Table size 1024
[    1.263005] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
[    1.271379] cpsw 4a100000.ethernet: cpsw: Detected MACID = 20:d7:78:3f:e2:8b
[ 7188.741536] net eth0: initializing cpsw version 1.12 (0)
[ 7191.049979] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
root@am335x-evm:~#
root@am335x-evm:~#
root@am335x-evm:~# ip a show dev comvlan
6: comvlan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:12:b0:01:9b:24 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::212:b0ff:fe01:9b24/64 scope link
       valid_lft forever preferred_lft forever
root@am335x-evm:~#
root@am335x-evm:~#
root@am335x-evm:~# ifconfig comvlan
comvlan   Link encap:Ethernet  HWaddr 00:12:B0:01:9B:24
          inet6 addr: fe80::212:b0ff:fe01:9b24/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:5941 (5.8 KiB)
root@am335x-evm:~#
root@am335x-evm:~#
root@am335x-evm:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
ping: sendto: Network is unreachable

oiojij

Should be noted that without VLAN eth0 works just fine.

Summary

Vlan configuration works on laptop Linux, not on AM335. What am I doing wrong?

I don't need switching capabilities per se; the unit has only one ethernet port. I just need to use the port sometimes as regular eth0 and sometimes with VLAN.

Help?

  • Hi,

    Apologies for the delay I have been out of office. I will do some research on the issue you have posted about. 

    Please tell me about the kernel that you are using is this a kernel from a TI SDK?

    Best Regards,

    Schuyler

  • Thank you for your reply. This is an inherited project I have taken over, information is not readily available. But I'll try to get the information in a couple of days latest.

    Sidenote: I think I see quite a lot of related posts about VLAN situation but nowhere yet a simple explanation/howto.

  • Your request is strait forward, we will look into and provide a how to. I will need a couple of days, I am planning to respond mid next week with a status of our effort.

    Best Regards,

    Schuyler

  • Thank you again. Kernel base is from meta-processor-sdk   = "HEAD:56d9d47f18eeec31a1086ca29e54b5956c46de84", so I think SDK 06.03.

  • Hello again. Do you happen to have anything I could use?

  • Hi,

    One difference I see is the Thinkpad is showing an ip address when doing the device listing but that is not being seen on the AM335 log.  From the Am335 log it looks like the VLAN is created and on eth0. 

    What does ifconfig -a show for interfaces?

    Also what does config-switch -d show? I am assuming this utility is in the filesystem that you are using.

    I will be out of office until the 1st week of Jan.

    Best Regards,

    Schuyler

  • Thank you. I'm wrapping up our Q release, after that I will get back to you.

  • Sorry, I probably posted the wrong system info. I will check and attach the correct ones where I have the vlan settings in.

  • Ok, sorry about the delay. We made also fast feature request delivery.

    Here is output of switch-config -d

    root@am335x-evm:~# switch-config -d
    cpsw hw version 1.12 (0)
    0   : type: vlan , vid = 1, untag_force = 0x3, reg_mcast = 0x3, unreg_mcast = 0x0, member_list = 0x3
    1   : type: mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x1
    2   : type: ucast, vid = 1, addr = 00:12:b0:01:9b:24, ucast_type = persistant, port_num = 0x0, Secure
    3   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    4   : type: mcast, vid = 1, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x1
    5   : type: mcast, vid = 1, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x1
    6   : type: mcast, vid = 1, addr = 33:33:ff:01:9b:24, mcast_state = f, no super, port_mask = 0x1
    7   : type: mcast, vid = 1, addr = 01:80:c2:00:00:00, mcast_state = f, no super, port_mask = 0x1
    8   : type: mcast, vid = 1, addr = 01:80:c2:00:00:03, mcast_state = f, no super, port_mask = 0x1
    9   : type: mcast, vid = 1, addr = 01:80:c2:00:00:0e, mcast_state = f, no super, port_mask = 0x1
    10  : type: mcast, vid = 1, addr = 33:33:00:00:00:fb, mcast_state = f, no super, port_mask = 0x1
    11  : type: mcast, vid = 1, addr = 33:33:00:01:00:03, mcast_state = f, no super, port_mask = 0x1
    12  : type: ucast, vid = 1, addr = 06:73:ed:c6:d9:8a, ucast_type = untouched , port_num = 0x1
    14  : type: ucast, vid = 1, addr = 80:c1:6e:c7:bd:b2, ucast_type = untouched , port_num = 0x1
    18  : type: ucast, vid = 1, addr = 62:fb:d3:a3:4e:cf, ucast_type = untouched , port_num = 0x1
    48  : type: ucast, vid = 1, addr = b0:4a:39:4c:3e:75, ucast_type = untouched , port_num = 0x1

    To make it clear, I have not used vconfig or switch-config to do any configuration. Is some kind of special configuration with switch-config needed? For atomic composability, I'd really want to use systemd-networkd config files (as I do on my desktop).

    The config files are part of otherwise working subsystem integration module and I'd like to keep it that way if the system otherwise works. I'm also prepared to do backport kernel patching if that helps.

  • I have great news! After porting our platform from "thud" (kernel 4.19, systemd 239) to "kirkstone" (kernel 6.1, systemd 250.5+), the ISSUE IS RESOLVED!

    I did not have to use switch-config at all, it is just pure systemd-networkd files now.