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.
你(们)好
我们有一个定制的J721E板。 CPSW2G,CPSW9G和SGMII PHY之间的连接如结构图所示。
要求将CPSW2G (am65_cpsw_Nuss驱动程序)之间的流量转发到CPSW9G上的SGMII端口。
我已经介绍了以下内容
问题:
1.是否可以通过修改am65_cpsw_nuss驱动程序和ethfw将数据包从无源CPSW2G数据包转发到CPSW9G?
如果1为真
* am65_cpsw_nuss和虚拟Mac驱动程序是否可以共存? 虚拟Mac与SGMII (CPSW9G)之间的通信不应受到影响。
*我们是否需要将两个MAC (RGMII和SGMII)都设置为转发(ALE)模式?
* MAC端口是否可以转发到多个端口?
*如何转储ALE表条目以验证我们是否已正确编程?
谢谢!
Vishal
这是对DTS所做的更改,以使cpsw2g不植物性。
diff --git a/arch/ARM64/boot/DTS/ti/K3-j721e-common-proc-board.DTS b/arch/ARM64/boot/DTS/ti/K3-j721e-common-proc-board.DTS
索引353.0984万a3..03a4d8c2d 10.0644万
-- a/arch/ARM64/boot/DTS/ti/k3-j721e-common-proc-board.dts
++ b/arch/ARM64/boot/DTS/ti/k3-j721e-common-proc-board.dts
@@-7.5824万 + 7.5815万 @@
};
&MCU_cpsw{
- 状态="已禁用";
pinctrl-names ="default";
- pinctrl-0 =<&MCO_cpsw_PINS_DEFAULT &MCU_MDIO_PINS_DEFAULT>;
-};
-
-&DaVinci MDIO {
- phy0:ethernet-phy@0 {
- 状态="已禁用";
- reg =<0>;
- ti,rx-internal-delay =<DP8.3867万_RGMIIDCTL_2_00_NS>;
- ti,fifo-depth =<DP8.3867万_PHYCR_FIFO_DEPTY_4_B_NIB>;
-};
};
&cpsw_port1{
- 状态="已禁用";
PHY模式="RGMII-rxid";
- phy-handle =<&phy0>;
+ 固定链接{
+ 速度=<1000>;
+ 全双工;
+ };
};
更新:ethtool -S eth0
在cpsw2g中看到这些滴落
RX_ALIGIN_CODE_ERRORS:1507
RX_PORT_MASK_DROP:1507
CPSW2g ALE表
根@J7-EVM:~# switch-config -d
K3 cpsw转储版本(1) len(6328)
Ale table dump ents (64):
0 :类型:vlan,vid =0,untag_force = 0x3,reg_mcast = 0x0,unreg_mcast = 0x0, MEMBER_LIST = 0x3
1 :type:ucast,addr = 24:76:25:9a:0e:28,ucast类型= persistant,port_num = 0x0,Secure
2 :类型:mcAST,vid = 0,addr = ff:ff:ff:ff:ff,mcast_state = f,no super, port_mask = 0x3
3 :类型:mcAST,addr = 33:33:00:00:00:01,mcast_state = f,no super,port_mask = 0x1
4 :类型:mcAST,addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x1
5 :类型:mcast,addr = 33:33:ff:9a:0e:28,mcast_state = f,no super, port_mask = 0x1
6 :类型:mcAST,addr = 01:80:C2:00:00:00,mcast_state = f,no super,port_mask = 0x1
7 :类型:mcAST,addr = 01:80:C2:00:00:03,mcast_state = f,no super,port_mask = 0x1
8 :类型:mcAST,addr = 01:80:C2:00:00:0e,mcast_state = f,no super,port_mask = 0x1
9 :类型:mcAST,addr =33:33:00:00:00:fb,mcast_state = f,no super, port_mask =0x1
10 :类型:mcAST,addr = 01:00:5e:00:00:fb,mcast_state = f,no super,port_mask = 0x1
已在CPSW_PN_MAC_CONTINT_REG寄存器和捕获的数据包中启用'RX_CEF_EN'。 附加Wireshark跟踪。
04:08:24.33.3322万 ARP,以太网(len 6),IPv4 (len 4),请求谁拥有10.1。1.3 告诉10.1。1.100 ,长度28
04:08:24.33.3558万 ARP,以太网(len 6),IPv4 (len 4),回复11.1。1.3 状态为D8:CB:8a:0e:91:9b (oui未知),长度51
04:08:25.35.3499万 ARP,以太网(len 6),IPv4 (len 4),请求谁拥有10.1。1.3 告诉10.1。1.100 ,长度28
04:08:25.35.373万 ARP,以太网(len 6),IPv4 (len 4),回复11.1。1.3 状态为D8:CB:8a:0e:91:9b (oui未知),长度51
04:08:26.37.7496万 ARP,以太网(len 6),IPv4 (len 4),请求谁拥有10.1。1.3 告诉10.1。1.100 ,长度28
04:08:26.37.778万 ARP,以太网(len 6),IPv4 (len 4),回复11.1。1.3 状态为D8:CB:8a:0e:91:9b (oui未知),长度51
04:08:28.33.365万 ARP,以太网(len 6),IPv4 (len 4),请求谁拥有10.1。1.3 告诉10.1。1.100 ,长度28
您好,Vishal,
首先,我想确保我正确理解您的要求。
我假设您在同一J721E上有2个外部RGMII端口,一个来自CPSW2G,另一个来自CPSW9G。
现在,您尝试在MAC到MAC模式下通过外部连接从CPSW2G RGMII端口连接到CPSW9G RGMII端口。
然后,您要从CPSW2G RGMII端口-> CPSW9G RGMII端口-> CPSW9G SGMII端口发送以太网数据包。
这是否正确?
此致,
斯坦利
您好,Stanley:
感谢您的回复。
您的理解是正确的。
我们已将CPSW2G引脚(MCU_RGMII1_X)直接连接到同一J721E上的CPSW9G RGMII端口(Rgmii1)之一。 CPSW2G为无植物型。
此致,
Vishal
在测试CPSW2G之前,您是否修改了EthFW以启用CPSW9G RGMII端口1上的MAC连接? CPSW9G端口必须处于打开状态,才能使CPSW2G和CPSW9G之间的链路处于打开状态。
此致,
斯坦利
是的。 我已修改。 附加所有更改。
diff --git a/utils/ethfw/src/app_ethfw_freertos.c b/utils/ethfw/src/app_ethfw_freertos.c index 052c64dd9..5615b3149 100644 --- a/utils/ethfw/src/app_ethfw_freertos.c +++ b/utils/ethfw/src/app_ethfw_freertos.c @@ -100,39 +100,13 @@ static EthAppObj gEthAppObj = static EthFw_Port gEthAppPorts[] = { { - .portNum = ENET_MAC_PORT_2, - .vlanCfg = { .portPri = 0U, .portCfi = 0U, .portVID = 0U }, - }, -#if defined(SOC_J721E) - /* On J721E EVM to use all 8 ports simultaneously, we use below configuration - RGMII Ports - 1,3,4,8. QSGMII ports - 2,5,6,7 */ - { - .portNum = ENET_MAC_PORT_3, /* RGMII */ - .vlanCfg = { .portPri = 0U, .portCfi = 0U, .portVID = 0U } - }, - { - .portNum = ENET_MAC_PORT_4, /* RGMII */ - .vlanCfg = { .portPri = 0U, .portCfi = 0U, .portVID = 0U } - }, - { - .portNum = ENET_MAC_PORT_8, /* RGMII */ - .vlanCfg = { .portPri = 0U, .portCfi = 0U, .portVID = 0U } - }, -#if defined(ENABLE_QSGMII_PORTS) //kept it disabled for 6.2 - { - .portNum = ENET_MAC_PORT_5, /* QSGMII sub */ + .portNum = ENET_MAC_PORT_1, /* RGMII */ .vlanCfg = { .portPri = 0U, .portCfi = 0U, .portVID = 0U } }, { - .portNum = ENET_MAC_PORT_6, /* QSGMII sub */ - .vlanCfg = { .portPri = 0U, .portCfi = 0U, .portVID = 0U } - }, - { - .portNum = ENET_MAC_PORT_7, /* QSGMII sub */ - .vlanCfg = { .portPri = 0U, .portCfi = 0U, .portVID = 0U } + .portNum = ENET_MAC_PORT_2, /* SGMII */ + .vlanCfg = { .portPri = 0U, .portCfi = 0U, .portVID = 0U }, }, -#endif -#endif }; /* ========================================================================== */ @@ -156,6 +130,12 @@ static void EthApp_startSwInterVlan(char *recvBuff, static void EthApp_startHwInterVlan(char *recvBuff, char *sendBuff); +static int32_t EthApp_addRemoteCoreStaticCfg(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId); +static void EthApp_delRemoteCoreStaticCfg(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId); void appEthFwEarlyInit() { SemaphoreP_Params semParams; @@ -297,6 +277,10 @@ static int32_t EthApp_initEthFw(void) ethFwCfg.ports[i].portNum); } + /* Set static configuration functions */ + ethFwCfg.addStaticCfg = &EthApp_addRemoteCoreStaticCfg; + ethFwCfg.delStaticCfg = &EthApp_delRemoteCoreStaticCfg; + /* Initialize the EthFw */ gEthAppObj.hEthFw = EthFw_init(gEthAppObj.enetType, ðFwCfg); if (gEthAppObj.hEthFw == NULL) @@ -321,6 +305,167 @@ static int32_t EthApp_initEthFw(void) return status; } +static int32_t EthApp_addMpu10StaticCfg(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId) +{ + const uint8_t mcastAddr[ENET_MAC_ADDR_LEN] = {0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb}; + CpswAle_SetPolicerEntryInArgs polInArgs; + CpswAle_SetPolicerEntryOutArgs polOutArgs; + CpswAle_SetMcastEntryInArgs mcastInArgs; + Enet_IoctlPrms prms; + uint32_t entry; + int32_t status; + + + appLogPrintf("#####################################Adding multicast address\n"); + polInArgs.policerMatch.policerMatchEnMask = 0U; + + /* Add policer entry for port 1 and dstmac */ + polInArgs.policerMatch.policerMatchEnMask = CPSW_ALE_POLICER_MATCH_PORT; + polInArgs.policerMatch.portNum = CPSW_ALE_MACPORT_TO_ALEPORT(ENET_MAC_PORT_1); + polInArgs.policerMatch.portIsTrunk = false; + + polInArgs.policerMatch.policerMatchEnMask |= CPSW_ALE_POLICER_MATCH_MACDST; + polInArgs.policerMatch.dstMacAddrInfo.portNum = CPSW_ALE_MACPORT_TO_ALEPORT(ENET_MAC_PORT_2); + polInArgs.policerMatch.dstMacAddrInfo.addr.vlanId = 0U; + EnetUtils_copyMacAddr(&polInArgs.policerMatch.dstMacAddrInfo.addr.addr[0], &mcastAddr[0]); + + polInArgs.threadIdEn = true; + polInArgs.threadId = flowId; + polInArgs.peakRateInBitsPerSec = 0U; + polInArgs.commitRateInBitsPerSec = 0U; + + ENET_IOCTL_SET_INOUT_ARGS(&prms, &polInArgs, &polOutArgs); + + status = Enet_ioctl(hEnet, gEthAppObj.coreId, CPSW_ALE_IOCTL_SET_POLICER, &prms); + if (status != ENET_SOK) + { + appLogPrintf("Failed to register PORT1 | MACDST policer: %d\n", status); + } + + /* Add policer entry for port 2 and dstmac */ + if (status == ENET_SOK) + { + polInArgs.policerMatch.portNum = CPSW_ALE_MACPORT_TO_ALEPORT(ENET_MAC_PORT_2); + polInArgs.policerMatch.dstMacAddrInfo.portNum = CPSW_ALE_MACPORT_TO_ALEPORT(ENET_MAC_PORT_1); + + ENET_IOCTL_SET_INOUT_ARGS(&prms, &polInArgs, &polOutArgs); + + status = Enet_ioctl(hEnet, gEthAppObj.coreId, CPSW_ALE_IOCTL_SET_POLICER, &prms); + if (status != ENET_SOK) + { + appLogPrintf("Failed to register PORT2 | MACDST policer: %d\n", status); + } + } + + /* Add multicast entry with port mask: host port, MAC port 1 and MAC port 2 */ + if (status == ENET_SOK) + { + mcastInArgs.addr.vlanId = 0U; + EnetUtils_copyMacAddr(&mcastInArgs.addr.addr[0], &mcastAddr[0]); + + mcastInArgs.info.super = false; + mcastInArgs.info.fwdState = CPSW_ALE_FWDSTLVL_FWD; + mcastInArgs.info.portMask = (CPSW_ALE_HOST_PORT_MASK | + CPSW_ALE_MACPORT_TO_PORTMASK(ENET_MAC_PORT_1) | + CPSW_ALE_MACPORT_TO_PORTMASK(ENET_MAC_PORT_2)); + mcastInArgs.info.numIgnBits = 0U; + + ENET_IOCTL_SET_INOUT_ARGS(&prms, &mcastInArgs, &entry); + + status = Enet_ioctl(hEnet, gEthAppObj.coreId, CPSW_ALE_IOCTL_ADD_MCAST, &prms); + if (status != ENET_SOK) + { + appLogPrintf("Failed to add mcast ports: %d\n", status); + } + } + + return status; +} + +static void EthApp_delMpu10StaticCfg(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId) +{ + const uint8_t mcastAddr[ENET_MAC_ADDR_LEN] = {0x01, 0x80, 0xc2, 0x00, 0x01, 0x0E}; + CpswAle_DelPolicerEntryInArgs polInArgs; + Enet_IoctlPrms prms; + int32_t status; + + polInArgs.policerMatch.policerMatchEnMask = 0U; + + /* Delete policer entry for port 1 and dstmac */ + polInArgs.policerMatch.policerMatchEnMask = CPSW_ALE_POLICER_MATCH_PORT; + polInArgs.policerMatch.portNum = CPSW_ALE_MACPORT_TO_ALEPORT(ENET_MAC_PORT_1); + polInArgs.policerMatch.portIsTrunk = false; + + polInArgs.policerMatch.policerMatchEnMask |= CPSW_ALE_POLICER_MATCH_MACDST; + polInArgs.policerMatch.dstMacAddrInfo.portNum = CPSW_ALE_HOST_PORT_NUM; + polInArgs.policerMatch.dstMacAddrInfo.addr.vlanId = 0U; + EnetUtils_copyMacAddr(&polInArgs.policerMatch.dstMacAddrInfo.addr.addr[0], &mcastAddr[0]); + + polInArgs.aleEntryMask = CPSW_ALE_POLICER_MATCH_PORT; + + ENET_IOCTL_SET_IN_ARGS(&prms, &polInArgs); + + status = Enet_ioctl(hEnet, gEthAppObj.coreId, CPSW_ALE_IOCTL_DEL_POLICER, &prms); + if (status != ENET_SOK) + { + appLogPrintf("Failed to delete PORT1 | MACDST policer: %d\n", status); + } + + /* Delete policer entry for port 3 and dstmac */ + if (status == ENET_SOK) + { + polInArgs.policerMatch.portNum = CPSW_ALE_MACPORT_TO_ALEPORT(ENET_MAC_PORT_2); + + ENET_IOCTL_SET_IN_ARGS(&prms, &polInArgs); + + status = Enet_ioctl(hEnet, gEthAppObj.coreId, CPSW_ALE_IOCTL_DEL_POLICER, &prms); + if (status != ENET_SOK) + { + appLogPrintf("Failed to delete PORT3 | MACDST policer: %d\n", status); + } + } +} + +static int32_t EthApp_addRemoteCoreStaticCfg(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId) +{ + int32_t status = ENET_SOK; + + switch (coreId) + { + case IPC_MPU1_0: + appLogPrintf("########################################Add static config for mpu1_0\n"); + status = EthApp_addMpu10StaticCfg(hEnet, coreId, flowId); + break; + + default: + break; + } + + return status; +} + +static void EthApp_delRemoteCoreStaticCfg(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId) +{ + switch (coreId) + { + case IPC_MPU1_0: + appLogPrintf("Delete static config for mpu1_0\n"); + EthApp_delMpu10StaticCfg(hEnet, coreId, flowId); + break; + + default: + break; + } +} + /* NIMU callbacks (exact name required) */ bool EthFwCallbacks_isPortLinked(Enet_Handle hEnet)
diff --git a/apps/app_remoteswitchcfg_server/mcu_2_0/main.c b/apps/app_remoteswitchcfg_server/mcu_2_0/main.c index 1b4019c..e3a1eb8 100644 --- a/apps/app_remoteswitchcfg_server/mcu_2_0/main.c +++ b/apps/app_remoteswitchcfg_server/mcu_2_0/main.c @@ -257,7 +257,13 @@ static void EthApp_startSwInterVlan(char *recvBuff, static void EthApp_startHwInterVlan(char *recvBuff, char *sendBuff); +static int32_t EthApp_addRemoteCoreStaticCfg(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId); +static void EthApp_delRemoteCoreStaticCfg(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId); #if defined(FREERTOS) static void EthApp_lwipMain(void *a0, void *a1); @@ -685,6 +691,10 @@ static int32_t EthApp_initEthFw(void) ethFwCfg.ports[i].portNum); } + /* Set static configuration functions */ + ethFwCfg.addStaticCfg = &EthApp_addRemoteCoreStaticCfg; + ethFwCfg.delStaticCfg = &EthApp_delRemoteCoreStaticCfg; + /* Initialize the EthFw */ gEthAppObj.hEthFw = EthFw_init(gEthAppObj.enetType, ðFwCfg); if (gEthAppObj.hEthFw == NULL) diff --git a/ethfw/ethfw.h b/ethfw/ethfw.h index ef4a8c9..bf6d4f6 100644 --- a/ethfw/ethfw.h +++ b/ethfw/ethfw.h @@ -126,6 +126,7 @@ extern "C" { /* Structures and Enums */ /* ========================================================================== */ + /*! * \brief Ethernet Firmware version * @@ -178,6 +179,36 @@ typedef struct EthFw_PortConfig_s EnetPort_VlanCfg vlanCfg; } EthFw_Port; +/*! + * \brief Add static configuration. + * + * Add static configuration that is applicable only to specific remote cores. + * + * \param hEnet Handle to Enet LLD + * \param coreId Remote core's IPC core id + * \param flowId Remote core's flow id + * + * \return 0 if no error. Negative value otherwise. + */ +typedef int32_t (*EthFw_addStaticCfg)(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId); + +/*! + * \brief Delete static configuration. + * + * Delete static configuration that is applicable only to specific remote cores. + * + * \param hEnet Handle to Enet LLD + * \param coreId Remote core's IPC core id + * \param flowId Remote core's flow id + */ +typedef void (*EthFw_delStaticCfg)(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId); + + + /*! * \brief Ethernet Firmware configuration * @@ -195,6 +226,12 @@ typedef struct EthFw_Config_s /*! Number of MAC ports owned by EthFw, that is, the size of * EthFw_Config::ports array */ uint32_t numPorts; + + /* Add static configuration that is applicable only to specific remote cores */ + EthFw_addStaticCfg addStaticCfg; + + /* Delete static configuration that is applicable only to specific remote cores */ + EthFw_delStaticCfg delStaticCfg; } EthFw_Config; /*! diff --git a/ethfw/src/ethfw.c b/ethfw/src/ethfw.c index f29a8ea..47dcace 100644 --- a/ethfw/src/ethfw.c +++ b/ethfw/src/ethfw.c @@ -170,6 +170,11 @@ typedef struct EthFw_Obj_s /* Handle to PTP stack */ TimeSyncPtp_Handle timeSyncPtp; + /* Add static configuration that is applicable only to specific remote cores */ + EthFw_addStaticCfg addStaticCfg; + + /* Delete static configuration that is applicable only to specific remote cores */ + EthFw_delStaticCfg delStaticCfg; } EthFw_Obj; /* ========================================================================== */ @@ -256,7 +261,11 @@ void EthFw_initConfigParams(Enet_Type enetType, CpswHostPort_Cfg *hostPortCfg = &cpswCfg->hostPortCfg; EnetRm_ResCfg *resCfg = &cpswCfg->resCfg; - /* MAC port ownership */ + /* Initialize Static config function pointers */ + config->addStaticCfg = NULL; + config->delStaticCfg = NULL; + + /* MAC port ownership */ config->ports = NULL; config->numPorts = 0U; @@ -293,6 +302,9 @@ EthFw_Handle EthFw_init(Enet_Type enetType, EnetAppUtils_assert(udmaCfg->hUdmaDrv != NULL); memset(&gEthFwObj, 0, sizeof(gEthFwObj)); + /* Save static config function pointers */ + gEthFwObj.addStaticCfg = config->addStaticCfg; + gEthFwObj.delStaticCfg = config->delStaticCfg; /* Save config parameters */ gEthFwObj.cpswCfg = config->cpswCfg; @@ -424,6 +436,10 @@ int32_t EthFw_initRemoteConfig(EthFw_Handle hEthFw) cfg.notifyServiceRemoteCoreId[0] = IPC_MPU1_0; cfg.notifyServiceRemoteCoreId[1] = IPC_MCU2_1; + /* Static configuration callbacks */ + cfg.addStaticCfg = gEthFwObj.addStaticCfg; + cfg.delStaticCfg = gEthFwObj.delStaticCfg; + status = CpswProxyServer_init(&cfg); if (status != ENET_SOK) { diff --git a/ethremotecfg/server/include/cpsw_proxy_server.h b/ethremotecfg/server/include/cpsw_proxy_server.h index c1acfa9..f4d2e41 100644 --- a/ethremotecfg/server/include/cpsw_proxy_server.h +++ b/ethremotecfg/server/include/cpsw_proxy_server.h @@ -162,6 +162,35 @@ typedef struct CpswProxyServer_RemoteCoreConfig_s char serverName[ETHREMOTECFG_SERVER_MAX_NAME_LEN]; } CpswProxyServer_RemoteCoreConfig; +/*! + * \brief Add static configuration. + * + * Add static configuration that is applicable only to specific remote cores. + * + * \param hEnet Handle to Enet LLD + * \param coreId Remote core's IPC core id + * \param flowId Remote core's flow id + * + * \return 0 if no error. Negative value otherwise. + */ +typedef int32_t (*CpswProxyServer_addStaticCfg)(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId); + +/*! + * \brief Delete static configuration. + * + * Delete static configuration that is applicable only to specific remote cores. + * + * \param hEnet Handle to Enet LLD + * \param coreId Remote core's IPC core id + * \param flowId Remote core's flow id + */ +typedef void (*CpswProxyServer_delStaticCfg)(Enet_Handle hEnet, + uint32_t coreId, + uint32_t flowId); + + /*! * \brief Cpsw Proxy Server Remote Configuration structure * @@ -199,6 +228,12 @@ typedef struct CpswProxyServer_Config_s /*! Remote Core configuration */ CpswProxyServer_RemoteCoreConfig remoteCoreCfg[ETHREMOTECFG_SERVER_MAX_INSTANCES]; + + /* Add static configuration that is applicable only to specific remote cores */ + CpswProxyServer_addStaticCfg addStaticCfg; + + /* Delete static configuration that is applicable only to specific remote cores */ + CpswProxyServer_delStaticCfg delStaticCfg; } CpswProxyServer_Config_t; /*! diff --git a/ethremotecfg/server/src/cpsw_proxy_server.c b/ethremotecfg/server/src/cpsw_proxy_server.c index 690be7c..b0c8807 100644 --- a/ethremotecfg/server/src/cpsw_proxy_server.c +++ b/ethremotecfg/server/src/cpsw_proxy_server.c @@ -180,6 +180,12 @@ typedef struct CpswProxyServer_Obj_s SemaphoreP_Handle rdevStartSem; CpswProxyServer_EthDriverObj ethDrvObj; CpswProxyServer_NotifyServiceObj notifyServiceObj; + + /* Add static configuration that is applicable only to specific remote cores */ + CpswProxyServer_addStaticCfg addStaticCfg; + + /* Delete static configuration that is applicable only to specific remote cores */ + CpswProxyServer_delStaticCfg delStaticCfg; } CpswProxyServer_Obj; /* ========================================================================== */ @@ -592,13 +598,15 @@ static int32_t CpswProxyServer_registerMacHandlerCb(uint32_t host_id, u8 *mac_address, uint32_t flow_idx) { + CpswProxyServer_Obj *hProxyServer; int32_t status; Enet_Handle hEnet = (Enet_Handle)((uintptr_t)handle); uint32_t start_flow_idx, flow_idx_offset; + hProxyServer = CpswProxyServer_getHandle(); CpswProxyServer_validateHandle(hEnet); EnetAppUtils_absFlowIdx2FlowIdxOffset(hEnet, host_id, flow_idx, &start_flow_idx, &flow_idx_offset); - appLogPrintf("Function:%s,HostId:%u,Handle:%p,CoreKey:%x, MacAddress:%x:%x:%x:%x:%x:%x, FlowIdx:%u, FlowIdxOffset:%u\n", + appLogPrintf("######Function:%s,HostId:%u,Handle:%p,CoreKey:%x, MacAddress:%x:%x:%x:%x:%x:%x, FlowIdx:%u, FlowIdxOffset:%u\n", __func__, host_id, hEnet, @@ -618,6 +626,26 @@ static int32_t CpswProxyServer_registerMacHandlerCb(uint32_t host_id, appLogPrintf("EnetAppUtils_regDstMacRxFlow() failed CPSW_ALE_IOCTL_SET_POLICER: %d\n", status); status = RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAIL; } + + if (ENET_SOK == status) + { + if (hProxyServer->addStaticCfg != NULL) + { + status = hProxyServer->addStaticCfg(hEnet, host_id, flow_idx_offset); + if (ENET_SOK != status) + { + appLogPrintf("Failed to add static config for coreId=%u: %d\n", host_id, status); + } + } + else { + appLogPrintf("######################addStaticCfg is NULL\n"); + } + } + + if (status != ENET_SOK) + { + status = RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_EFAIL; + } else { status = RPMSG_KDRV_TP_ETHSWITCH_CMDSTATUS_OK; @@ -632,10 +660,13 @@ static int32_t CpswProxyServer_unregisterMacHandlerCb(uint32_t host_id, u8 *mac_address, uint32_t flow_idx) { + CpswProxyServer_Obj *hProxyServer; int32_t status; Enet_Handle hEnet = (Enet_Handle)((uintptr_t)handle); uint32_t start_flow_idx, flow_idx_offset; + hProxyServer = CpswProxyServer_getHandle(); + CpswProxyServer_validateHandle(hEnet); EnetAppUtils_absFlowIdx2FlowIdxOffset(hEnet, host_id, flow_idx, &start_flow_idx, &flow_idx_offset); appLogPrintf("Function:%s,HostId:%u,Handle:%p,CoreKey:%x, MacAddress:%x:%x:%x:%x:%x:%x, FlowIdx:%u, FlowIdOffset:%u\n", @@ -653,6 +684,19 @@ static int32_t CpswProxyServer_unregisterMacHandlerCb(uint32_t host_id, flow_idx_offset); status = EnetAppUtils_unregDstMacRxFlow(hEnet, core_key, host_id, start_flow_idx, flow_idx_offset, mac_address); + if (status != ENET_SOK) + { + appLogPrintf("Failed EnetAppUtils_unregDstMacRxFlow: %d\n", status); + } + + if (ENET_SOK == status) + { + if (hProxyServer->delStaticCfg != NULL) + { + hProxyServer->delStaticCfg(hEnet, host_id, flow_idx_offset); + } + } + if (status != ENET_SOK) { appLogPrintf("Failed EnetAppUtils_unregDstMacRxFlow: %d\n", status); @@ -1698,8 +1742,16 @@ int32_t CpswProxyServer_init(CpswProxyServer_Config_t *cfg) EnetAppUtils_assert(status == 0); hProxyServer->initDone = true; - appLogPrintf("Remote demo device (core : mcu2_0) .....\r\n"); - return ENET_SOK; + appLogPrintf("$$$$$$$$$$$$$$$$Remote demo device (core : mcu2_0) .....\r\n"); + + + hProxyServer->addStaticCfg = cfg->addStaticCfg; + hProxyServer->delStaticCfg = cfg->delStaticCfg; + + + if (cfg->addStaticCfg == NULL) + appLogPrintf("################################culprit\n"); + return ENET_SOK; } int32_t CpswProxyServer_start(void)
相同的ALE表条目转储...
----------------
条目14 -多播
----------------
端口掩码= 7
Super = 0
MCAST忽略位= 0
MCAST_FWD_State = 0
entry_type = 1
multicast_ADDR = 100 5e0000fb
完成对512个ALE条目的分析
Goodframes TX/RX统计数据,用于9G和2G交换机的相应端口
root@J7-EVM:~# sh /opt/cpsw9g.sh
#####P0RX统计信息
/dev/mem已打开。
在地址0xffffffb0be0000处映射的内存。
读取地址0x0C03A000 (0xffffffb0bea000):0x0.0063万
#####P0TX统计数据
/dev/mem已打开。
映射的内存地址为0xffffff915d0000。
读取地址0x0C03A034 (0xffffff915da034):0x0.0002万E
#####P1RX统计信息
/dev/mem已打开。
在地址0xffffff8a0f0000处映射的内存。
读取地址0x0C03A200 (0xffffff8a0fa200):0x0.0134万
#####P1TX统计信息
/dev/mem已打开。
在地址0xffffffb77c0000处映射的内存。
读取地址0x0C03A234 (0xffffffb77ca234):0x0.0003万B
####P2RX统计数据
/dev/mem已打开。
在地址0xffffff8d91万处映射的内存。
读取地址0x0C03A400 (0xffffff8d91a400): 0x0.0001万B
####P2TX统计数据
/dev/mem已打开。
在地址0xffffff8e1万处映射的内存。
读取地址0x0C03A434 (0xffffff8e01a434):0x0.0047万
#####cpsw2g######
#####P0RX统计信息
/dev/mem已打开。
在地址0xffffffac8b0000处映射的内存。
读取地址0x4603A000 (0xffffffac8ba000):0x0.0134万
#####P0TX统计数据
/dev/mem已打开。
在地址0xffffff8e85万处映射的内存。
读取地址0x4603A034 (0xffffff8e85a034):0x0万
#####P1RX统计信息
/dev/mem已打开。
在地址0xffffff306万处映射的内存。
读取地址0x4603A200 (0xffffff306a200): 0x0万
#####P1TX统计信息
/dev/mem已打开。
在地址0xffffff91c3万处映射的内存。
读取地址0x4603A234 (0xffffff91c3a234):0x0.0134万
已尝试100Mbps速度。 它是有效的。 仅1G速度出现问题。
Vishal,
我从讨论中看到您和Stanley -到目前为止,您可以看到CPSW2G-MAC与CPSW9G-MAC之间使用RGMII互连的互连。 您测试了它的工作速度为100Mbps,但不是1G。 这可能与ethfw有关,其中需要为互连端口的RGMII配置CPSW9G,然后为外部端口的SGMII配置CPSW9G。
由于此线程也被引用:
如果您尝试在CPSW2G和CPSW9G之间进行内部数据包转发,我将关闭此票据,我们可以使用后续线程来跟踪问题。
Jian
您好,Jian:
我们需要这两种解决方案,即外部和内部数据包转发。
我相信我们已经将cpsw9g的MAC1配置为RGMII。 我将转储ENET控制寄存器并确认。
对于1G速度,我们已经达到了在数据包中看到CRC错误的程度,当我们将RX-CLK上的电阻从22欧姆增加到33欧姆时,这些错误就会消失。 但cpsw2g主机端口仍无法接收数据包,因为ALE由于RX ALIGN EROR/端口掩码错误而丢弃数据包。
一个奇怪的事情是如果我在CPSW_PN_MAC_CONTINT_REG中启用'RX_CEF_EN',那么我就可以运行流量了。
此致,
Vishal
Vishal,
好的,将保持此讨论活跃。
RX_CEF_EN似乎允许将错误帧 复制到内存。因此您可能需要检查数据是否正确。
返回调试,您能否确认时钟引脚是如何 相互连接的? 如果电阻器的变化有所 不同,则问题可能与交流特性有关。
Jian
即,它们是否已连接:
TXD[3:0]-- RXD[3:0]
TX_CLK -- RX_CLK
?
从今天的讨论中,决定使用ethfw体系结构的内部数据包转发。 因此,不使用仅MCU电源模式。相反,设备将仅用作"关闭","活动","睡眠"。 因此不再需要外部数据包转发。
此外,JIAN还查找了内部延迟调整,CPSW2g和CPSW9g均不支持内部延迟。
此致
Jian