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.

GbE switch Directed packet doesn't work as expected on Keystone2

Hi Experts,


I want to transmit ehternet packet though specified port regardless the contents of the packet.

I find setting the TO_PORT(Bits[20-16] in Word 2 of the Host Packet Descriptor) to the port number can achieve my goal.

But when I  assign the port number to TO_PORT field before pushing the descriptor to the transmit queue, the packet is still transmitted to Port1 and Port 2.

Do I miss any other setting?

  • Hi,
    Please see the PA LLD based examples, this will suit your test case. This PA examples (application) will output to the console its status progress and the number of sent/received packets and declare pass/fail.

    How you are testing? Are you using any TI based MCSDK example or your custom code?
    Please share your custom code and give the technical suggestion, if you are using custom or modified PA test code.
    Please mention the board details.

  • Hi Pubesh,

    Thank you for your reply!

    I don't reference the PA LLD examples, I did my work based on the U-BOOT.
    My key customized code is listed below:
    /*****************customized code begin*********************************/
    pFirst->packetInfo = (pDrvCtrl->txCmplQueue |
    NETCP_BD_RETURN_POLICY_ALL_RUTURN |
    NETCP_BD_RETURN_PUSH_POLICY_HEAD | (2 << 16));

    /* save the mBlk for later */

    pDrvCtrl->netcpTxMblk[firstIdx] = pMblk;

    /* push descriptors to the txSndQueue, begin transfer */

    netcpQmPush (pFirstPhy, pDrvCtrl->txSndQueue);
    /*****************customized code end*********************************/

    I did the test on K2E EVM before. The pDrvCtrl->txSndQueue is 896 for K2E EVM, and the ethernet interface is OK no mater I plugged the cable to EMAC1 or EMAC2.
    I do the same test on K2HK EVM today, the TO_PORT capability takes effective. The packet goes out through the port I specify. When I plug the cable to the other port, the ethernet interface is not reachable.

    For the K2HK EV, the pDrvCtrl->txSndQueue is 648. I find the following description on the E2E forum for the queues of NETCP(http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/146961/688273#688273)
    "Only Q648 sends packets direclty into the ethernet switch that is why if you want to force a packet to go to a specific SGMII port you set the psFlags on the descriptor. Q640-Q647 are connected to PA and SA. I suggest going through the NetCP User Guide for more information on this."

    I think I use improper transmit queue for the K2E EVM, but which is the queue that sends packets direclty into the ethernet switch for KE2 EVM?

  • Hi,

    The PA example is meant to be the simplest possible example which demonstrates configuration of the QM, CDMA, flows PA, and switch/emac/SGMII.

  • Hi,
    However this discussion of thread can helpful for future readers, If you verified this thread.
  • Hi Pubesh,

    Sorry for the late reply because I turned to another project.
    The above figure is applicable for K2HK. The K2E has a different one.
    I'll continue on this issue when I get time and post my result.
    Thank you very much!

    Best Regards,
    Guohu
  • Guohu,
    Thanks for the update, you can comeback once you setup with K2HK for this issue. I hope, you can understand the flow of configuration and using the TX/RX queues.
  • Hi Pubesh,

    When I setup the environment for K2HK, the TO_PORT field (Bits[20-16] in Word 2 of the Host Packet Descriptor) takes effect. That's to say, the Ethernet packet is transmitted by the port that I specified in TO_PORT, the other port will not transmit it. But the K2E EVM will transmit it to both external ports.
  • I added the following code the keystone_nav.c, after netcp_send(), uset "sendtest" command to test, but the TO_PORT field did not take effect:

    DECLARE_GLOBAL_DATA_PTR;
    static char sendtestbuf[512];
    int netcp_do_sendtest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
    {
    int port;
    int i;
    struct qm_host_desc *hd;
    char mac[6] = {0x08, 0x00, 0x28, 0x32, 0xa9, 0xc7};

    port = simple_strtoul(argv[1], NULL, 10);
    printf ("## send to port %d ...\n", port);

    net_init();
    if (eth_init(gd->bd) < 0) {
    eth_halt();
    printf("init eth failed\n");
    return -1;
    }
    NetInitLoop();

    hd = qm_pop(qm_cfg->qpool_num);
    if (hd == NULL)
    {
    printf ("pop queue failed\n");
    return QM_ERR;
    }

    memcpy (sendtestbuf + 6, mac, 6);

    for (i = 0; i <6; i++)
    sendtestbuf[i] = 0xff;

    for (i = 12; i < 256; i++)
    {
    sendtestbuf[i] = i - 6;
    }

    hd->desc_info> = 256;
    hd->swinfo[2]> = port;
    hd->packet_info = qm_cfg->qpool_num | (port << 16);

    qm_buff_push(hd, netcp->tx_snd_q, sendtestbuf, 256);
    return 0;
    }

    U_BOOT_CMD(
    sendtest, 2, 1,>netcp_do_sendtest,
    "Send paket test",
    ""
    );
  • I find the TO_PORT fied is at Bit[7:0] of Descriptor Information Word 1, described in SPRUHZ3A, which is release in April 2015.
    It takes effect for K2E EVM.