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.

[参考译文] AM2634:如何从 Enet-LLD 在 CPSW 上配置 IntraVlan 操作?

Guru**** 2524550 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1328090/am2634-how-to-config-intravlan-operation-on-cpsw-from-enet-lld

器件型号:AM2634

我们正在尝试使用不同的 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"处理?

此致!

宇建市

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Yujian:

    我已经开始研究该主题、我很快就会回来进行一些更新。 同时、我看到针对同一个示例创建了一个重复的主题(e2e.ti.com/.../am2634-q1-how-to-config-intravlan-operation-on-cpsw-from-enet-lld)。 我们能否关闭此主题并继续了解另一个主题?

    此致、
    Shaunak

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Shaunak:  

    感谢您的答复。 我将关闭该 主题。  

    此致!

    宇建市