From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ernst.netinsight.se (ernst.netinsight.se [194.16.221.21]) by dpdk.org (Postfix) with SMTP id B9C4558D8 for ; Mon, 7 Sep 2015 12:41:05 +0200 (CEST) Received: from [10.100.1.152] (unverified [10.100.1.152]) by ernst.netinsight.se (EMWAC SMTPRS 0.83) with SMTP id ; Mon, 07 Sep 2015 12:40:58 +0200 Message-ID: <55ED69BA.4010803@netinsight.net> Date: Mon, 07 Sep 2015 12:40:58 +0200 From: =?windows-1252?Q?Simon_K=E5gstr=F6m?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Olivier MATZ , "Ananyev, Konstantin" , "dev@dpdk.org" , "Zhang, Helin" , "Gonzalez Monroy, Sergio" , "Burakov, Anatoly" References: <20150831144110.4a7afa27@miho> <55ED3D9A.7070607@6wind.com> <2601191342CEEE43887BDE71AB97725836A83CBA@irsmsx105.ger.corp.intel.com> <55ED5A6A.1000803@6wind.com> In-Reply-To: <55ED5A6A.1000803@6wind.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH RFC] mbuf/ip_frag: Move mbuf chaining to common code 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: Mon, 07 Sep 2015 10:41:06 -0000 On 2015-09-07 11:35, Olivier MATZ wrote: >> Wonder why do we need to do that? >> Probably head mbuf is out of space and want to expand it using pktmbuf_chain()? >> So in that case seems logical: >> 1) allocate new mbuf (it's pkt_len will be 0) >> b) call pktmbuf_chain() > > By experience, having empty segments in the middle of a mbuf > chain is problematic (functions getting ptr at offsets, some pmds > or hardware may behave badly), I wanted to avoid that risk. > > Now, the use-case you described is legitimate. Another option would > be to have another function pktmbuf_append_new(m) that returns a new > mbuf that is already chained to the other. I see with that method in that you have to remember to actually update pkt_len in the head buffer when chaining an empty mbuf. Anyway, to disallow this behavior should probably not be the responsibility of rte_pktmbuf_chain(), so I'm fine with leaving the check out. // Simon