Hi, nxp term. Our custom board architecture consists of an imx8mp-evk and an sja1105P switch chip. The imx8mp's eqos network card is connected to the third port of the switch as the host, and the other four sub-ports are connected to four devices. Each device sends L2 layer data packets. I'm now adding VLAN port isolation to isolate the four sub-ports from each other, but adding VLANs causes the following kernel error.
[ 100.613807] invalid VLAN protocol: 0xdadb
[ 100.617909] WARNING: CPU: 0 PID: 16 at net/8021q/vlan.h:48 vlan_do_receive+0x158/0x3c0
[ 100.625843] Modules linked in:
[ 100.628904] CPU: 0 UID: 0 PID: 16 Comm: ksoftirqd/0 Tainted: G W 6.12.49-g351428da8283-dirty #10
[ 100.639085] Tainted: [W]=WARN
[ 100.642054] Hardware name: NXP i.MX8MPlus EVK board (DT)
[ 100.647368] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 100.654337] pc : vlan_do_receive+0x158/0x3c0
[ 100.658615] lr : vlan_do_receive+0x158/0x3c0
[ 100.662894] sp : ffff8000823f3930
[ 100.666207] x29: ffff8000823f3930 x28: 0000000000000001 x27: ffff8000823f39c0
[ 100.673359] x26: 000000000000a888 x25: 0000000000000000 x24: 0000000000000000
[ 100.680506] x23: 0000000000000000 x22: ffff0000d1388800 x21: ffff0000d096d000
[ 100.687655] x20: ffff8000823f39c0 x19: ffff0000d1388800 x18: 0000000000000006
[ 100.694802] x17: ffff0000d0035900 x16: 0000000000000000 x15: ffff8000823f34ef
[ 100.701954] x14: ffff800082004d40 x13: 626461647830203a x12: 6c6f636f746f7270
[ 100.709102] x11: ffff800082004d40 x10: 0000000000000323 x9 : ffff80008205cd40
[ 100.716251] x8 : 0000000000017fe8 x7 : 00000000fffff000 x6 : ffff80008205cd40
[ 100.723397] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
[ 100.730546] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000d0271140
[ 100.737697] Call trace:
[ 100.740145] vlan_do_receive+0x158/0x3c0
[ 100.744079] __netif_receive_skb_core.constprop.0+0x48c/0x1000
[ 100.749928] __netif_receive_skb_list_core+0xe8/0x220
[ 100.754992] netif_receive_skb_list_internal+0x1a8/0x2c0
[ 100.760313] napi_gro_receive+0xdc/0x1bc
[ 100.764244] gro_cell_poll+0x54/0xa8
[ 100.767824] __napi_poll+0x38/0x180
[ 100.771320] net_rx_action+0x158/0x2c0
[ 100.775079] handle_softirqs+0x100/0x244
[ 100.779011] run_ksoftirqd+0x3c/0x4c
[ 100.782596] smpboot_thread_fn+0x20c/0x234
[ 100.786697] kthread+0x110/0x114
[ 100.789933] ret_from_fork+0x10/0x20
[ 100.793516] ---[ end trace 0000000000000000 ]---This is my device tree.
&eqos {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_eqos>;
phy-mode = "rgmii-id";
status = "okay";
dsa,member = <0 2>;
};
&ecspi1 {
#address-cells = <1>;
#size-cells = <0>;
fsl,spi-num-chipselects = <1>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
// assigned-clocks = <&clk IMX8MP_CLK_ECSPI1>;
// assigned-clock-rates = <&clk IMX8MP_SYS_PLL1_80M>;
cs-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
status = "okay";
sja1105p@0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "nxp,sja1105p";
firmware_name = "sja1105p_cfg.bin"; /// optional
spi-max-frequency = <0x1E8480>; // 25 000 000 0x17d7840 // 2000 000
spi-cpha;
reg = <0x0>;
status = "okay";
dsa,ethernet = <&eqos>;
dsa,num-ports = <5>;
dsa,num-cpu-ports = <1>;
dsa,member = <0 0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "swp1";
phy-mode = "rgmii-id";
rx-internal-delay-ps = <2000>;
tx-internal-delay-ps = <2000>;
fixed-link {
speed = <1000>;
full-duplex;
};
};
port@1 {
reg = <1>;
label = "swp2";
phy-mode = "rgmii-id";
rx-internal-delay-ps = <2000>;
tx-internal-delay-ps = <2000>;
fixed-link {
speed = <1000>;
full-duplex;
};
};
port@2 {
reg = <2>;
label = "cpu";
ethernet = <&eqos>;
phy-mode = "rgmii-id";
rx-internal-delay-ps = <2000>;
tx-internal-delay-ps = <2000>;
fixed-link {
speed = <1000>;
full-duplex;
};
};
port@3 {
reg = <3>;
label = "swp3";
phy-mode = "rgmii-id";
rx-internal-delay-ps = <2000>;
tx-internal-delay-ps = <2000>;
fixed-link {
speed = <1000>;
full-duplex;
};
};
port@4 {
reg = <4>;
label = "swp4";
phy-mode = "rgmii-id";
rx-internal-delay-ps = <2000>;
tx-internal-delay-ps = <2000>;
fixed-link {
speed = <1000>;
full-duplex;
};
};
};
};
};My netplan settings.
network:
version: 2
renderer: networkd
ethernets:
end0:
dhcp4: true
optional: true
swp1: {}
swp2: {}
swp3: {}
swp4: {}
end1: {}
bridges:
br0:
interfaces: [swp1, swp2, swp3, swp4]
dhcp4: no
addresses:
- 172.24.172.10/24
parameters:
stp: false
forward-delay: 0
nameservers:
addresses: [8.8.8.8, 114.114.114.114]My port isolation settings.
#!/bin/bash
ethtool -K end1 rx-vlan-filter off
echo "Enabling VLAN filtering on br0..."
ip link set dev br0 type bridge vlan_filtering 1
echo "Clearing default VLAN 1 from ports..."
bridge vlan del dev br0 vid 1 self
for i in {1..4}; do
bridge vlan del dev swp$i vlan 1
done
echo "Assigning isolated VIDs to ports..."
bridge vlan add dev swp1 vid 11 pvid untagged
bridge vlan add dev swp2 vid 12 pvid untagged
bridge vlan add dev swp3 vid 13 pvid untagged
bridge vlan add dev swp4 vid 14 pvid untagged
echo "Configuring CPU port (br0) to accept all VIDs..."
bridge vlan add dev br0 vid 11 untagged self
bridge vlan add dev br0 vid 12 untagged self
bridge vlan add dev br0 vid 13 untagged self
bridge vlan add dev br0 vid 14 untagged self
bridge vlan add dev br0 vid 10 pvid untagged self
bridge vlan add dev swp1 vid 10
bridge vlan add dev swp2 vid 10
bridge vlan add dev swp3 vid 10
bridge vlan add dev swp4 vid 10Hi,
Thank you for your interest in NXP Semiconductor products,
Can you share your setup schematics? I don't understand the setup with i.MX 8MP EVK and SJA1105 switch.
Share your BSP version, please.
Also, share the results of switch ports network activity without VLAN, are ports active?
Regards