From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f179.google.com (mail-io0-f179.google.com [209.85.223.179]) by dpdk.org (Postfix) with ESMTP id A21ED2BAD for ; Mon, 17 Oct 2016 12:49:14 +0200 (CEST) Received: by mail-io0-f179.google.com with SMTP id j37so183633308ioo.3 for ; Mon, 17 Oct 2016 03:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/OcLNPb0BgynF42gw/antcVSEbKG/Rg82XLFYQ6Ok3A=; b=uqfaFEfrMRPM/+VbexAkUiYLvJyNeTxPP4oreZ1jWOp7V4jVU2FQgF6V1D2aAHvCwt BWawZ7SH4NBfuTPFBFFI0mi9pHqJh/vvYGfUId7IJbhEU+pSSjIneNu+8CcnRuSqzWBK OyLBDFMBbEXc8xkxZTjloNXV64zgPZCKyvjL02cbYArWQhw9aLs8NzJDc2XGkCWpErxi X/I4/o7rHBhcfgpNP5ghiEoymzAjCA2AJAXBVo8+UPgbc9qtlZ0JJPHrFBK7B6alDreF G6H0HLT+WRPMFLgmwGWApowbcoOAHMENHJRL39AdWzCID3CWV9JYo+TjZQd+ztijkJc9 SBqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/OcLNPb0BgynF42gw/antcVSEbKG/Rg82XLFYQ6Ok3A=; b=X2M6977i2Rfkurt21BKNopsMVpzltBsc0rFvlE8ST5GR856BiDD3TPO3m0zXJJZg6S bKBS16doYdDd8GVtcd1rkD5b0+L39Jyg82LgoxiZ0bxmy97+qtAM3bA+9Btde7wx9f4A XZMPlkfz3gRusjhzZuOhgwkSoOj6BJWSITd13IZUIJqXaAXeyYfnaRTIEpXCQcYDFJ7f gG474MVyGlw7zByDIKJKV4doUHVc4tYIOLsrsgdxWId3jWOE6ex1YGBH5prQx1/XPHxv sndnKsJzMdHMkPQa75aslTNaHkCIAxM0R04Mf7ixF3Dmtbahbewjq9XTzfAWRzHb9M2s jL6w== X-Gm-Message-State: AA6/9RmIo6pnb91qzj3vh+fYtnRJXFvK1SCPkXv+aQgpaudaDTYW33WzeuTSoL2CDg3gXbxuAV8LISw87e0VZg== X-Received: by 10.107.164.234 with SMTP id d103mr25418497ioj.185.1476701354056; Mon, 17 Oct 2016 03:49:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.117.79 with HTTP; Mon, 17 Oct 2016 03:48:53 -0700 (PDT) In-Reply-To: References: From: Andriy Berestovskyy Date: Mon, 17 Oct 2016 12:48:53 +0200 Message-ID: To: Upendra Pathrikar Cc: users Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-users] Unable to transmit custom built packet in dpdk X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 10:49:15 -0000 Hey, In rte_eth_rx_burst() you are passing just a pointer to rte_mbuf, while the functions expects a pointer to an array. Andriy On Sun, Oct 16, 2016 at 5:19 PM, Upendra Pathrikar wrote: > 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.* -- Andriy Berestovskyy