[dpdk-dev] Packet is not being sent

Wiles, Keith keith.wiles at intel.com
Wed Dec 28 15:07:52 CET 2016


> On Dec 27, 2016, at 11:38 PM, April Teodoro <ateodoro at hotmail.ph> wrote:
> 
> 
> 
> 
> ________________________________
> From: April Teodoro <ateodoro at hotmail.ph>
> Sent: Wednesday, December 28, 2016 1:36 PM
> To: dev at dpdk.org
> Subject: Packet is not being sent
> 
> 
> i, I am wondering what is causing the packet to be dropped. Please help me.
> 
> The mempool was created and retrieved via lookup
> 
> The port and queues have been verified to be correct.
> 
> 
> However, according to stats, no packet is transmitted, although rte_eth_tx_burst returns 1. I also do not receive anything on the connected machine.

Hard to tell if all of the initializations have been done correctly in the snap shot below, but please try the testpmd or pktgen to verify the ports are working correctly. If you can not send with those two apps then I would suggest it is something to do with your hardware or system configuration.

> 
> 532         if(mem == NULL)
> 533         {
> 534                 LOG <<"No mem";
> 535         }
> 536         else{
> 537                 LOG << "has mem";
> 538         }
> 539
> 540         rte_mbuf *mbufs = rte_pktmbuf_alloc(mem);
> 541         if(NULL == mbufs)
> 542 {
> 543         LOG << "ALLOCATION failed";
> 544 }
> 545  else
> 546 {
> 547    LOG << "ALLOCATION successful";
> 548 }
> 549
> 550         uint8_t* messageToSend = NULL;
> 551         LOG << "SENDRAW 2";
> 552         ether_addr addr;
> 553         rte_eth_macaddr_get(port, &addr);
> 554         LOG << "start port 2: " << rte_eth_dev_start(2);
> 
> 569         ether_addr_copy(&addr, &hdr->s_addr);
> 570         hdr->ether_type = rte_cpu_to_be_16(0x9998);
> 571         mbufs->pkt_len = mbufs->data_len = 8;
> 572
> 573         messageToSend = (uint8_t*)&hdr[2];
> 574
> 575         for(auto i=0u; i < sendmsg.header.msgSize; ++i) {
> 576         messageToSend[i] = sendmsg.data[i];
> 577         }
> 578
> 579         LOG << "SENDRAW " << sendmsg.header.msgSize;
> 580         mbufs->pkt_len = sendmsg.header.msgSize;
> 581         LOG << "SENDRAW 5";
> 582         LOG << "SENDRAW 6";
> 583         rte_mbuf *mbufArray[] = {mbufs};
> 584         rte_pktmbuf_refcnt_update(mbufs, 1);
> 585         LOG << "SENDRAW 7";
> 586         //uint16_t nbPk = rte_eth_tx_burst(2, 0, mbufArray, 1);
> 587         uint32_t sent = 0;
> 588         struct rte_eth_dev_info dev_info;
> 589         struct rte_eth_stats stats;
> 590         LOG << "stats successful? " << rte_eth_stats_get(2, &stats);
> 591         rte_eth_dev_info_get(2, &dev_info);
> 592         LOG << "dev info: " << (dev_info.pci_dev->addr.bus);
> 593         while (1) {
> 594                 sent = rte_eth_tx_burst(2, 0, mbufArray, 1);
> 595                 if (sent > 0) {
> 596                      LOG << "opackets: " << stats.opackets;
> 597                      LOG << "obytes: " << stats.obytes;
> 598                      LOG << "oerrors: " << stats.oerrors;
> 599                      LOG << "packets transmitted "  << sent;
> 600                      return;
> 601                 }
> 602         }
> 603
> 604
> 605     }

Regards,
Keith



More information about the dev mailing list