From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id AB4CD1DA4 for ; Tue, 24 Jul 2018 14:01:05 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id s9-v6so2262103wmh.3 for ; Tue, 24 Jul 2018 05:01:05 -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=UhXHMneFAzZSF92Vs/GFTspjmQVhgWRLfyDvKE6MKvk=; b=f0NkT4UUhYa5lrDxWFu5I1Lsf8ZeycMQyjprH/ZriSL7JylEZS/C6GLhgz/QQfnsGb KxufCLMSoFzcQvNC6yiQV8nEHnYrZkHyLxsChUl4i+iGwzMhTqUwYUDRQha015W2iwls xr8TSnJ6lQyYd66ZzbeOjpmcG7rEziyHbJ33d0CaGq9+gdm2nTajOnPR0fztDQ/UPnCR EgERxcc/PnZTB29uPn6KhMaNqKP8Tql9LAOghIe3+L0fVzhPGz4hE1TdqfplFcXMyJD0 8g7mN7Ws+28PEjOuZ/vFeDWeNvKqJLzZ0ZSmeBUDa7VYD5wyANezEICN9U6dtF6VR0+7 v0hg== 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=UhXHMneFAzZSF92Vs/GFTspjmQVhgWRLfyDvKE6MKvk=; b=gjKgSQACcDX6mmfKGwN7uM7gMCmvWwOEMWmvp9g7WvISSaQ3NS4Ntm3CTZR6aIf/qU XzdYNjuc5K/BR3VqG7uNTRKYzFpRuS3UypGp1Ocr5+TxsKjGwg5PYAMabK1LKNzV3rfO ElGYM5RSUiL1BED2irlnhTpguiBhwfURQVY/VEue5Y5sKhWN/4H8U3L4aZAWOF2RCBDi UyBWdIL8y9E3G+hL12fnKbKSxSGlRU37mKWsl4GvDnCMs/T3EeWTjzCnsSeWttP2b/jP JyqSJFamY38Y+8tE0lSczKV7vXBGKP4iQ4aDY503UQWq+9uY1TWh/W/rJvqorWNF1YXP L/+Q== X-Gm-Message-State: AOUpUlFEvIu7xNLY8YjDSzBzW0DD0Y2hAzMmorobEpOkgUMu4pZwcli+ ML/8SEojs13IVkRIU5uazSrTUg== X-Google-Smtp-Source: AAOMgpfRKr+Aim8zIcCxyaVMfpp5kbIYJiRUIUfWsJY5Ban6xgRw7y2jjkO8h/renux+23M0sIrxjA== X-Received: by 2002:a1c:c7c1:: with SMTP id x184-v6mr1749527wmf.134.1532433665454; Tue, 24 Jul 2018 05:01:05 -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 31-v6sm17630224wra.26.2018.07.24.05.01.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 05:01:04 -0700 (PDT) Date: Tue, 24 Jul 2018 14:00:48 +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: <20180724120048.GQ5211@6wind.com> References: <20180724085445.52206-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180724085445.52206-1-shahafs@mellanox.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:01:05 -0000 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 { [...] }; > --- > 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