Tool/software:
Hi Expert,
SOC:AM3352
SDK:06_03_00_106
Linux Kernel:4.19.94
The customer board has two LAN ports, so the device tree is set to dual emac, and the default VIDs are 1 and 2 respectively.
When setting up a VLAN, the VLAN interface (such as eth0.100) generated by using the vconfig add command can send VLAN packets normally.
However, when setting VLAN ID 0 (such as eth0.0), the packets sent will not carry VLAN tags, but in applications, packets with VLAN ID 0 but with priority tags will be required.
CPSW driver's default default VLAN vid=0 is untagged.
Is there a way to make eth0.0 carry VLAN tag vid=0, but the packets sent by eth0 do not carry VLAN tag?
CPSW The following code sets VID 0 as the default VLAN
static int cpsw_ndo_open(struct net_device *ndev)
{
....
/* Add default VLAN */
if (!cpsw->data.dual_emac)
cpsw_add_default_vlan(priv);
else
cpsw_ale_add_vlan(cpsw->ale, cpsw->data.default_vlan,
ALE_ALL_PORTS, ALE_ALL_PORTS, 0, 0);
}
If the default vlan (vid = 0) is not set, then generally the packets entering and exiting eth0 and eth1 will carry the vlan tag of vlan vid=0
But what the customer wants is that eth0 and eth1 do not have tags, but the new eth0.0 added by vconfig has the tag of vlan vid=0
Because CPSW dual emac mode must require VLAN to distinguish port0/port1, and the default vlan is vid=0
Can the functions requested by customers be realized?
Thanks
Daniel