Switch ports swp0-3 not working on LS1028ARDB w/LS SDK 1909

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Switch ports swp0-3 not working on LS1028ARDB w/LS SDK 1909

1,014 Views
trp
Contributor I

Hello,

The title says it all ..

We have managed to get eno0 to work; however the switch ports are all DOWN. We have followed all the instructions in the LS SDK 1909 manual.

We did not have the same problem with BSP 0.3.

How do we fix this?

Regards,

Tom Roar

Labels (1)
Tags (3)
0 Kudos
Reply
1 Reply

922 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the section "L2Switch configuration examples" in LSDK 1909 user manual to configure l2switch.

Please refer to the following test log.

root@localhost:~# #!/bin/bash
root@localhost:~# #
root@localhost:~# # Simple switch configuration
root@localhost:~# #
root@localhost:~# # Assume both ENETC and Felix drivers are already loaded
root@localhost:~# #
root@localhost:~#
root@localhost:~# BRIDGE=br0
root@localhost:~# MAC_ROOT=bc:8d:bf:7c:5b
root@localhost:~# SW_NETNS=swns
root@localhost:~# EXEC_SWNS="ip netns exec $SW_NETNS"
root@localhost:~#
root@localhost:~# # Create bridge namespace
root@localhost:~# ip netns add $SW_NETNS
root@localhost:~# # Create bridge device in net namespace
root@localhost:~# $EXEC_SWNS ip link add name $BRIDGE type bridge
root@localhost:~# $EXEC_SWNS ip link set $BRIDGE up
root@localhost:~#
root@localhost:~# # Configure switch ports
root@localhost:~# # * set MAC address
root@localhost:~# # * bring up interface
root@localhost:~# # * move net device into the bridge net namespace
root@localhost:~# # * set bridge device as master
root@localhost:~# swps=($(ls /sys/bus/pci/devices/0000:00:00.5/net/))
root@localhost:~# nr=${#swps[@]}
root@localhost:~# for (( i=0; i<$nr; i++ ))
> do
> echo "adding ${swps[$i]} to brigde .."
> ip link set ${swps[$i]} address $MAC_ROOT:$(echo "${swps[$i]}" | tr -dc '0-9')
> ip link set ${swps[$i]} netns $SW_NETNS
> $EXEC_SWNS ip link set ${swps[$i]} master $BRIDGE
> $EXEC_SWNS ip link set ${swps[$i]} up
> done
adding swp0 to brigde ..
adding swp1 to brigde ..
adding swp2 to brigde ..
adding swp3 to brigde ..
adding swp4 to brigde ..
adding swp5 to brigde ..
root@localhost:~#
root@localhost:~# # bring up ENETC ports connected to switch ports
root@localhost:~# enetc2=$(ls /sys/bus/pci/devices/0000:00:00.2/net/)
root@localhost:~# ip link set $enetc2 up
root@localhost:~#
root@localhost:~# # move ENETC port connected to switch CPU port in bridge ns
root@localhost:~# enetc3=$(ls /sys/bus/pci/devices/0000:00:00.6/net/)
root@localhost:~# ip link set $enetc3 netns $SW_NETNS
root@localhost:~# $EXEC_SWNS ip link set $enetc3 up
root@localhost:~#
root@localhost:~# # Check configuration
root@localhost:~# $EXEC_SWNS bridge link show
6: swp0 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1468 master br0 state disabled priority 32 cost 100
7: swp1 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1468 master br0 state disabled priority 32 cost 100
8: swp2 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1468 master br0 state disabled priority 32 cost 100
9: swp3 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1468 master br0 state disabled priority 32 cost 100
10: swp4 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1468 master br0 state disabled priority 32 cost 100
11: swp5 state DOWN : <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1468 master br0 state disabled priority 32 cost 100
root@localhost:~# ip netns exec swns ifconfig swp0
swp0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether bc:8d:bf:7c:5b:00 txqueuelen 1000 (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

root@localhost:~# ip netns exec swns ifconfig swp0 up
root@localhost:~# ip netns exec swns ifconfig swp0
swp0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::be8d:bfff:fe7c:5b00 prefixlen 64 scopeid 0x20<link>
ether bc:8d:bf:7c:5b:00 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 200 (200.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

0 Kudos
Reply