All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olivier MATZ <olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Cristian Dumitrescu
	<cristian.dumitrescu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "dev-VfR2kkLFssw@public.gmane.org" <dev-VfR2kkLFssw@public.gmane.org>
Subject: Re: [v2 22/23] Packet Framework IPv4 pipeline sample app
Date: Mon, 09 Jun 2014 17:51:48 +0200	[thread overview]
Message-ID: <5395D814.7020000@6wind.com> (raw)
In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D891261B1C2415-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>

Cristian,

Please see some comments below.

On 06/09/2014 03:25 PM, Dumitrescu, Cristian wrote:
> 1. As the name implies, pktmbuf should be used for packets and ctrlmbuf
> should be used for control messages . IMHO using pktmbuf to control
> messages is a confusing workaround.

If ctrlmbuf are removed, the name pktmbuf would change in mbuf.
But anyway, to me it's not confusing at all to store data in a packet,
even if it's a data from a core to another.

> 2. Pktmbuf has a lot of overhead that is not needed in order to send
> short messages between cores. Pktmbuf has a lot of pointers and other
> fields that do not make sense for messages. I don't think we want people
> to say DPDK is difficult to use because e.g. sending 2 bytes from core A
> to core B requires initializing a bunch of pointers and other fields
> that do not make sense.

All the fields that should be initialized in a packet mbuf are
reset in rte_pktmbuf_reset() so the user won't have anything to do.
But using pktmbuf is not the only solution, you can use a private
application structure without duplicating code (see below).

> 3. Once we start using pktmbuf to send messages, it is likely that other
> people will follow this example, and they might do it incorrectly. I
> don't think we want to see emails on this list from people asking e.g:
>
> i) Why does my app segfaults, when all I want to do is send 2 bytes from
> core A to core B?
>
> ii) Why does my app segfaults when core A writes a message to a NIC TX
> queue?

Why would the application segfaults? Indeed, if you misuse any function,
it could segfault but is it a reason for not implementing the feature?

> Using an app dependent structure requires duplicating the work to
> create/free the pool of such structures, and alloc/free mechanism. And
> then some people will ask why are we not using ctrlmbuf, as long as
> ctrlmbuf exists in DPDK.

In this case, I would say that rte_mempool functions are enough to
allocate/free. If the ctrlmbuf structure is composed of a data array
and a length field, you only need:

   rte_mempool_get(mp, &ctrlmbuf);
   memcpy(ctrlmbuf->buf, my_data, my_data_len);
   ctrlmbuf->len = my_data_len;

> I think that, as long as we have ctrlmbuf and pktmbuf in DPDK, we should
> follow the existing model. We should not look for workarounds that we
> know we plan to change anyway, we should look for the right solution. We
> both agree we need to refresh pktmbuf and ctrlmbuf, but my point is we
> should not do changes as long as we don't know what the agreed solution
> will look like?

I agree, we should debate on what is the right solution, that's
precisely what I'm doing. To decide if ctrlmbuf should be kept
or changed, we should:
- understand its use-case if any and see what ctrlmbuf features
   are required
- understand why it should be included in rte_mbuf or not: in my opinion
   there is no reason to do it, and it this has a cost (ex: 1 byte lost
   in mbuf, mbuf fields badly organized)


Regards,
Olivier

  parent reply	other threads:[~2014-06-09 15:51 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04 18:08 [v2 00/23] Packet Framework Cristian Dumitrescu
     [not found] ` <1401905319-8882-1-git-send-email-cristian.dumitrescu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-06-04 18:08   ` [v2 01/23] librte_lpm: rule_is_present Cristian Dumitrescu
2014-06-04 18:08   ` [v2 02/23] mbuf: meta-data Cristian Dumitrescu
2014-06-04 18:08   ` [v2 03/23] Packet Framework librte_port: Port API Cristian Dumitrescu
2014-06-04 18:08   ` [v2 04/23] Packet Framework librte_port: ethdev ports Cristian Dumitrescu
2014-06-04 18:08   ` [v2 05/23] Packet Framework librte_port: ring ports Cristian Dumitrescu
2014-06-04 18:08   ` [v2 06/23] Packet Framework librte_port: IPv4 frag port Cristian Dumitrescu
2014-06-04 18:08   ` [v2 07/23] Packet Framework librte_port: IPv4 reassembly Cristian Dumitrescu
2014-06-04 18:08   ` [v2 08/23] Packet Framework librte_port: hierarchical scheduler port Cristian Dumitrescu
2014-06-04 18:08   ` [v2 09/23] Packet Framework librte_port: Source/Sink ports Cristian Dumitrescu
2014-06-04 18:08   ` [v2 10/23] Packet Framework librte_port: Build infrastructure Cristian Dumitrescu
2014-06-04 18:08   ` [v2 11/23] Packet Framework librte_table: Table API Cristian Dumitrescu
2014-06-04 18:08   ` [v2 12/23] Packet Framework librte_table: LPM IPv4 table Cristian Dumitrescu
2014-06-04 18:08   ` [v2 13/23] Packet Framework librte_table: LPM IPv6 table Cristian Dumitrescu
2014-06-04 18:08   ` [v2 14/23] Packet Framework librte_table: ACL table Cristian Dumitrescu
2014-06-04 18:08   ` [v2 15/23] Packet Framework librte_table: Hash tables Cristian Dumitrescu
2014-06-04 18:08   ` [v2 16/23] Packet Framework librte_table: array table Cristian Dumitrescu
2014-06-04 18:08   ` [v2 17/23] Packet Framework librte_table: Stub table Cristian Dumitrescu
2014-06-04 18:08   ` [v2 18/23] Packet Framework librte_table: Build infrastructure Cristian Dumitrescu
2014-06-04 18:08   ` [v2 19/23] Packet Framework librte_pipeline: Pipeline Cristian Dumitrescu
2014-06-04 18:08   ` [v2 20/23] librte_cfgfile: interpret config files Cristian Dumitrescu
     [not found]     ` <1401905319-8882-21-git-send-email-cristian.dumitrescu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-10-16 16:46       ` Thomas Monjalon
2014-10-17 18:16         ` Dumitrescu, Cristian
     [not found]           ` <3EB4FA525960D640B5BDFFD6A3D891262E090572-kPTMFJFq+rEMvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-10-17 18:50             ` Thomas Monjalon
2014-06-04 18:08   ` [v2 21/23] Packet Framework performance application Cristian Dumitrescu
2014-06-04 18:08   ` [v2 22/23] Packet Framework IPv4 pipeline sample app Cristian Dumitrescu
     [not found]     ` <1401905319-8882-23-git-send-email-cristian.dumitrescu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-06-09  9:11       ` Olivier MATZ
     [not found]         ` <53957A4E.6090401-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-06-09 10:49           ` Dumitrescu, Cristian
     [not found]             ` <3EB4FA525960D640B5BDFFD6A3D891261B1C2354-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-09 12:13               ` Olivier MATZ
     [not found]                 ` <5395A4F6.7050609-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-06-09 13:25                   ` Dumitrescu, Cristian
     [not found]                     ` <3EB4FA525960D640B5BDFFD6A3D891261B1C2415-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-09 15:51                       ` Olivier MATZ [this message]
2014-06-04 18:08   ` [v2 23/23] Packet Framework unit tests Cristian Dumitrescu
2014-06-05 11:01   ` [v2 00/23] Packet Framework De Lara Guarch, Pablo
2014-06-05 11:43   ` Cao, Waterman
2014-06-05 14:40   ` Ivan Boule
     [not found]     ` <53908147.6030804-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-06-17  1:27       ` Thomas Monjalon

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=5395D814.7020000@6wind.com \
    --to=olivier.matz-pdr9zngts4eavxtiumwx3w@public.gmane.org \
    --cc=cristian.dumitrescu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.