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.

TMDSSK3358: Change ethernet mode from Dual MAC mode to switch mode at run time

Part Number: TMDSSK3358


Hello,

I am using linux-5.13.4 kernel with TMDSSK3358, and tried to change the ethernet dual mac mode to switch mode at run time.

I tried devlink command with console log:

# devlink dev param set platform/4a100000.switch name switch_mode value 1 cmode runtime
[ 198.675991] cpsw-switch 4a100000.switch: Enable switch mode

Port 1 was connected to my LAN, and Port 2 connected to a PC, Port 0 and Port 2 both assigned normal IP address from LAN DHCP server, but I can't ping between Port 0 and Port 2, Port 1 to Port 2 and Port0 to Port1 are work normally.

Are there any additional configurations needed in order to work with switch mode ?

Thanks
Jeffy 

  • Hi

    I'm not sure I understand why do you refer to Port0? Port0 is invisible for you in general. Also, when you enable switch-mode it's expected that you will setup bridge.

    Can you provide "ip addr show" output, pls?

  • Hello Jeffy,

    Also, please note that TI has only released up through Linux 5.4 in AM335x SDKs so far (AM335x Linux SDK 7.3 released earlier this year). At this point in time, we have not tested anything on AM335x for Linux kernel 5.10 or 5.13.

    Regards,

    Nick

  • Hi Grygorii,

    Here Port0 is the host port which represents TMDSSK3358, I can't ping from the device connects to Port 2 to TMDSSK3358.

    Please check the output

    # ip addr show
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defaul t qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
    valid_lft forever preferred_lft forever
    2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
    3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group defa ult qlen 1000
    link/ether 00:18:31:e7:98:2f brd ff:ff:ff:ff:ff:ff
    inet 10.177.75.204/24 brd 10.177.75.255 scope global eth0
    valid_lft forever preferred_lft forever
    inet6 fe80::218:31ff:fee7:982f/64 scope link
    valid_lft forever preferred_lft forever
    4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group defa ult qlen 1000
    link/ether 00:18:31:e7:98:30 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::218:31ff:fee7:9830/64 scope link
    valid_lft forever preferred_lft forever

  • Hi Nick,

    Thank you for your note.

    Is there any approach that change the switch mode in runtime from dual mac mode?

    Thanks

  • Hi,

    I will need to check with a team member to answer your question. As Nick pointed out though you are using a kernel version that is not supported by TI currently. Would be consider moving to TI latest released SDK for the AM335x? Are you using a custom board?

    Best Regards,

    Schuyler

  • TMDSSK3358-SK board, official SDK is too big to use.

  • hi

    I have strong feeling the you misunderstanding switch mode. you can find existing driver documentation in Linux Kernel mainline (hence it is not yet part of TI SDK):  

    https://www.kernel.org/doc/html/latest/networking/device_drivers/ethernet/ti/cpsw_switchdev.html

    You, most probably, assume that as in the old driver it enough to assign  one IP to one port to have IP working between all ports - external (1,2) and internal (0), but this is not true for switchdev/bridge concept in Linux - without bridge setup, in switch mode, CPSW eth0 and eth1 will basically work the same way as in  dual_mac mode (but with unconditional forwarding mode enabled - not standard mode).

    In you case, IP assigned to eth0 (ext.port 1), but you trying to ping from host attached to eth1 (ext.port 2).

    Comparing to old driver (non standard Linux switchdev mode implementation) - the switchdev driver represents every external port as separate network device (see it as to network card inserted into the regular PC), which can be enslaved to bridge and so benefit from exiting standard Linux bridge configuration interfaces (iproute2: ip, bridge) and features.