Linux-RDMA Archive on lore.kernel.org
 help / color / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Gal Pressman <galpress@amazon.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	kernel test robot <lkp@intel.com>, Jason Gunthorpe <jgg@ziepe.ca>,
	Doug Ledford <dledford@redhat.com>,
	kbuild-all@lists.01.org,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	linux-rdma@vger.kernel.org,
	Alexander Matushevsky <matua@amazon.com>,
	Shadi Ammouri <sammouri@amazon.com>,
	Yossi Leybovich <sleybo@amazon.com>
Subject: Re: [PATCH for-next v2 3/4] RDMA/efa: User/kernel compatibility handshake mechanism
Date: Wed, 22 Jul 2020 08:51:52 -0700
Message-ID: <20200722155152.GA3836710@ubuntu-n2-xlarge-x86> (raw)
In-Reply-To: <2567f2dc-90e7-a0ca-e322-f585bda08e42@amazon.com>

On Wed, Jul 22, 2020 at 09:35:14AM +0300, 'Gal Pressman' via Clang Built Linux wrote:
> On 21/07/2020 20:10, Nick Desaulniers wrote:
> > On Tue, Jul 21, 2020 at 4:27 AM 'Gal Pressman' via Clang Built Linux
> > <clang-built-linux@googlegroups.com> wrote:
> >>
> >> On 20/07/2020 20:08, kernel test robot wrote:
> >>> Hi Gal,
> >>>
> >>> I love your patch! Yet something to improve:
> >>>
> >>> [auto build test ERROR on 5f0b2a6093a4d9aab093964c65083fe801ef1e58]
> >>>
> >>> url:    https://github.com/0day-ci/linux/commits/Gal-Pressman/Add-support-for-0xefa1-device/20200720-160419
> >>> base:    5f0b2a6093a4d9aab093964c65083fe801ef1e58
> >>> config: x86_64-allyesconfig (attached as .config)
> >>> compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cf1105069648446d58adfb7a6cc590013d6886ba)
> >>
> >> Uh, looks like I use some gcc specific stuff here.. I guess it's time to start
> >> checking clang compilation as well :).
> >>
> >> Will fix and resubmit.
> > 
> >>> drivers/infiniband/hw/efa/efa_verbs.c:1539:18: error: invalid application of 'sizeof' to an incomplete type 'struct (anonymous struct at drivers/infiniband/hw/efa/efa_verbs.c:1529:2) []'
> >            for (i = 0; i < ARRAY_SIZE(user_comp_handshakes); i++) {
> >                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 
> > is user_comp_handshakes forward declared but not defined for an allyesconfig?
> > 
> 
> I don't think that's the issue here, the real problem is the first error:
> 
> >> drivers/infiniband/hw/efa/efa_verbs.c:1533:3: error: function definition is not allowed here
>                    DEFINE_COMP_HANDSHAKE(max_tx_batch, EFA_ALLOC_UCONTEXT_CMD_COMP_TX_BATCH),
>                    ^
>    drivers/infiniband/hw/efa/efa_verbs.c:1520:4: note: expanded from macro 'DEFINE_COMP_HANDSHAKE'
>                            DEFINE_GET_DEV_ATTR_FUNC(_attr)                        \
>                            ^
>    drivers/infiniband/hw/efa/efa_verbs.c:1506:2: note: expanded from macro 'DEFINE_GET_DEV_ATTR_FUNC'
> 
> 
> Apparently the braced group (is that how its called?) is supported by gcc, but not clang.
> 

I believe you are trying to use nested functions, which are not
supported by clang:

https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html

clang supports both scoped statements and GNU C statement expressions
but you are trying to define a function within a GNU C statement
expression and use it in a designated initializer (in
DEFINE_COMP_HANDSHAKE with DEFINE_GET_DEV_ATTR_FUNC and
DEFINE_CHECK_COMP_FUNC), which causes a problem with clang.

Cheers,
Nathan

  reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20  8:01 [PATCH for-next v2 0/4] Add support for 0xefa1 device Gal Pressman
2020-07-20  8:01 ` [PATCH for-next v2 1/4] RDMA/efa: Expose maximum TX doorbell batch Gal Pressman
2020-07-20  8:01 ` [PATCH for-next v2 2/4] RDMA/efa: Expose minimum SQ size Gal Pressman
2020-07-20  8:01 ` [PATCH for-next v2 3/4] RDMA/efa: User/kernel compatibility handshake mechanism Gal Pressman
2020-07-20 17:08   ` kernel test robot
2020-07-21 11:26     ` Gal Pressman
2020-07-21 17:10       ` Nick Desaulniers
2020-07-22  6:35         ` Gal Pressman
2020-07-22 15:51           ` Nathan Chancellor [this message]
2020-07-20  8:01 ` [PATCH for-next v2 4/4] RDMA/efa: Add EFA 0xefa1 PCI ID Gal Pressman

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=20200722155152.GA3836710@ubuntu-n2-xlarge-x86 \
    --to=natechancellor@gmail.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=dledford@redhat.com \
    --cc=galpress@amazon.com \
    --cc=jgg@ziepe.ca \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=matua@amazon.com \
    --cc=ndesaulniers@google.com \
    --cc=sammouri@amazon.com \
    --cc=sleybo@amazon.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

Linux-RDMA Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rdma/0 linux-rdma/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rdma linux-rdma/ https://lore.kernel.org/linux-rdma \
		linux-rdma@vger.kernel.org
	public-inbox-index linux-rdma

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rdma


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git