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.

TDA4VM: Does vconfig support cpsw9G to set vlan?

Part Number: TDA4VM

Dear experts

I use port 1 of CPSW9G module to send and receive data.  It Corresponds to the A72 virtual mac Eth1. It works fine.

Can I use vconfig to set up the VLAN for Eth1?  

sudo vconfig add eth1 100

sudo ifconfig eth1.100  192.168.1.3 netmask 255.255.255.0 up

Show that I have created it successfully

root@j7-evm:~# ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:ad:ee:89:dc  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 127.172.2.2  netmask 255.0.0.0  broadcast 127.255.255.255
        inet6 fe80::72ff:76ff:fe1d:92c1  prefixlen 64  scopeid 0x20<link>
        ether 70:ff:76:1d:92:c1  txqueuelen 1000  (Ethernet)
        RX packets 180  bytes 41861 (40.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 67  bytes 10396 (10.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1.100: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.1.3  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::72ff:76ff:fe1d:92c1  prefixlen 64  scopeid 0x20<link>
        ether 70:ff:76:1d:92:c1  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 36  bytes 6706 (6.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

But I set the PC's Vlan ID to 100 and  ping to a72 didn't work.

Am I doing this right ?

  • Hi,

    As you are using Ethfw with virtual mac on linux, it doesn't support vconfig or any iproute2 based vlan tools. You will need to add the vlan entry in ethfw. You can have a look at this FAQ on pointers for the same..

    If you want to use the linux tools to configure CPSW, you can consider moving the ethernet controller to native linux driver option available. You can more details for this here.

    Regards,
    Tanmay

  • Hi

    Thank you very much for your reply,
    I followed your FAQ to patch  my code ,and add vlan 100.
    And then verify ale entries.
    It's got entry with a VLAN ID 100. As following:

     Entry 13 - VLAN INNER 
    ---------------------------------------------
    ENTRY_TYPE        = 2
    IVLAN_ID           = 100
    NO FRAG           = 0
    REG_MCAST_FLOOD   = 3
    VLAN FWD Untagged Egress = 48
    LMT NEXT HDR      = 0
    UNREG_MCAST_FLOOD = 3
    VLAN_MEMBER_LIST  = 3

    Do I still use ETH1 to ping PC (192.168.1.2)?   I still can't Ping  PC Which has VLAN ID 100.

    This packets I grabbed on the A72. 

    12:32:54.863008 IP (tos 0x0, ttl 64, id 5136, offset 0, flags [DF], proto ICMP (1), length 84)
        j7-evm > 192.168.1.2: ICMP echo request, id 65030, seq 97, length 64
            0x0000:  00e0 4c85 0aec 70ff 761d 92c1 0800 4500
            0x0010:  0054 1410 4000 4001 a343 c0a8 0103 c0a8
            0x0020:  0102 0800 7d8e fe06 0061 5527 26e2 0000
            0x0030:  0000 0000 0000 0000 0000 0000 0000 0000
            0x0040:  0000 0000 0000 0000 0000 0000 0000 0000
            0x0050:  0000 0000 0000 0000 0000 0000 0000 0000
            0x0060:  0000
    12:32:55.703739 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has j7-evm tell 192.168.1.2, length 46
            0x0000:  ffff ffff ffff 00e0 4c85 0aec 8100 0064
            0x0010:  0806 0001 0800 0604 0001 00e0 4c85 0aec
            0x0020:  c0a8 0102 0000 0000 0000 c0a8 0103 0000
            0x0030:  0000 0000 0000 0000 0000 0000 0000 0000
    12:32:55.863128 IP (tos 0x0, ttl 64, id 5219, offset 0, flags [DF], proto ICMP (1), length 84)
        j7-evm > 192.168.1.2: ICMP echo request, id 65030, seq 98, length 64
            0x0000:  00e0 4c85 0aec 70ff 761d 92c1 0800 4500
            0x0010:  0054 1463 4000 4001 a2f0 c0a8 0103 c0a8
            0x0020:  0102 0800 b84a fe06 0062 0b6a 35e2 0000
            0x0030:  0000 0000 0000 0000 0000 0000 0000 0000
            0x0040:  0000 0000 0000 0000 0000 0000 0000 0000
            0x0050:  0000 0000 0000 0000 0000 0000 0000 0000

  • Hi,

    Can you please confirm that VLAN interface is created in A72 with same VLAN ID (100 as per above).

    If so, we expect ARP response from A72 and the same should be captured in above log.

    Best Regards,
    Sudheer

  • Yes, I used vconfig to setup ethh1.100

    sudo vconfig add eth1 100

    sudo ifconfig eth1.100 192.168.1.3 netmask 255.255.255.0 up

  • Hi Ling,

    Yes, I used vconfig to setup ethh0.100

    Can you please confirm you have added Tag for eth0 or eth1?Please add Vlan to the Virtual switch port interface.

    Also, can you please share the tcpdump on eth1 and eth1.100 along with Wireshark capture on PC.

    Also, please share the CPSW statistics while pinging. Please refer to FAQ [How to get CPSW Ethernet Statistics] for collection of CPSW statistics.

    Best Regards,
    Sudheer

  • HI Doredla

    Because this is a port of CPSW 9G, corresponding to virtual eth1.
    if I add a VLAN entry in ethfw, do I need to use vconfig to create Eth1.100?

    Thanks a lot for your help! 

  • Hi Ling,

    if I add a VLAN entry in ethfw, do I need to use vconfig to create Eth1.100?

    Yes, Virtual Ethernet driver in Linux will not know about VLAN added in ethfw. So, we have to create VLAN entry in Virtual eth1 using vconfig.

    Also, IP address of VLAN interface will not be notified to the Ethfw from Virtual Ethernet driver as the driver doesn't support VLAN plugins from Network layer in Linux.
    So, above creating VLAN entry for the sake of network stack to understand VLAN entry is on this eth1 and the entry added in Ethfw is for CPSW to indicate VLAN entry being created.

    Best Regards,
    Sudheer

  • Thank you for your patient response, I really appreciate it.

    Thanks