DPDK usage discussions
 help / color / mirror / Atom feed
From: Upendra Pathrikar <uspathrikar@gmail.com>
To: users@dpdk.org
Subject: [dpdk-users] Unable to transmit custom built packet in dpdk
Date: Sun, 16 Oct 2016 20:49:06 +0530	[thread overview]
Message-ID: <CAGSHHKetLQcij+5GveEZcPss_4V--PGZ0efzBrRoYAG2k36NMA@mail.gmail.com> (raw)

hi,

I am trying to build packet generator like application in dpdk. I have
custom built packet as unsigned char array(used to store hex values) I have
allocated mbuf and extract unsigned char pointer for data field from mbuf
and now I am filling the mbuf with unsigned char array packet. Then  trying
to transmit the  packet using rte_eth_tx_burst function. It reteurns as the
packet is sent but I don't receive the same packet or any garbage packet
either on wireshark or using custom application with rte_eth_rx_burst.

I am working on ubuntu 14.04 with kernel 3.13
I am using Intel Gigabit ET dual port server adapter (82576) with igb_uio
driver binding
one port to transmit packet and other to receive packet

the custom packet defined is arp packet without crc i.e 60bytes
application should not exit unless it receives packet.
But it is exiting at first execution of rte_eth_rx_burst() without
indicating any error or executing further. I am clueless now.

Your help will be appreciated

static int txmt_pkts(void)
{
    uint8_t port_id;
    struct rte_mbuf *mpkt, *rxpkt;
    unsigned char
packet[]="ffffffffffff3417ebc76473080600010800060400013417ebc764730ad042700000000000000ad04201000000000000000000000000000000000000\0";
    unsigned char pkt[strlen(packet)/2];
    int ret,i;
    int nb_tx, nb_rx;
    unsigned char *ptr;

    /* Function convert char array into cooresponding actual hex values*/
    ret = hexstring2hexchar(packet,pkt,strlen(packet));
    if(ret < 0)
        return -3;
    /* Allocate mbuf to add packet data */
    mpkt = rte_pktmbuf_alloc(mbuf_pool);
    if(mpkt == NULL)
        return -2;
    rte_mbuf_sanity_check(mpkt,1);
    ptr = rte_pktmbuf_mtod(mpkt,unsigned char *);
    for(i = 0; i< (strlen(packet)/2); i++){
        *(ptr+i) = *(pkt+i);
        mpkt->data_len++;
        mpkt->pkt_len++;
    }
    rte_mbuf_sanity_check(mpkt,1);
    nb_tx = rte_eth_tx_burst(1, 0, &mpkt, 1);
    printf("\npackets sent till this time - %d",nb_tx);

    while(1){
        nb_rx = rte_eth_rx_burst(0,0,rxpkt,1);
        if(nb_rx != 0){
            printf("\nFinally recived a packet - %d\n",nb_rx);
            break;
        }
    }
    printf("\nEnd of transmission\n");
    return 0;
}



Thanks...

-- 






*Regards,Upendra Sunil PathrikarResearch ScholarBharti School of Telecom
Technology and Management,Indian Institute of Technology, Delhi.*

             reply	other threads:[~2016-10-16 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-16 15:19 Upendra Pathrikar [this message]
2016-10-17 10:48 ` Andriy Berestovskyy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGSHHKetLQcij+5GveEZcPss_4V--PGZ0efzBrRoYAG2k36NMA@mail.gmail.com \
    --to=uspathrikar@gmail.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).