patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Yaroslav Brustinov (ybrustin)" <ybrustin@cisco.com>
To: Shahaf Shuler <shahafs@mellanox.com>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>
Cc: "Yongseok Koh" <yskoh@mellanox.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix linkage error for glue lib
Date: Tue, 24 Jul 2018 14:24:12 +0000	[thread overview]
Message-ID: <f2667f4c0d0f4272bef96e9d0d766e28@XCH-ALN-002.cisco.com> (raw)
In-Reply-To: <DB7PR05MB4426199AE87257E29F482EFAC3550@DB7PR05MB4426.eurprd05.prod.outlook.com>

Hi,

Are you OK with C11?
I saw in file dpdk/drivers/net/mlx4/mlx4_utils.c:

     * C11 code would include stdalign.h and use alignof(max_align_t) however
     * we'll stick with C99 for the time being.

:)

As far as I understand, the issue is alignment of the pointer itself, not the struct.
I'm not familiar with this command: "alignof(max_align_t)".
Applying this on the struct:

    struct mlx5_glue {
    ...
    } __attribute__((__aligned__(64)));

    struct __attribute__((__aligned__(64))) mlx5_glue {
    ...
    };

...still keeps the linker unhappy.

Thanks,
Yaroslav.


-----Original Message-----
From: Shahaf Shuler [mailto:shahafs@mellanox.com] 
Sent: Tuesday, July 24, 2018 16:51
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Cc: Yongseok Koh <yskoh@mellanox.com>; dev@dpdk.org; Yaroslav Brustinov (ybrustin) <ybrustin@cisco.com>; stable@dpdk.org; Nélio Laranjeiro <nelio.laranjeiro@6wind.com>
Subject: RE: [PATCH] net/mlx5: fix linkage error for glue lib

Yaroslav, 

Tuesday, July 24, 2018 3:06 PM, Adrien Mazarguil:
> Subject: Re: [PATCH] net/mlx5: fix linkage error for glue lib
> > 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 <stdalign.h>
> >  #include <stddef.h>
> >
> >  [...]
> >  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;

Can you confirm the above suggestion fixes your issue? 

> 
> >

  reply	other threads:[~2018-07-24 14:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24  8:54 Shahaf Shuler
2018-07-24 12:00 ` Adrien Mazarguil
2018-07-24 12:05   ` Adrien Mazarguil
2018-07-24 13:51     ` Shahaf Shuler
2018-07-24 14:24       ` Yaroslav Brustinov (ybrustin) [this message]
2018-07-24 16:03         ` Adrien Mazarguil
2018-07-25  7:38           ` Yaroslav Brustinov (ybrustin)
2018-07-25  9:24             ` Adrien Mazarguil
2018-07-25 10:02               ` Yaroslav Brustinov (ybrustin)
2018-07-25 13:18 ` [dpdk-stable] [PATCH v2] " Shahaf Shuler
2018-07-25 13:22   ` Adrien Mazarguil
2018-07-26  5:44     ` Shahaf Shuler

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=f2667f4c0d0f4272bef96e9d0d766e28@XCH-ALN-002.cisco.com \
    --to=ybrustin@cisco.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=shahafs@mellanox.com \
    --cc=stable@dpdk.org \
    --cc=yskoh@mellanox.com \
    /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).