From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Medvedkin Subject: Re: Crafting a packet for transmission. Date: Thu, 13 Mar 2014 15:48:47 +0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: "dev-VfR2kkLFssw@public.gmane.org" To: sabu kurian Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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 >