TDA4VM: VLAN data routing and forwarding between port1 and host

Part Number: TDA4VM

Tool/software:

Goal: To achieve VLAN data routing and forwarding between port1 and the host,SDK:9.1

status:PC cannot communicate with A72 through port1 and host, using VLAN 10;A72 manual start VLAN virtual network card

Configuration:

Under ethfw

+++ b/ethfw_build_flags.mak
@@ -103,7 +103,7 @@ ETHFW_IPERF_SERVER_SUPPORT?=yes
ETHFW_BOOT_TIME_PROFILING?=no

# Ethfw Demo support
-ETHFW_DEMO_SUPPORT?=no
+ETHFW_DEMO_SUPPORT?=yes

# Support for random MAC Address generation
ETHFW_RAND_MACADDR_GEN?=no
mm.ji@fba2ff4e2c07:~/TE/TDA4/rtos/psdk_rtos_j7/ethfw$ git diff utils/intervlan/src/eth_swintervlan.c
diff --git a/utils/intervlan/src/eth_swintervlan.c b/utils/intervlan/src/eth_swintervlan.c
index 8989390..22a69ef 100644
--- a/utils/intervlan/src/eth_swintervlan.c
+++ b/utils/intervlan/src/eth_swintervlan.c
@@ -180,7 +180,7 @@ static uint32_t CpswApp_receivePkts(void);

CpswApp_Obj gCpswInterVlanAppObj =
{
- .hostMacAddr = {0x02, 0x00, 0x00, 0x00, 0x00, 0x02},
+ .hostMacAddr = {0x02U, 0x03U, 0x04U, 0x05U, 0xDEU, 0x96U},
};

static uint8_t testDstMacAddr[] = {0x00, 0x11, 0x02, 0x00, 0x00, 0x01};
@@ -454,7 +454,7 @@ static int32_t CpswApp_addAleEntries(EnetCfgServer_InterVlanConfig *pInterVlanCf
inArgs.regMcastFloodMask = CpswAppInterVlan_getIngressVlanMembershipMask(pInterVlanCfg);
inArgs.forceUntaggedEgressMask = 0;
inArgs.noLearnMask = 0U;
- inArgs.vidIngressCheck = false;
+ inArgs.vidIngressCheck = true;
inArgs.limitIPNxtHdr = false;
inArgs.disallowIPFrag = false;

@@ -482,7 +482,7 @@ static int32_t CpswApp_addAleEntries(EnetCfgServer_InterVlanConfig *pInterVlanCf
inArgs.regMcastFloodMask = CpswAppInterVlan_getEgressVlanMembershipMask(pInterVlanCfg);
inArgs.forceUntaggedEgressMask = 0;
inArgs.noLearnMask = 0U;
- inArgs.vidIngressCheck = false;
+ inArgs.vidIngressCheck = true;
inArgs.limitIPNxtHdr = false;
inArgs.disallowIPFrag = false;

Under Vision-apps:

--- a/utils/ethfw/src/app_ethfw_freertos.c
+++ b/utils/ethfw/src/app_ethfw_freertos.c
@@ -430,6 +430,22 @@ static EthFwTrace_Cfg gEthApp_traceCfg =
.extTraceFunc = NULL,
};

+#define ETHAPP_VLAN_PORT_MASK (CPSW_ALE_HOST_PORT_MASK | CPSW_ALE_MACPORT_TO_PORTMASK(ENET_MAC_PORT_1))
+
+/* VLAN config */
+static EthFwVlan_VlanCfg gEthApp_vlanCfg[] =
+{
+ {
+ .vlanId = 10U,
+ .memberMask = ETHAPP_VLAN_PORT_MASK,
+ .regMcastFloodMask = ETHAPP_VLAN_PORT_MASK,
+ .unregMcastFloodMask = ETHAPP_VLAN_PORT_MASK,
+ .virtMemberMask = ETHAPP_DFLT_VIRT_PORT_MASK,
+ .untagMask = 0U,
+ },
+};
+
+
void appEthFwEarlyInit()
{
app_rtos_semaphore_params_t semParams;
@@ -677,6 +693,10 @@ static int32_t EthApp_initEthFw(void)
ethFwCfg.virtPortCfg = &gEthApp_virtPortCfg[0];
ethFwCfg.numVirtPorts = ARRAY_SIZE(gEthApp_virtPortCfg);

+ /* Set static VLAN configuration parameters */
+ ethFwCfg.vlanCfg = &gEthApp_vlanCfg[0];
+ ethFwCfg.numVlans = ARRAY_SIZE(gEthApp_vlanCfg);
+
/* Set AUTOSAR virtual port configuration parameters */
ethFwCfg.autosarVirtPortCfg = &gEthApp_autosarVirtPortCfg[0];
ethFwCfg.numAutosarVirtPorts = ARRAY_SIZE(gEthApp_autosarVirtPortCfg);

  • Hi,

    status:PC cannot communicate with A72 through port1 and host, using VLAN 10;

    By default, Port-1 is a MAC-only Port mapped to an A72 Linux client, and we do not add a VLAN property to MAC-only ports by default.

    If you are checking for a switch port interface to communicate over a VLAN, the Linux client needs to register the VLAN with ETHFW. This is not supported by the Linux client in SDK9.1.

    The latest TI SDK has support for registering the VLAN from Linux with ETHFW.

    Best Regards,
    Sudheer