DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Simon Kågström" <simon.kagstrom@netinsight.net>
To: Olivier MATZ <olivier.matz@6wind.com>,
	 "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Zhang, Helin" <helin.zhang@intel.com>,
	 "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>,
	"Burakov, Anatoly" <anatoly.burakov@intel.com>
Subject: Re: [dpdk-dev] [PATCH RFC] mbuf/ip_frag: Move mbuf chaining to common code
Date: Mon, 07 Sep 2015 12:40:58 +0200	[thread overview]
Message-ID: <55ED69BA.4010803@netinsight.net> (raw)
In-Reply-To: <55ED5A6A.1000803@6wind.com>

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

  reply	other threads:[~2015-09-07 10:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31 12:41 Simon Kagstrom
2015-09-07  7:32 ` Olivier MATZ
2015-09-07  9:13   ` Ananyev, Konstantin
2015-09-07  9:35     ` Olivier MATZ
2015-09-07 10:40       ` Simon Kågström [this message]
2015-09-07 11:43         ` [dpdk-dev] [PATCH v2] " Simon Kagstrom
2015-09-07 12:32           ` Ananyev, Konstantin
2015-09-07 12:41             ` Simon Kågström
2015-09-07 23:21               ` Ananyev, Konstantin
2015-09-08 10:40                 ` Simon Kågström
2015-09-09  8:22                   ` Ananyev, Konstantin
2015-09-07 12:50           ` [dpdk-dev] [PATCH v3] " Simon Kagstrom
2015-10-13 12:50             ` Simon Kagstrom
2015-10-13 13:17               ` Thomas Monjalon
2015-10-13 13:11             ` Olivier MATZ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55ED69BA.4010803@netinsight.net \
    --to=simon.kagstrom@netinsight.net \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=olivier.matz@6wind.com \
    --cc=sergio.gonzalez.monroy@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).