DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Cyril Chemparathy <cchemparathy@ezchip.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v4 0/9] Improve cast alignment for strict aligned machines
Date: Wed, 24 Jun 2015 12:04:04 +0200	[thread overview]
Message-ID: <4738325.X6Ky7M8NBC@xps13> (raw)
In-Reply-To: <55897D08.7090209@6wind.com>

2015-06-23 17:36, Olivier MATZ:
> On 06/22/2015 08:34 PM, Cyril Chemparathy wrote:
> > This series contains a few improvements that allow the DPDK code base
> > to build properly on machines that enforce strict pointer cast
> > alignment constraints.
> >
> > When dealing with packet data which could be arbitrarily aligned, we
> > get the compiler to do the right thing by (a) making sure that header
> > types are packed, and (b) introducing and using
> > unaligned_uint(16|32|64)_t types when upcasting from byte pointers.
> >
> > In a few other instances, we know apriori that the pointer cast cannot
> > possibly break alignment.  This applies to the changes in mempool,
> > hash, mbuf, and the ethdev stats code.  Here, we simply silence the
> > compiler by casting through (void *) using the RTE_PTR_(ADD|SUB)
> > macros.
> >
> > Finally, we introduce a new rte_pktmbuf_mtod_offset() helper to return
> > a type casted pointer to an offset within the packet data.  This
> > replaces the following commonly used pattern:
> > 	(struct foo *)(rte_pktmbuf_mtod(m, char *) + offset)
> > with:
> > 	rte_pktmbuf_mtod_offset(m, struct foo *, offset)
> >
> > To ensure consistency, the above transform was applied throughout the
> > code base using the coccinelle semantic patching tool.
> 
> Series
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks

      parent reply	other threads:[~2015-06-24 10:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22 18:34 Cyril Chemparathy
2015-06-22 18:34 ` [dpdk-dev] [PATCH v4 1/9] mempool: silence -Wcast-align on pointer arithmetic Cyril Chemparathy
2015-06-22 18:34 ` [dpdk-dev] [PATCH v4 2/9] mbuf: " Cyril Chemparathy
2015-06-22 18:34 ` [dpdk-dev] [PATCH v4 3/9] ethdev: " Cyril Chemparathy
2015-06-22 18:34 ` [dpdk-dev] [PATCH v4 4/9] hash: " Cyril Chemparathy
2015-06-22 18:34 ` [dpdk-dev] [PATCH v4 5/9] eal: add and use unaligned integer types Cyril Chemparathy
2015-06-22 18:34 ` [dpdk-dev] [PATCH v4 6/9] app/test-pmd: pack simple_gre_hdr Cyril Chemparathy
2015-06-22 18:34 ` [dpdk-dev] [PATCH v4 7/9] librte_mbuf: Add rte_pktmbuf_mtod_offset() Cyril Chemparathy
2015-06-22 18:34 ` [dpdk-dev] [PATCH v4 8/9] librte_mbuf: Add transform for rte_pktmbuf_mtod_offset() Cyril Chemparathy
2015-06-22 18:34 ` [dpdk-dev] [PATCH v4 9/9] librte_mbuf: Apply mtod-offset.cocci transform Cyril Chemparathy
2015-06-23 15:36 ` [dpdk-dev] [PATCH v4 0/9] Improve cast alignment for strict aligned machines Olivier MATZ
2015-06-23 17:36   ` Cyril Chemparathy
2015-06-24 10:04   ` Thomas Monjalon [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=4738325.X6Ky7M8NBC@xps13 \
    --to=thomas.monjalon@6wind.com \
    --cc=cchemparathy@ezchip.com \
    --cc=dev@dpdk.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 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).