From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by dpdk.org (Postfix) with ESMTP id E3732C604 for ; Wed, 24 Jun 2015 12:05:12 +0200 (CEST) Received: by wicgi11 with SMTP id gi11so41398739wic.0 for ; Wed, 24 Jun 2015 03:05:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=JSQOsXHAzPj3niaSDq85JpejJ6Jga2Tt4soYbhRlcDg=; b=HStxDbDZ5R2VoqMFFvSL0yBVGSXQGAW91Y5FSIIwPM2j21q+nNf46h7tx/Mwc3NnEV J8tYzwBjXOschuQwGn5dFMwg6FhvvxN0UT0P42/VeSBDLa9VBKBQiwXGRgTp8ZsFNJE5 p+zPSdszns49WL1bfJeVWjCngQ76I+ahuUibZP6SKOvDB0U2NFx6PIIDg75GJsxOD/ZJ LzffvlXpD+vdfRF9DYPOmynpG0n/xCPl78dA1/JjZY19UksU6abR1rNEkNBGK9JCpJAn xzVuPlqgGr9FCzUopGjfqbeAOvkT++9VmwYrFGco0ID7048USgnqUkCG/SSs8wcDf0Ra GcjQ== X-Gm-Message-State: ALoCoQkzp3bjXIyyQ7DTxYkfLvI1lNn+TQeUnnd/bii8gwqjUkv0FSbWQlOd7UOL6UPyC3WOIk+U X-Received: by 10.194.109.97 with SMTP id hr1mr17888504wjb.95.1435140312749; Wed, 24 Jun 2015 03:05:12 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id a6sm6895281wjy.33.2015.06.24.03.05.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jun 2015 03:05:11 -0700 (PDT) From: Thomas Monjalon To: Cyril Chemparathy Date: Wed, 24 Jun 2015 12:04:04 +0200 Message-ID: <4738325.X6Ky7M8NBC@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <55897D08.7090209@6wind.com> References: <1434998063-15739-1-git-send-email-cchemparathy@ezchip.com> <55897D08.7090209@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v4 0/9] Improve cast alignment for strict aligned machines X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2015 10:05:13 -0000 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 Applied, thanks