From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) by dpdk.org (Postfix) with ESMTP id BE2C72C29 for ; Sun, 16 Oct 2016 17:19:07 +0200 (CEST) Received: by mail-lf0-f50.google.com with SMTP id x79so244093178lff.0 for ; Sun, 16 Oct 2016 08:19:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=IsQs6/+4VPY8SDc2N1Tcybpdk1ylrLJ/1YGu2lZTevc=; b=y/h6p9oArJ/3HEYLgoR2RRvu225qvyD66xn7CpfwSi2vARbQBqXpqvRWfmNiJJIsvu n20/4ccc9RNNBrvSP1bDvpRYCnvsUj0awylBp+5cXMEX9SAvORX0yHU+Q+w3Tl5wkm69 1QEXdGnx6qcNnoySxdml0FqS+8nP+AgMVpeDNuwHkorPPNKwDjaOUfVELrx3QdIYsn8x fVf29uVc8BtfFI1pYsoMToOWLozy7cKQq4uXlXFbWYqm/cOP7pOt13ICxgl6p0naa4lL RdLVN2xqX+KMqivdGuMapll2Fz2qrLgx7ZAbMCSBWGCEzdkV6wRJfpOqN7qQl5SwS07p PHCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=IsQs6/+4VPY8SDc2N1Tcybpdk1ylrLJ/1YGu2lZTevc=; b=Hfye6S+Wzqr+mKtAGZppjeK1WBoD//cahFuu20L1qbvhzTUM1ODy5uoNmwMbacN3Lk +QSD/VvQ1lVLV7Z5fBz4521Mk7iuisVqZFubWWtOQOdTZOCxdEzM3fTbgwlIo2MLRL3y nEaDHUlE0T9cIDueKZuiFriZI0zL5574KyNCHwQPb5a71W5I1j9q1u4fU11vSkrci1Ox 5/tQaNV2fA3nhGV4kt0C6doxdEm5LqNfWkZZ7uvZKbL9sWHJhbY6vS0zFNYgKIsbE82F mDcThnbz75fgjMD6e3tz3XXY4roJlWr9bTUlpgsMU6S8VSdVbNPFHB6ecR2Tob3zEeNk Ideg== X-Gm-Message-State: AA6/9RkHFJ2O/JuYH06+kqml32j4a0I10E8U/0jBAabcv2U4ZcyCrpa7wtWfjkuPTPyo0L2iYRwr7It+cvaiaQ== X-Received: by 10.25.5.205 with SMTP id 196mr8757226lff.59.1476631146978; Sun, 16 Oct 2016 08:19:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.193.193 with HTTP; Sun, 16 Oct 2016 08:19:06 -0700 (PDT) From: Upendra Pathrikar Date: Sun, 16 Oct 2016 20:49:06 +0530 Message-ID: To: users@dpdk.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [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: Sun, 16 Oct 2016 15:19:07 -0000 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.*