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.

[FAQ] TDA4VM: How do I configure/enable port mirroring in CPSWnG?

Part Number: TDA4VM

How do I configure/enable port mirroring in CPSWnG?

  • CPSWnG ALE supports three mirroring methods. Destination port, Source port, and ALE Table entry mirroring.

    Destination port mirroring:
    Destination port mirroring allows packets to a particular egress destination port to be mirrored to another egress destination port. 
    For example, any traffic from any port that is switched to Port 'A' can be mirrored to Port 'B' (The packets sent out/egress from Port A will also egress on Port B).

    Source port mirroring:
    Source port mirroring allows packets received on any enabled ingress source port to be switched to the mirror egress port as well as the actual egress destination port.
    For example, traffic received on ingress port 'A' can be egress port 'B' as well as the intended egress destination port (The packets received from Port-A will be egress on Port B).

    ALE Table entry mirroring:
    ALE table entry mirroring allows for any MAC Address, MAC Address with VLAN, OUI Address, VLAN entry, ether type, and IP Address that matches on ingress to be switched to the egress destination (mirror) as well as the actual egress destination.

    Please refer to the Technical Reference Manual on the SOC Page, for more details,

    This FAQ provides a sample reference code based on Ethernet Firmware for the configuration of porting mirroring options like destination port, and source port mirroring.

    ALE Table entry mirroring will need ALE entries So, static configuration of ALE table mirroring is not possible before ALE entries are available, whereas port (destination/source) mirroring can be enabled as it has no dependency.

    We have supportive IOCTL calls from Ethernet Firmware for configuring the Port Mirroring. Dynamic configuration of port mirroring is not supported by SDK.

    Destination port mirroring:
    Please refer to the below patch, which provides a reference for mirroring Port-3 traffic to Port-1 (whatever packets are sent out/egress from Port-3 will also egress from port-1).

    Patch: (SDK: ti-processor-sdk-rtos-j721e-evm-08_06_00_12)
    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0001_2D00_Enabled_2D00_Destination_2D00_Port_2D00_mirroring_2D00_example_2D00_from_2D00_Port_2D00_3_2D00_to_2D00_Port_2D00_1.patch

    Sample Output with the above test:

    Source port mirroring:
    Please refer to the below patch, which provides a reference for mirroring of Port-3 input/ingress traffic to Port-1 (whatever packets received/ingress on Port-3 will egress from port-1)

    Patch: (SDK: ti-processor-sdk-rtos-j721e-evm-08_06_00_12)
    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0001_2D00_Enabled_2D00_Source_2D00_Port_2D00_mirroring_2D00_example_2D00_from_2D00_Port_2D00_3_2D00_to_2D00_Port_2D00_1.patch

    Sample Output with above test:


    Best Regards,
    Sudheer

  • If some one want to enable both Source port mirroring and Destination port mirroring, have to enable configuration of both destination and source port mirroring for both Ingress and Egress mirroring of one port to other Port.