DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dan Gora <dg@adax.com>
To: Andrew Rybchenko <arybchenko@solarflare.com>
Cc: "Wiles, Keith" <keith.wiles@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	 Olivier Matz <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] [PATCH 1/4] mbuf: add accessor function for private data area
Date: Mon, 11 Jun 2018 19:24:35 -0700	[thread overview]
Message-ID: <CAGyogRYxwbejZpEegHMLmuUmrSs3rsUoQJonnqgFk65dKdwHHA@mail.gmail.com> (raw)
In-Reply-To: <b3a9fedf-2ada-973e-c8b1-5b0154508771@solarflare.com>

Hi Andrew,

On Sat, Jun 9, 2018 at 2:23 AM, Andrew Rybchenko
<arybchenko@solarflare.com> wrote:

> BTW, thinking about function I found out there is a trap in private area
> size related to the function. I think that the function description should
> highlight that rte_pktmbuf_priv_size(m->pool) should be used to
> find out the size of private area since indirect mbuf has size of the
> direct private are in its priv_size (but we return pointer to the indirect
> mbuf (the mbuf itself) private area here).
>

hmm... I guess I didn't realize that.

I think that what I'm going to do is just remove the check for
m->priv_size == 0 entirely.  It seems like checking the priv_size is
just going to cause more problems down the road than it is worth.  The
whole point of this was just to have a simple API function to access
the private area, not to fully save the programmer from shooting
him/herself in the foot by accessing a private data area which doesn't
necessarily exist.

thanks,
dan

      reply	other threads:[~2018-06-12  2:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07 23:54 Dan Gora
2018-06-08  8:30 ` Burakov, Anatoly
2018-06-08  9:06 ` Andrew Rybchenko
2018-06-08 17:19   ` Wiles, Keith
2018-06-09  0:24     ` Dan Gora
2018-06-09  9:23       ` Andrew Rybchenko
2018-06-12  2:24         ` Dan Gora [this message]

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=CAGyogRYxwbejZpEegHMLmuUmrSs3rsUoQJonnqgFk65dKdwHHA@mail.gmail.com \
    --to=dg@adax.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=keith.wiles@intel.com \
    --cc=olivier.matz@6wind.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).