All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Nuno Gonçalves" <nunog@fr24.com>,
	"Björn Töpel" <bjorn@kernel.org>,
	"Magnus Karlsson" <magnus.karlsson@intel.com>,
	"Maciej Fijalkowski" <maciej.fijalkowski@intel.com>,
	"Jonathan Lemon" <jonathan.lemon@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Christian Brauner" <brauner@kernel.org>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Jesper Dangaard Brouer" <hawk@kernel.org>,
	"John Fastabend" <john.fastabend@gmail.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	netdev@vger.kernel.org, "Nuno Gonçalves" <nunog@fr24.com>,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next] xsk: allow remap of fill and/or completion rings
Date: Tue, 21 Mar 2023 04:34:56 +0800	[thread overview]
Message-ID: <202303210446.mO2yxOwo-lkp@intel.com> (raw)
In-Reply-To: <20230320105323.187307-1-nunog@fr24.com>

Hi Nuno,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Nuno-Gon-alves/xsk-allow-remap-of-fill-and-or-completion-rings/20230320-190022
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link:    https://lore.kernel.org/r/20230320105323.187307-1-nunog%40fr24.com
patch subject: [PATCH bpf-next] xsk: allow remap of fill and/or completion rings
config: i386-randconfig-a013 (https://download.01.org/0day-ci/archive/20230321/202303210446.mO2yxOwo-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/56f6a0c68dd5f4419fd7685cc83ceee2c70f3f2e
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Nuno-Gon-alves/xsk-allow-remap-of-fill-and-or-completion-rings/20230320-190022
        git checkout 56f6a0c68dd5f4419fd7685cc83ceee2c70f3f2e
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash net/xdp/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303210446.mO2yxOwo-lkp@intel.com/

All errors (new ones prefixed by >>):

>> net/xdp/xsk.c:1303:24: error: use of undeclared identifier 'xs'
           int state = READ_ONCE(xs->state);
                                 ^
>> net/xdp/xsk.c:1303:24: error: use of undeclared identifier 'xs'
>> net/xdp/xsk.c:1303:24: error: use of undeclared identifier 'xs'
>> net/xdp/xsk.c:1303:24: error: use of undeclared identifier 'xs'
>> net/xdp/xsk.c:1303:24: error: use of undeclared identifier 'xs'
>> net/xdp/xsk.c:1303:24: error: use of undeclared identifier 'xs'
>> net/xdp/xsk.c:1303:24: error: use of undeclared identifier 'xs'
>> net/xdp/xsk.c:1303:6: error: initializing 'int' with an expression of incompatible type 'void'
           int state = READ_ONCE(xs->state);
               ^       ~~~~~~~~~~~~~~~~~~~~
>> net/xdp/xsk.c:1318:8: error: cannot take the address of an rvalue of type 'struct xsk_queue *'
                           q = READ_ONCE(state == XSK_READY ? xs->fq_tmp :
                               ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:50:2: note: expanded from macro 'READ_ONCE'
           __READ_ONCE(x);                                                 \
           ^           ~
   include/asm-generic/rwonce.h:44:70: note: expanded from macro '__READ_ONCE'
   #define __READ_ONCE(x)  (*(const volatile __unqual_scalar_typeof(x) *)&(x))
                                                                         ^ ~
   net/xdp/xsk.c:1321:8: error: cannot take the address of an rvalue of type 'struct xsk_queue *'
                           q = READ_ONCE(state == XSK_READY ? xs->cq_tmp :
                               ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:50:2: note: expanded from macro 'READ_ONCE'
           __READ_ONCE(x);                                                 \
           ^           ~
   include/asm-generic/rwonce.h:44:70: note: expanded from macro '__READ_ONCE'
   #define __READ_ONCE(x)  (*(const volatile __unqual_scalar_typeof(x) *)&(x))
                                                                         ^ ~
   10 errors generated.


vim +/xs +1303 net/xdp/xsk.c

  1297	
  1298	static int xsk_mmap(struct file *file, struct socket *sock,
  1299			    struct vm_area_struct *vma)
  1300	{
  1301		loff_t offset = (loff_t)vma->vm_pgoff << PAGE_SHIFT;
  1302		unsigned long size = vma->vm_end - vma->vm_start;
> 1303		int state = READ_ONCE(xs->state);
  1304		struct xdp_sock *xs = xdp_sk(sock->sk);
  1305		struct xsk_queue *q = NULL;
  1306	
  1307		if (!(state == XSK_READY || state == XSK_BOUND))
  1308			return -EBUSY;
  1309	
  1310		if (offset == XDP_PGOFF_RX_RING) {
  1311			q = READ_ONCE(xs->rx);
  1312		} else if (offset == XDP_PGOFF_TX_RING) {
  1313			q = READ_ONCE(xs->tx);
  1314		} else {
  1315			/* Matches the smp_wmb() in XDP_UMEM_REG */
  1316			smp_rmb();
  1317			if (offset == XDP_UMEM_PGOFF_FILL_RING)
> 1318				q = READ_ONCE(state == XSK_READY ? xs->fq_tmp :
  1319								   xs->pool->fq);
  1320			else if (offset == XDP_UMEM_PGOFF_COMPLETION_RING)
  1321				q = READ_ONCE(state == XSK_READY ? xs->cq_tmp :
  1322								   xs->pool->cq);
  1323		}
  1324	
  1325		if (!q)
  1326			return -EINVAL;
  1327	
  1328		/* Matches the smp_wmb() in xsk_init_queue */
  1329		smp_rmb();
  1330		if (size > q->ring_vmalloc_size)
  1331			return -EINVAL;
  1332	
  1333		return remap_vmalloc_range(vma, q->ring, 0);
  1334	}
  1335	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

      parent reply	other threads:[~2023-03-20 20:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 10:53 [PATCH bpf-next] xsk: allow remap of fill and/or completion rings Nuno Gonçalves
2023-03-20 11:03 ` Leon Romanovsky
2023-03-20 12:27   ` Magnus Karlsson
2023-03-20 13:40     ` Leon Romanovsky
2023-03-20 13:45       ` Magnus Karlsson
2023-03-20 15:04         ` Magnus Karlsson
2023-03-20 20:24 ` kernel test robot
2023-03-20 20:34 ` kernel test robot [this message]

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=202303210446.mO2yxOwo-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nunog@fr24.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.