From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qa0-x231.google.com (mail-qa0-x231.google.com [IPv6:2607:f8b0:400d:c00::231]) by dpdk.org (Postfix) with ESMTP id A413568A9 for ; Fri, 14 Mar 2014 13:02:39 +0100 (CET) Received: by mail-qa0-f49.google.com with SMTP id j7so2331605qaq.8 for ; Fri, 14 Mar 2014 05:04:10 -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=5+mzzQAWEq83lVph7/OP4kT/hOJqhHANX0+MJQvyoYw=; b=uYCmgKgJKKXdepM15yPpoMWr1J4F7VZ9APxeLwyvzCgwdBVKCH2RC+1XygRpXlca7s RkScXU0ZbFve7b+aWyNekAh1OfwylEcbGj3DhEpPY/Pq2sCtQU2iAj6K6vmXXDVNPNet 1tXA//xUtaqMmYTs7LpvmpzjNyfVIRNFP0v8dYP8bV3Gla3KNsuHXlN3BcicDrJ+apTp lSSsntEJmUp5bNc/82RmnRo4tmltkPtplOELD/3Ko8OcaOu/W+i2aTXuf56GoXz9k62q vzrXrrwwSmktw+2MxJnY6ToyRNGSFJ0uFj2sqOPhXCyXGK5YfAv0AJOi/yi0j+fI7Rco YC1A== MIME-Version: 1.0 X-Received: by 10.224.92.75 with SMTP id q11mr9243410qam.56.1394798649962; Fri, 14 Mar 2014 05:04:09 -0700 (PDT) Received: by 10.96.69.97 with HTTP; Fri, 14 Mar 2014 05:04:09 -0700 (PDT) In-Reply-To: <59AF69C657FD0841A61C55336867B5B01A9C4588@IRSMSX103.ger.corp.intel.com> References: <59AF69C657FD0841A61C55336867B5B01A9C4436@IRSMSX103.ger.corp.intel.com> <59AF69C657FD0841A61C55336867B5B01A9C452F@IRSMSX103.ger.corp.intel.com> <59AF69C657FD0841A61C55336867B5B01A9C4588@IRSMSX103.ger.corp.intel.com> Date: Fri, 14 Mar 2014 17:34:09 +0530 Message-ID: From: sabu kurian To: "Richardson, Bruce" 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] Packet crafting.... 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: Fri, 14 Mar 2014 12:02:40 -0000 Ok thanks a lot Richardson. I got your point. What confused me was that the size of MBUF and the maximum size are all passed to 'rte_mempool_create' . rte_pktmbuf_alloc has only one parameter , a pointer to the mbuf pool. I got it cleared now. Thanks for your valuable time. Can you answer my other question ?... like I get a segmentation fault when I try to print the ether_type for a packet. This is the print statement: printf("\n Type is %" PRIu16 , *((uint16_t *)eth_type)); Regards On Fri, Mar 14, 2014 at 5:19 PM, Richardson, Bruce < bruce.richardson@intel.com> wrote: > > > From: sabu kurian [mailto:sabu2kurian@gmail.com] > > Sent: Friday, March 14, 2014 11:38 AM > > To: Richardson, Bruce > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] Packet crafting.... > > > > Thanks on the reply Richardson. You did mention something like "Don't > forget that when you get the mbuf from > > rte_pktmbuf_alloc, you also need to set the length value to the > appropriate size." . > > > > Like I'm allocating the mbuf using rte_mbuf . The rte_mempool_create has > already set the maximum packet size > > for a mbuf and the number of mbuf's and all. So do I really need to > use rte_pktmbuf_alloc ? > > How are you getting an mbuf from the pool, if not using rte_pktmbuf_alloc? > When you have an mbuf, that buffer has a maximum size, generally around > 2k. However, the packet inside that buffer is generally smaller than the > overall buffer size and you must configure that size, otherwise the PMD, > and therefore the NIC, has no idea how much data out of that 2k buffer > needs to be transmitted. >