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.

DRA821U: cpsw5g VLAN configuration

Part Number: DRA821U
Other Parts Discussed in Thread: DRA821

Hi ,

We are using TISDK 8.1 uboot + RTOS+ QNX environment.

On 5 port switch we need to:

  • Tag VLAN12 on egress for Port1 and Port4
  • Untag VLAN12 on ingress for port1 and port4
  • Egress packet priority: 6

Could you please let us know the procedure to do this?

Thanks,

Swapna

  • Hi,

    This would require adding VLAN configuration rules to the ALE and Policer on the EthFW side. I will forward query to the team and answer your query.

    Thanks.

  • Thanks Stanley and Praveen!

    We are resolving some setup issues with VLAN tags at our end. Could you please help with follow-up questions

    Questions:

    1) UNTAG ethernet packets on ingress

    • From documentation link 
      • I saw force untag packets on egress but couldn't find one for untagging vlan on ingress. Could you please let me know how to add support for this?

    2 ) How to set egress port priority? 



    Thanks,

    Swapna

  • Swapna,

    I think the problem statement needs to be rephrased in terms of what CPSW supports. Let me try to explain what's supported.

    CPSW supports force untagging on egress.

    For untagged packets at ingress, port's default VLAN determines what VID and PCP values assigned at ingress. This default VLAN/PCP is passed via CpswMacPortCfg which is part of the PortLinkCfg struct:

    CPSW has 3 priority levels:

    So, if you want packets egress with priority 6, you will have to remap the needed priorities to header-packet-piority value of 6.

    Regards,
    -Misa

  • Thanks Misa!

    I have follow up questions for you and praveen based on recommended VLAN settings in code above https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1011237/faq-tda4vm-how-to-configure-cpsw-5g-9g-ale

    We used above example for setting static VLAN12 in RTOS code and on QNX we set up the interfaces as below

    # io-pkt-v6-hc -d cpsw5g p0mac=aabbccddee0a -ptcpip prefix=/alt
    # SOCK=/alt if_up -p an0
    # SOCK=/alt ifconfig vlan12 create
    # SOCK=/alt ifconfig vlan12 vlan 12 vlanif an0 vlanprio 6
    # SOCK=/alt dhclient -nw an0
    # SOCK=/alt dhclient -nw vlan12
    # SOCK=/alt ifconfig


    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33136
    inet 127.0.0.1 netmask 0xff000000
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
    an0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    address: aa:bb:cc:dd:ee:0a
    media: Ethernet none (1000baseT full-duplex)
    status: active
    inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
    inet6 fe80::a8bb:ccff:fedd:ee0a%an0 prefixlen 64 scopeid 0x11
    vlan12: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    vlan: 12 priority: 0 parent: an0
    address: aa:bb:cc:dd:ee:0a
    inet 10.13.169.64 netmask 0xfffffe00 broadcast 10.13.169.255
    inet6 fe80::a8bb:ccff:fedd:ee0a%vlan12 prefixlen 64 scopeid 0x12

    Able to ping 8.8.8.8 and gateway 10.13.168.1 but pinging other DRA821 PCBA on same subnet with same SW changes(different mac) failed.

    We can see broadcast messages for PCBA1 on network but tcpdump on PCBA2 couldn't see ICMP BCAST messages.

    # SOCK=/alt ping 8.8.8.8
    PING 8.8.8.8 (8.8.8.8): 56 data bytes
    64 bytes from 8.8.8.8: icmp_seq=0 ttl=110 time=8 ms
    64 bytes from 8.8.8.8: icmp_seq=1 ttl=110 time=8 ms
    64 bytes from 8.8.8.8: icmp_seq=2 ttl=110 time=7 ms
    64 bytes from 8.8.8.8: icmp_seq=3 ttl=110 time=8 ms

    # SOCK=/alt ping 10.13.169.1
    PING 10.13.169.1 (10.13.169.1): 56 data bytes
    64 bytes from 10.13.169.1: icmp_seq=0 ttl=64 time=0 ms
    64 bytes from 10.13.169.1: icmp_seq=1 ttl=64 time=0 ms

    # SOCK=/alt ping 10.13.169.61
    PING 10.13.169.61 (10.13.169.61): 56 data bytes
    ping: sendto: Host is down

    ALE Table:

    0: Vlanid: 012c, UTagged: 1ff, Mult: 1ff, UMult: 0, Member: 1ff RAW:[0 212c1ff1 ff0001ff]
    1: Vlanid: 0001, UTagged: 13, Mult: 13, UMult: 0, Member: 13 RAW:[0 20010130 13000013]
    2: Vlanid: 0191, UTagged: 1ff, Mult: 1ff, UMult: 0, Member: 1ff RAW:[0 21911ff1 ff0001ff]
    3: Vlanid: 0192, UTagged: 1ff, Mult: 1ff, UMult: 0, Member: 1ff RAW:[0 21921ff1 ff0001ff]
    4: Address: ffffffffffff, Member:01f Su=0 FWDSTLVL=0 IGNMBITS=0 RAW:[7c 1000ffff ffffffff]
    5: Address: 70ff761d92c2, Port: 000 Se=1 Bl=0 TOUCH=0 AGE=0 TRUNK=0 RAW:[1 100070ff 761d92c2]
    6: EtherType: 0806 RAW:[1 20000000 00000806]
    7: Address: aabbccddee01, Port: 000 Se=1 Bl=0 TOUCH=0 AGE=0 TRUNK=0 RAW:[1 1000aabb ccddee01]
    8: Vlanid: 000c, UTagged: 0, Mult: 13, UMult: 13, Member: 13 RAW:[0 200c0130 00013013]
    16: Address: 68ff7b11bfa9, Port: 001 Se=0 Bl=0 TOUCH=0 AGE=1 TRUNK=0 RAW:[4 500168ff 7b11bfa9]
    17: Address: 00187475f600, Port: 001 Se=0 Bl=0 TOUCH=0 AGE=1 TRUNK=0 RAW:[4 500c0018 7475f600]
    33: Address: aabbccddee04, Port: 001 Se=0 Bl=0 TOUCH=0 AGE=1 TRUNK=0 RAW:[4 5001aabb ccddee04]
    34: Address: 00307b3700c1, Port: 001 Se=0 Bl=0 TOUCH=1 AGE=1 TRUNK=0 RAW:[4 d00c0030 7b3700c1]

    Would you help us understand why would this happen or if any of the above settings don't look correct?

    • Looks like devices on same subnet with VLAN tags enabled cannot ping each other ( Broadcast traffic doesn't get passed through A72 )? 
      • Documentation for SDK 8.1 says broadcast/shared multicast uses intercore virtual ethernet driver and broadcast traffic is routed from R5F_0 to other cores are there any filters based on subnet or should it be enabled from remote clients somewhere in code?
    • Please advise if TI has evaluated such usecase with VLAN's on same subnet using TISDK 8.1 QNX+RTOS image? This is gating our customer development and would appreciate your response.

    Thank You,

    Swapna 

  • Sapna

    Can you help summarize the exact use case needs.

    I see double headed arrows between PCB1<-->PCB3 and PCB2<-->PCB3, does this imply ping in both directions are working . and in case of PCB1-->PCB2, uni-directional ping fails.

    Is the QNX/VLAN SW configuration and ALE configuration identical across all the 3 instances of DRA821. For the ping traffic do you expect the traffic on the wire between the PCBs to be vlan tagged.

    Is any of the ping traffic passing through the vlan tagged switch and what is configuration at the switch side for such traffic.

    I feel the overall usage of vlan/subnet partitioning is not well understood in this case.

    The very purpose of using VLAN is restrict the broadcast domain - traffic including broadcast/multicast is confined to the respective VLANs alone and not forwarded outside the VLAN. The general usage model is to group nodes under a subnet using a specific VLAN ID

    Can you review your use case needs from VLAN partitioning and usage perspective

    Regards

    sriram

  • Thanks Sriram!

    • Please find the answers below

    All PCBA's above have the same SW loaded

    I see double headed arrows between PCB1<-->PCB3 and PCB2<-->PCB3, does this imply ping in both directions are working . and in case of PCB1-->PCB2, uni-directional ping fails.

    • Ping between PCBA1 and PCBA2 does not work in both directions

    Is the QNX/VLAN SW configuration and ALE configuration identical across all the 3 instances of DRA821. For the ping traffic do you expect the traffic on the wire between the PCBs to be vlan tagged.

    • Correct the traffic is always VLAN tagged

    Is any of the ping traffic passing through the vlan tagged switch and what is configuration at the switch side for such traffic.

    • Yes, the traffic is passing through the external VLAN tagged switch

    Follow up questions:

    We can fix this problem by adding a static entry in the arp cache " arp -s 10.13.169.x aa:bb:cc:dd:ee:0x" on PCBA1 and PCBA2 but need permanent solution.

    • I think the VLAN traffic with broadcast frames is not passing through the cpsw5g switch . Could you please review the ALE table and tell us if we need a separate entry for broadcast addresses with VLAN tags? Currently, we see

                             4: Address: ffffffffffff, Member:01f Su=0 FWDSTLVL=0 IGNMBITS=0 RAW:[7c 1000ffff ffffffff]

    • Can we have two broadcast addresses entry in ALE table one for non vlan traffic and other for VLAN traffic as below

                             4: Address: ffffffffffff, Member:01f Su=0 FWDSTLVL=0 IGNMBITS=0 RAW:[7c 1000ffff ffffffff]

                             5. Vlanid: 000c,  Address: ffffffffffff, Member:01f Su=0 FWDSTLVL=0 IGNMBITS=0 RAW:[x]

    If so, Please share a sample code on how to achieve this

    Thanks,

    Swapna

  • Any update on this request please?

  • Hi Swapna,

    As you may know, ARP request packets are handled by Ethernet Firmware on behalf of the remote clients (like QNX virtual client driver) which had registered their MAC address + IP address pair.

    This is implemented as follows:

    1. In hardware - using an ALE classifier to route ARP packets to an UDMA RX flow allocated by Ethernet Firmware solely for ARP traffic. I have verified this, and packets with and without VLAN are being routed to this RX flow.

    2. In software - packets received on this RX flow are passed to Enet LLD's lwIP adaptation layer, which ultimately passes the lwIP pbuf corresponding to the ARP request packet to EthFw for it to respond. This stage is described here: https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/08_02_00_05/exports/docs/ethfw/docs/user_guide/ethfw_c_ug_top.html

    To prove this theory, you can try rebuilding EthFw with ETHFW_CALLBACKS_DEBUG (ethfw/utils/ethfw_callbacks/src/ethfw_callbacks_lwipif.c). This will print a message for each ARP packet being received, and also will print a message if an response was sent. I believe you are going to see both prints.

    Now, the problem is that the ARP response sent in step 2 is VLAN untagged, so the response doesn't reach the original sender. This needs VLAN support enabled in lwIP (lwipopts.h) and EthFw needs to be able to pass the appropriate VLAN id in the response, etc. At this point I'm not sure if additional steps will be needed.

  • Thanks Misa! 

    Step 2)

    I enabled this Flag and see LWIP layer is receiving ARP messages but no response.

    Received ARP dstIp 0.0.0.0, dstMac ff:ff:ff:ff:ff:ff
    Received ARP dstIp 0.0.0.0, dstMac ff:ff:ff:ff:ff:ff
    Received ARP dstIp 0.0.0.0, dstMac ff:ff:ff:ff:ff:ff
    Received ARP dstIp 0.0.0.0, dstMac ff:ff:ff:ff:ff:ff
    Received ARP dstIp 0.0.0.0, dstMac ff:ff:ff:ff:ff:ff

    As mentioned in setup above we are using two DRA821 PCBA's connected to same VLAN12 tagged switch and pinging from PCBA1 to PCBA2 when we see this issue. ( TISDK 8.1 QNX+RTOS )

    I tried enabling VLAN support in lwipopts.h as below but this didn't help

    #define ETHARP_SUPPORT_VLAN     1

    To workaround this issue we added an entry in ALE table as below but I think this might break non vlan broadcast traffic.

    Vlanid: 000c,  Address: ffffffffffff, Member:01f Su=0 FWDSTLVL=0 IGNMBITS=0 RAW:[x]

    Please let us know if there is anything we can check from our side to investigate this issue further



  • Hi Misa,

    The workaround mentioned below to add VLAN entry for broadcast traffic works for VLAN12 traffic 

    "Vlanid: 000c,  Address: ffffffffffff, Member:01f Su=0 FWDSTLVL=0 IGNMBITS=0 RAW:[x]"

    Could you please advise if TI was able to reproduce broadcast message issue on same subnet with vlan tags at your end?

    There is a comment in ethfw document about broadcast packets

    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-j7200/08_02_00_05/exports/docs/ethfw/docs/user_guide/ethfw_c_ug_top.html#ethfw_mcast_support

    Broadcast support is automatically enabled through inter-core virtual Ethernet mechanism which allows sending broadcast traffic to all the client cores, provided that inter-core virtual Ethernet is enabled on that client.

    Could you please let us know if this is true for QNX SDK 8.1?

    Currently we see this support is disabled in QNX in ethfw/ethfw_build_flags.mak

    ifneq (,$(filter yes,$(BUILD_CPU_MCU2_0) $(BUILD_CPU_MCU2_1)))
    ifeq ($(BUILD_QNX_A72),yes)
    ETHFW_INTERCORE_ETH_SUPPORT?=no
    else
    ETHFW_INTERCORE_ETH_SUPPORT?=yes
    endif
    endif

    We need to pass broadcast messages on non vlan traffic and this will not work with the above workaround and need support from TI to resolve this issue.

    Thank you,

    Swapna

  • Hi Swapna,

    ETHFW intercore functionality is supported on select remote client OSes: RTOS and Linux. QNX and AUTOSAR remote clients do not support EthFw intercore.

    Unfortunately, this asked feature needs VLAN support while handling proxy ARP packets which our SW does not support. We will get back to you when such a feature would be available in our SW, but currently I don't have a date to share with you.

  • Thank you! please update this thread when you have more information.