All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olivier MATZ <olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Zoltan Kiss <zoltan.kiss-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	dev-VfR2kkLFssw@public.gmane.org,
	dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org
Subject: Re: ovs-dpdk: placing the metadata
Date: Wed, 25 Mar 2015 18:04:07 +0100	[thread overview]
Message-ID: <5512EA87.1020707@6wind.com> (raw)
In-Reply-To: <5511A1F0.40605-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

Hi Zoltan,

On 03/24/2015 06:42 PM, Zoltan Kiss wrote:
> Hi,
>
> I've noticed in lib/netdev-dpdk.c that __rte_pktmbuf_init() stores the
> packet metadata right after "struct rte_mbuf", and before the buffer data:
>
>      /* start of buffer is just after mbuf structure */
>      m->buf_addr = (char *)m + sizeof(struct dp_packet);
>
> (struct dp_packet has the rte_mbuf as first member if DPDK enabled)
>
> However, lib/librte_mbuf/rte_mbuf.h seems to codify that the buffer
> should start right after the rte_mbuf:
>
> /**
>   * Given the buf_addr returns the pointer to corresponding mbuf.
>   */
> #define RTE_MBUF_FROM_BADDR(ba)     (((struct rte_mbuf *)(ba)) - 1)
>
> /**
>   * Given the pointer to mbuf returns an address where it's  buf_addr
>   * should point to.
>   */
> #define RTE_MBUF_TO_BADDR(mb)       (((struct rte_mbuf *)(mb)) + 1)
>
> These macros are used for attaching/detaching mbuf's to each other. This
> is the way the code retrieves the direct buffer from an indirect one,
> and vica versa. I think if we want to keep the metadata feature (which I
> guess is quite important), we need to add a pointer to rte_mbuf, which
> helps the direct and indirect structs to find each other. Something like:
>
>      struct rte_mbuf *attach;    /**< Points to the other buffer if this
> one
>                       is (in)direct. Otherwise NULL.  */
>
> What do you think?

I've just sent a patch that should fix this issue.
http://dpdk.org/ml/archives/dev/2015-March/015722.html

Let me know if you have any comment on it.

Regards,
Olivier

  parent reply	other threads:[~2015-03-25 17:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 17:42 ovs-dpdk: placing the metadata Zoltan Kiss
     [not found] ` <5511A1F0.40605-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-03-25 17:04   ` Olivier MATZ [this message]
     [not found]     ` <5512EA87.1020707-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2015-03-25 18:57       ` [dpdk-dev] " Zoltan Kiss
     [not found]         ` <55130506.4090000-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-03-26  8:44           ` 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=5512EA87.1020707@6wind.com \
    --to=olivier.matz-pdr9zngts4eavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org \
    --cc=zoltan.kiss-QSEj5FYQhm4dnm+yROfE0A@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.