From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-la0-x235.google.com (mail-la0-x235.google.com [IPv6:2a00:1450:4010:c03::235]) by dpdk.org (Postfix) with ESMTP id 0130E591E for ; Thu, 13 Mar 2014 12:47:17 +0100 (CET) Received: by mail-la0-f53.google.com with SMTP id b8so584322lan.40 for ; Thu, 13 Mar 2014 04:48:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=OMuM0GYUYlUMkHyVC0Mp+QeiAnZZ4kIEUn/gPgc7Esk=; b=uZkSUj2cnXQVuVb5TneYIs5JMeAgm5wymnRrk0+7rUDoBg95E3POCWFonNu6oHtcTw WKTDj9sfyKGe0N84F1LPHoBgzdf/mn27UoiuZj4tgM57iZTZduBCNHEnFiaiIiKRNL04 87Ne8UGQMS39rnmJ+Yqx0CgsW+yDPNhtxtiRrML8bC7U1jgqmGGi0vlD/JrfPZhoTq/e 8Hp6BCfCiVXDUwHguwdPdEKGwxmmEhFq874/HF3SJX+DGRjAyWNRf3Fv3lJCCRE0u6ln SC5yQ5mudOp1cWwCpMK4o468aELoUQbZpmdYjxNgkpSnuJ3l0Wv5O+Bw94ZeUfMG0dJV PNxQ== MIME-Version: 1.0 X-Received: by 10.152.18.229 with SMTP id z5mr943685lad.27.1394711327652; Thu, 13 Mar 2014 04:48:47 -0700 (PDT) Received: by 10.114.174.82 with HTTP; Thu, 13 Mar 2014 04:48:47 -0700 (PDT) In-Reply-To: References: Date: Thu, 13 Mar 2014 15:48:47 +0400 Message-ID: From: Vladimir Medvedkin To: sabu kurian Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] Crafting a packet for transmission. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 11:47:18 -0000 Hi, At first look at https://github.com/Pktgen/Pktgen-DPDK If you need your custom app: - alloc mbuf with rte_pktmbuf_alloc - fill up L2-4 headers fields (look at rte_pktmbuf_append func for example) - send packet via rte_eth_tx_burst Regards, Vladimir 2014-03-13 15:15 GMT+04:00 sabu kurian : > Hai friends, > > My requirement is to create a packet generator. So I could use > > struct rte_mbuf * m; > > to create a single packet holder. So how am I suppose to fill in the packet > details like the MAC source , destination and also the IP source , > destination (in case of IPv4 packets). > > Following the l2fwd example, which has got the TAP interface to write the > data to and read the data from. > > using the ether_hdr , one could read the MAC address from the packet > > eth = rte_pktmbuf_mtod(m, struct ether_hdr *); > tmp = ð->s_addr.addr_bytes[0]; > > But how am I suppose to craft a packet and supply in all these details , so > that I could sent the packet via rte_eth_tx_burst > > > Thanks in advance >