From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 516FD2BF1 for ; Tue, 24 Jul 2018 14:06:09 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id s14-v6so2300408wmc.1 for ; Tue, 24 Jul 2018 05:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=LlSV2/JKCqyEyzva5jtMqkHLsvkcyDwaKwCLFfdVKQo=; b=vWkSgz5RPqne1yJwNENeqKOY2QGrDRv+sz3VsWD1in2y194ayhB5mUyHvF75fDZaIQ 8165ilwn7HCiJtYjdHf4TkUxa1nS83Xa9WNlOLExvxHNz3DmeZSgTmujkHZ2hcnkZ5sO gXZyud2I8/1w6FlaJVpbRo7uO1HUinZ60J5t6E1RhdWRrVfSK4s6q+L1VUckMKqTFHxb 639RTB0UENO1zNk1TAtMJJrjonDTO1r5NApqBoIbTLHJmPHC1sJ3tmvT7U5J1+PcIHDO OyNP65glTsQMBpTA6wyC7AM7AkMYISF9UH2dp5ICHzXJ0FKzijQpxzdaPAwtTK3/k1nf RhlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=LlSV2/JKCqyEyzva5jtMqkHLsvkcyDwaKwCLFfdVKQo=; b=KkdM2ZJfzqTkUa6uapTQGrjzGxEtSdiyYXihwFziodcJySLtYJZUt/TnoxdPs01qSH kaU4baOTDW9X/NLa2UZIWcC+DTK8HM81Dk2BfBsklu19t3V/W4GHbsuLnZuOLLwtdOcG OUe5+i+vU2X/7t7JnOk11qS+CfT7MXi5GcqCuqI6KmrBASYFU8UCeh4OEmcJP+5QNhkb tlo2qxbFsWjcs9CAKYDYlf8RSnga4vZ+RY7PTPOMiQSO+Sa9mHNrs2O43tLviWXcOb6Q PlacB18dqVK0/cMww3KOoIJcBPwhGQsA8DtTbQ8O1WqQOSPXCLG2p2wo6H8KJX5a6Cqo LHiA== X-Gm-Message-State: AOUpUlH1X+jgTkhLAz7QcKnWuYtxZgVZuPWzp4+tFwC1o8/V0ldYwsEa cQdzGjqD2jCE3Q/i1Wod9/ahCg== X-Google-Smtp-Source: AAOMgpei1YsJfDQJY49RF7AH/fAuqR2+duuGkB7KoHJfKwdhen0jX21qqntVQ4HUV56yE1ZelQfAEw== X-Received: by 2002:a1c:8c08:: with SMTP id o8-v6mr1707005wmd.60.1532433968811; Tue, 24 Jul 2018 05:06:08 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id w185-v6sm2520576wmw.6.2018.07.24.05.06.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 05:06:08 -0700 (PDT) Date: Tue, 24 Jul 2018 14:05:51 +0200 From: Adrien Mazarguil To: Shahaf Shuler Cc: yskoh@mellanox.com, dev@dpdk.org, Yaroslav Brustinov , stable@dpdk.org, nelio.laranjeiro@6wind.com Message-ID: <20180724120551.GR5211@6wind.com> References: <20180724085445.52206-1-shahafs@mellanox.com> <20180724120048.GQ5211@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180724120048.GQ5211@6wind.com> Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix linkage error for glue lib X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 12:06:09 -0000 On Tue, Jul 24, 2018 at 02:00:48PM +0200, Adrien Mazarguil wrote: > On Tue, Jul 24, 2018 at 11:54:45AM +0300, Shahaf Shuler wrote: > > From: Yaroslav Brustinov > > > > Compiling with gcc 4.7.2 introduced the linkage error > > > > "bin/ld: Warning: alignment 8 of symbol `mlx5_glue' in > > src/dpdk/drivers/net/mlx5/mlx5_glue.c.21.o is smaller than 16 in > > src/dpdk/drivers/net/mlx5/mlx5_rxq.c.21.o" > > > > Fix it be forcing the alignment of the glue lib. > > > > Fixes: 0e83b8e536c1 ("net/mlx5: move rdma-core calls to separate file") > > Cc: stable@dpdk.org > > Cc: nelio.laranjeiro@6wind.com > > Cc: adrien.mazarguil@6wind.com > > > > Signed-off-by: Yaroslav Brustinov > > Signed-off-by: Shahaf Shuler > > Odd, how could this happen assuming both files are compiled during the same > run using identical flags? Looks like a compiler issue. > > Anyway, may I suggest an alignment constraint on the structure type in > mlx5_glue.h instead, so that all users inherit it. E.g. using C11 syntax: > > #include > #include > > [...] > alignas(max_align_t) > struct mlx5_glue { > [...] > }; My bad, this is not a correct use for alignas(), it doesn't work on types. How about this instead: alignas(max_align_t) const struct mlx5_glue *mlx5_glue; > > > --- > > drivers/net/mlx5/mlx5_glue.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c > > index c7965e51fe..c56c69bb13 100644 > > --- a/drivers/net/mlx5/mlx5_glue.c > > +++ b/drivers/net/mlx5/mlx5_glue.c > > @@ -343,7 +343,9 @@ mlx5_glue_dv_create_qp(struct ibv_context *context, > > #endif > > } > > > > -const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){ > > +const struct mlx5_glue *mlx5_glue __attribute__((__aligned__(64))) = > > + &(const struct mlx5_glue) > > +{ > > .version = MLX5_GLUE_VERSION, > > .fork_init = mlx5_glue_fork_init, > > .alloc_pd = mlx5_glue_alloc_pd, > > -- > > 2.12.0 > > > > -- > Adrien Mazarguil > 6WIND -- Adrien Mazarguil 6WIND