我们将在春节假期期间对网站进行维护,可能暂时无法访问,同时工程师回复将有所延迟,敬请谅解.

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.

AM2732: 以太网接收不到VLAN优先级为非0的报文,怎么配置VLAN

Part Number: AM2732

使用官方的SDK驱动配置的以太网部分,接收采用DMA方式,目前只能接收到VLAN优先级为0的报文,接收不到VLAN优先级为非0的报文。但项目要求接收的VLAN优先级为非0,关于这一块驱动如何配置呢?

  • 请问您运行的是SDK里的哪个demo? 做了怎样的修改?

  • 运行的mcu_plus_sdk_am273x_08_01_00_34里的networking,没做修改

  • 如果对例程没有做修改的话,请看一下是否按照下面文档中的步骤操作的?
    https://software-dl.ti.com/mcu-plus-sdk/esd/AM273X/08_03_00_18/exports/docs/api_guide_am273x/EXAMPLES_NETWORKING.html

  • 没发现配置上有啥区别,可否指出哪些地方会影响vlan优先级报文的接收,我没有用lwip,就在底层dma里接收打断点发现非0优先级的报文进去不了。采用的是loopback例程只是没让进行回环功能,也按layer2_multi_channel试了都不行,急!

  • 我把您的问题升级到英文e2e论坛了,请关注下面帖子的回复。
    e2e.ti.com/.../am2732-how-to-configure-the-code-to-receive-the-non-zero-priority-vlan-message

  • 请参考下面e2e工程师的回复。

    For receiving the non-zero priority VLAN, you need to add a policer entry with required priority using CPSW_ALE_IOCTL_SET_POLICER  IOCTL.

    AM273x MCU+ SDK: Enet LLD IOCTL interface (ti.com)

    AM273x MCU+ SDK: CpswAle_PolicerMatchParams Struct Reference (ti.com)

    AM273x MCU+ SDK: CPSW Address Lookup Engine (ALE) (ti.com)

    For using the Enet IOCTLs, you can refer to existing examples in mcu_plus_sdk_am273x_08_03_00_18\examples\networking.

  • Shine,你好。我这里由于公司邮箱注册论坛Id后,邮件的确认网址不允许被打开。所以无法在英文论坛回复。麻烦您帮转下,谢谢了。

    我现在按贴子设置了policer,但是现在连以太网报文都发布出来了,代码如下图,以太网报文发送没有使用lwip,直接构造报头发送的。

    再下面为能接收到VLAN优先级为0的报文截图和接收不到vlan优先级为4的报文的截图

  • 工程师对他之前的回复有更新,请参考

    Please ignore my previous response. I assumed you made changed to loopback code to enable specific priority handling.

    Regarding your issue, can you please share how you send non-zero priority messages? Did you modify loopback example to create new VLAN packets?

    Can you please share log and CPSW statistics (you can print stats using below)?

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1040141/faq-mcu-plus-sdk-am243x-how-do-i-get-cpsw-diagnostic-statistics-using-debug-gels-in-mcu-sdk-enet-lld 

  • 执行此脚本运行报错,如下图 ,然后将脚本里MSS_CPSW的基地址改为07000000,虽然不报错,但读不出任何寄存器的值

  • 我刚去掉了POLICER设置的那段代码,脚本设置MSS_CPSW基地址为0x07000000,可以打印出来状态信息,如下:

    Cortex_R5_0: GEL Output: --->>> CPSW Gel Load In Progress... <<<---
    Cortex_R5_0: GEL Output: --->>> CPSW Gel Load DONE! <<<---
    Cortex_R5_0: GEL Output: STATS
    Cortex_R5_0: GEL Output: --------------------------------
    Cortex_R5_0: GEL Output: PORT0 STATS
    Cortex_R5_0: GEL Output: --------------------------------
    Cortex_R5_0: GEL Output: STAT_0_RXGOODFRAMES = 0x0000001C
    Cortex_R5_0: GEL Output: STAT_0_RXBROADCASTFRAMES = 0x0000001C
    Cortex_R5_0: GEL Output: STAT_0_RXOCTETS = 0x00000B98
    Cortex_R5_0: GEL Output: STAT_0_TXGOODFRAMES = 0x00000019
    Cortex_R5_0: GEL Output: STAT_0_TXBROADCASTFRAMES = 0x00000010
    Cortex_R5_0: GEL Output: STAT_0_TXMULTICASTFRAMES = 0x00000009
    Cortex_R5_0: GEL Output: STAT_0_TXOCTETS = 0x000009CF
    Cortex_R5_0: GEL Output: STAT_0_OCTETFRAMES65T127 = 0x00000034
    Cortex_R5_0: GEL Output: STAT_0_OCTETFRAMES128T255 = 0x00000001
    Cortex_R5_0: GEL Output: STAT_0_NETOCTETS = 0x00001567
    Cortex_R5_0: GEL Output: STAT_0_ALE_UNKN_BRD = 0x00000003
    Cortex_R5_0: GEL Output: STAT_0_ALE_UNKN_BRD_BCNT = 0x0000013E
    Cortex_R5_0: GEL Output: --------------------------------
    Cortex_R5_0: GEL Output: PORT1 STATS
    Cortex_R5_0: GEL Output: --------------------------------
    Cortex_R5_0: GEL Output: STAT_1_RXGOODFRAMES = 0x00000019
    Cortex_R5_0: GEL Output: STAT_1_RXBROADCASTFRAMES = 0x00000010
    Cortex_R5_0: GEL Output: STAT_1_RXMULTICASTFRAMES = 0x00000009
    Cortex_R5_0: GEL Output: STAT_1_RXOCTETS = 0x000009CF
    Cortex_R5_0: GEL Output: STAT_1_TXGOODFRAMES = 0x0000001C
    Cortex_R5_0: GEL Output: STAT_1_TXBROADCASTFRAMES = 0x0000001C
    Cortex_R5_0: GEL Output: STAT_1_TXOCTETS = 0x00000B98
    Cortex_R5_0: GEL Output: STAT_1_OCTETFRAMES65T127 = 0x00000034
    Cortex_R5_0: GEL Output: STAT_1_OCTETFRAMES128T255 = 0x00000001
    Cortex_R5_0: GEL Output: STAT_1_NETOCTETS = 0x00001567
    Cortex_R5_0: GEL Output: STAT_1_ALE_UNKN_MLT = 0x00000002
    Cortex_R5_0: GEL Output: STAT_1_ALE_UNKN_MLT_BCNT = 0x00000105
    Cortex_R5_0: GEL Output: STAT_1_ALE_UNKN_BRD = 0x00000001
    Cortex_R5_0: GEL Output: STAT_1_ALE_UNKN_BRD_BCNT = 0x0000006A
    Cortex_R5_0: GEL Output: STAT_1_TX_PRI_REG [0]= 0x0000001C
    Cortex_R5_0: GEL Output: STAT_1_TX_PRI_BCNT_REG [0]= 0x00000B98
    Cortex_R5_0: GEL Output: STATS
    Cortex_R5_0: GEL Output: --------------------------------
    Cortex_R5_0: GEL Output: PORT0 STATS
    Cortex_R5_0: GEL Output: --------------------------------
    Cortex_R5_0: GEL Output: STAT_0_RXGOODFRAMES = 0x00000021
    Cortex_R5_0: GEL Output: STAT_0_RXBROADCASTFRAMES = 0x00000021
    Cortex_R5_0: GEL Output: STAT_0_RXOCTETS = 0x00000DAA
    Cortex_R5_0: GEL Output: STAT_0_TXGOODFRAMES = 0x00000025
    Cortex_R5_0: GEL Output: STAT_0_TXBROADCASTFRAMES = 0x00000016
    Cortex_R5_0: GEL Output: STAT_0_TXMULTICASTFRAMES = 0x0000000F
    Cortex_R5_0: GEL Output: STAT_0_TXOCTETS = 0x00000E23
    Cortex_R5_0: GEL Output: STAT_0_OCTETFRAMES65T127 = 0x00000045
    Cortex_R5_0: GEL Output: STAT_0_OCTETFRAMES128T255 = 0x00000001
    Cortex_R5_0: GEL Output: STAT_0_NETOCTETS = 0x00001BCD
    Cortex_R5_0: GEL Output: STAT_0_ALE_UNKN_BRD = 0x00000003
    Cortex_R5_0: GEL Output: STAT_0_ALE_UNKN_BRD_BCNT = 0x0000013E
    Cortex_R5_0: GEL Output: --------------------------------
    Cortex_R5_0: GEL Output: PORT1 STATS
    Cortex_R5_0: GEL Output: --------------------------------
    Cortex_R5_0: GEL Output: STAT_1_RXGOODFRAMES = 0x00000025
    Cortex_R5_0: GEL Output: STAT_1_RXBROADCASTFRAMES = 0x00000016
    Cortex_R5_0: GEL Output: STAT_1_RXMULTICASTFRAMES = 0x0000000F
    Cortex_R5_0: GEL Output: STAT_1_RXOCTETS = 0x00000E23
    Cortex_R5_0: GEL Output: STAT_1_TXGOODFRAMES = 0x00000021
    Cortex_R5_0: GEL Output: STAT_1_TXBROADCASTFRAMES = 0x00000021
    Cortex_R5_0: GEL Output: STAT_1_TXOCTETS = 0x00000DAA
    Cortex_R5_0: GEL Output: STAT_1_OCTETFRAMES65T127 = 0x00000045
    Cortex_R5_0: GEL Output: STAT_1_OCTETFRAMES128T255 = 0x00000001
    Cortex_R5_0: GEL Output: STAT_1_NETOCTETS = 0x00001BCD
    Cortex_R5_0: GEL Output: STAT_1_ALE_UNKN_MLT = 0x00000002
    Cortex_R5_0: GEL Output: STAT_1_ALE_UNKN_MLT_BCNT = 0x00000105
    Cortex_R5_0: GEL Output: STAT_1_ALE_UNKN_BRD = 0x00000001
    Cortex_R5_0: GEL Output: STAT_1_ALE_UNKN_BRD_BCNT = 0x0000006A
    Cortex_R5_0: GEL Output: STAT_1_TX_PRI_REG [0]= 0x00000021
    Cortex_R5_0: GEL Output: STAT_1_TX_PRI_BCNT_REG [0]= 0x00000DAA

  • 已在英文e2e上更新您的问题,请关注帖子的回复。

  • 抱歉,e2e那边的回复可能要晚一些。

    Our experts are on leave please expect some delay in response. We will get back to you before end of next week.

  • 麻烦您再咨询下原厂这个问题:我发现导致POLICER match配置不成功的原因是ALE_STATUS这个寄存器值一直为0,怎样配置才可以使该寄存器中POLCNTDIV8不为0呢?

  • 已把您的问题在e2e帖子上更新,请关注帖子的回复。

  • 请看下面工程师最新回复。

    Apologies for delay in response.

    How to make POLCNTDIV8 is non zero?

    This is a read only register.

    Let me get back by tomorrow with more info on this.



  • 抱歉回复晚了。

    请看下面工程师的回复。能否发一下您的工程文件?

    To debug this issue further I would need the below info here. As the example by default does not uses sample vlan packets and its configured for vlan unaware mode. And the example is configured for 0 vlan id UNICAST packets reception.

    Regarding your issue, can you please share how you send non-zero priority messages? Did you modify loopback example to create new VLAN packets?

    For speeding up debug process, Can you please share example project(modified for vlan handling) by customer.

  • 我直接自定义结构体构造各层协议的包头(包括自定义的vlan)添加到以太网buf里,通过发送函数发送的

  • 已把您的问题在e2e帖子上更新,请关注帖子的回复。

  • 这个问题一直没解决,可否让原厂提供段接收非0vlan优先级报文的初始化代码或工程?这个应该不难吧

  • 抱歉,我去催一下工程师。

  • 能否提供一下您的工程文件?请看下面工程师的回复。

    Debug is still in progress on our end. Can you please help with the example project which customer is using so it could fasten up our debug also if the customer is using PHY loopback how are they seeing packet on wireshark?

  • 工程这块不能给的,因为里面还有车载以太网的协议和其他模块,属于机密性的,之前用的enet_loopback的demo工程改的,现在用lwip示例工程就把多播配置的mac地址改了下,其他都一样也是vlan优先级非0报文接收不到。设置policer也是读ale_status寄存器值为0,导致设置不成功

  • 之前用的enet_loopback的demo工程改的,现在用lwip示例工程就把多播配置的mac地址改了下

    那麻烦把在TI demo工程上修改后的测试工程发一下,方便我们工程师调试。 

  • 公司保密限制无法发送这些的,即使发出来也是加密文件。你就让工程师用lwip那个demo工程来配置,用xcap软件周期发vlan优先级为4的报文给板子,板子收到后转发给电脑。把这个调通

  • 已告诉e2e工程师,请关注帖子的回复。

  • 不好意思,麻烦问一下,您现在用的还是mcu_plus_sdk_am273x_08_01_00_34是吧?没有用08_04_00_17吧?

  • 是的,用的mcu_plus_sdk_am273x_08_01_00_34

  • 感谢回复。

  • e2e工程师建议您移植到最新的08.04.00.17版本看是否能解决。
    https://www.ti.com/tool/download/MCU-PLUS-SDK-AM273X

    他稍后会把他那边测试的工程放到e2e帖子里。

  • 请看我们工程师最新的回复。

    For VLAN Support in LWIP example following changes are to be made for enabling vlan id 4U packets:

    1. Enable macro 

    #define ETHARP_SUPPORT_VLAN             1

    in file mcu_plus_sdk\source\networking\lwip\lwip-stack\src\include\lwip\opt.h

    1. In the same above file add below two lines:

    +#define ETHARP_VLAN_CHECK 4

     +#define LWIP_HOOK_VLAN_SET(netif, p, src, dst, eth_type) (4U)

    1. Rebuild lwip stack and lwip contrib and enet_cpsw libraries.
    2. Rebuild the example and run.

    Let me know if this works for you.

  • 我一直就是这样设置的,这个是我的设置

    #define ETHARP_SUPPORT_VLAN 1
    #define VLAN_VID 104
    #define VLAN_PRI 4
    #define VLAN_CFI 0
    #define LWIP_HOOK_VLAN_SET(netif, p, src, dst, eth_type) ((VLAN_PRI << 13) | (VLAN_CFI << 12) | VLAN_VID)

    我是要接收VLAN优先级为4的报文,而不是接收VLAN ID为4的报文。LWIP我那块配置的没问题的,还有用的那个新版SDK也不行的,可否让你们工程师给下怎么通过Policer的设置来改变接收VLAN优先级的,我这一块一直设置不成功,因为读出的ALE_STATUS寄存器为0

  • 已更新帖子,请关注工程师的回复。

  • 您好,请问现在工程师有结论了没?

  • 目前还没有,我去催一下工程师。

  • 请看下面e2e工程师最新的回复。

    Please refer below:

    1. Please follow example: mcu_plus_sdk\examples\networking\enet_layer2_multi_channel example to setup ALE and vlan priority filtering.

    2.Use below code as a sample to configure the ALE:

    void EnetApp_setCpswPolicer(EnetApp_PerCtxt *perCtxt)
    {
    int32_t status;
    Enet_IoctlPrms prms;
    CpswAle_SetPolicerEntryOutArgs setPolicerOutArgs;
    CpswAle_SetPolicerEntryInArgs setPolicerInArgs;

    /* Set the Policer configuration */
    memset(&setPolicerInArgs, 0, sizeof(setPolicerInArgs));
    setPolicerInArgs.policerMatch.policerMatchEnMask = CPSW_ALE_POLICER_MATCH_MACSRC |
    CPSW_ALE_POLICER_MATCH_ETHERTYPE |
    CPSW_ALE_POLICER_MATCH_PORT;
    setPolicerInArgs.policerMatch.etherType = 0x8100;
    setPolicerInArgs.policerMatch.priority = 4U;
    setPolicerInArgs.policerMatch.portNum = CPSW_ALE_MACPORT_TO_ALEPORT(ENET_TEST_POLICER_INGRESS_PORT);
    memcpy(&setPolicerInArgs.policerMatch.srcMacAddrInfo.addr.addr[0U], testSrcAddr, sizeof(setPolicerInArgs.policerMatch.srcMacAddrInfo.addr.addr));
    setPolicerInArgs.policerMatch.srcMacAddrInfo.addr.vlanId = 0;
    setPolicerInArgs.policerMatch.srcMacAddrInfo.portNum = CPSW_ALE_MACPORT_TO_ALEPORT(ENET_TEST_POLICER_INGRESS_PORT);

    ENET_IOCTL_SET_INOUT_ARGS(&prms, &setPolicerInArgs, &setPolicerOutArgs);
    ENET_IOCTL(perCtxt->hEnet, gEnetApp.coreId, CPSW_ALE_IOCTL_SET_POLICER, &prms, status);
    if (status != ENET_SOK)
    {
    EnetAppUtils_print("\nEnetApp_setCpswPolicer() failed CPSW_ALE_IOCTL_SET_POLICER: %d\n", status);
    }
    else
    {
    EnetAppUtils_print("\nRate limiting Enabled port %d on Src MAC " , CPSW_ALE_MACPORT_TO_ALEPORT(ENET_TEST_POLICER_INGRESS_PORT));
    EnetAppUtils_printMacAddr(testSrcAddr);
    }
    }

    3. Rebuild the example.

    Please let me know if you need any help with this.

  • 这个代码加进去也是接收不到非0VLAN优先级的报文,而且这个代码在MatchEnmask中没有把VLAN优先级的加进去

  • 把您的回复更新到e2e帖子上了,请等待工程师的回复。

  • 工程师刚回复我说In Mutichannel example we are using VLAN priority to mark PTP packets as high prority. Please  refer to this example, as our engineer mentioned in the thread.

  • 请看我们工程师的最新回复。

    Please ask customer to follow the mcu_plus_sdk\examples\networking\enet_layer2_multi_channel example to setup ALE and vlan priority filtering.

  • 您好,

    看到e2e上有位叫Jeff Zou的客户说可以close我发的帖子了,不知道是您本人还是您的同事?

    我们的e2e工程师想了解一下您们的问题解决了吗?如果解决了,能否告知是怎么解决的?他需要一个详细的报告反馈给networking team做文档记录。