我们正在尝试使用不同的 VLAN ID 从主机端口向两个 RGMII 端口广播一条消息。 目前、我们仅 在主机复制消息、并 向不同的端口发送第2个问题。
但是、下面是来自 TRM 的屏幕截图、我们对"IntraVlan"过程感兴趣、即将 VLAN 标记替换为正确的标记。

在 enet-LLD SDK 中、我们找到`CPSW_PER_IOCTL_SET_INTERVLAN_ROUT_MULTI_EXPORT` ioctl 命令似乎符合我们的需要、但下面的配置不起作用:当我们从主机端口发送 VLAN ID 为255的广播消息时、我们没有看到 VLAN ID 被替换。
Cpsw_SetInterVlanRouteMultiEgressInArgs in_args = {
.numEgressPorts = 2,
.egressCfg =
{
{
.egressPort = ENET_MAC_PORT_1,
.outPktModCfg =
{
.dstAddr = {0},
.srcAddr = {0},
.vlanId = 30,
.replaceDASA = false,
.forceUntaggedEgress = false,
.decrementTTL = false,
},
},
{
.egressPort = ENET_MAC_PORT_2,
.outPktModCfg =
{
.dstAddr = {0},
.srcAddr = {0},
.vlanId = 40,
.replaceDASA = false,
.forceUntaggedEgress = false,
.decrementTTL = false,
},
},
},
.inPktMatchCfg =
{
.packetMatchEnMask = 0,
.ttlCheckEn = false,
.ingressPort = ENET_MAC_PORT_FIRST,
.dstMacAddrInfo = {0},
.vlanId = 255,
},
};
Cpsw_SetInterVlanRouteMultiEgressOutArgs out_args;
Enet_IoctlPrms parms = {
.inArgs = (void *)&in_args,
.inArgsSize = sizeof(in_args),
.outArgs = (void *)&out_args,
.outArgsSize = sizeof(out_args),
};
int32_t retval = Cpsw_ioctlInterVlan(
g_enet_context.hEnet->enetPer,
CPSW_PER_IOCTL_SET_INTERVLAN_ROUTE_MULTI_EGRESS, &parms);
进一步检查 API 注释、我们在 enet-LLD 的以下部分中找到:此规则仅适用于目标端口为主机端口的情况。
typedef struct Cpsw_SetInterVlanRouteMultiEgressInArgs_s
{
/*! Number of egress ports the packet needs to be routed to */
uint32_t numEgressPorts;
/*! Egress packet modification configuration for the interVLAN route for
* each port the packet will be routed to.
* #numEgressPorts determine number of valid entries in this table */
Cpsw_InterVlanEgressPortCfg egressCfg[CPSW_ALE_NUM_MAC_PORTS];
/*! Ingress packet match criteria for the interVLAN route.
* If the packet matches the given criteria and the destination port
* of the packet is host port then the interVLAN route will take effect */
Cpsw_InterVlanRouteIngressPktMatchCfg inPktMatchCfg;
} Cpsw_SetInterVlanRouteMultiEgressInArgs;
那么、我的问题是、我们如何配置 CPSW 以实现 TRM 中所述的"IntraVlan"处理?
此致!
宇建市