From: kbuild test robot <lkp@intel.com>
To: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Cc: kbuild-all@01.org, bjorn.topel@intel.com,
magnus.karlsson@intel.com, davem@davemloft.net, ast@kernel.org,
daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
netdev@vger.kernel.org, bpf@vger.kernel.org,
xdp-newbies@vger.kernel.org, linux-kernel@vger.kernel.org,
Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Subject: Re: [PATCH net-next] xdp: xdp_umem: fix umem pages mapping for 32bits systems
Date: Thu, 27 Jun 2019 15:04:34 +0800 [thread overview]
Message-ID: <201906271554.KhVqx6OU%lkp@intel.com> (raw)
In-Reply-To: <20190626155911.13574-1-ivan.khoronzhuk@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 4008 bytes --]
Hi Ivan,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Ivan-Khoronzhuk/xdp-xdp_umem-fix-umem-pages-mapping-for-32bits-systems/20190627-135949
config: i386-randconfig-x073-201925 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-9) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
net//xdp/xdp_umem.c: In function 'xdp_umem_unmap_pages':
net//xdp/xdp_umem.c:177:3: error: implicit declaration of function 'kunmap'; did you mean 'vunmap'? [-Werror=implicit-function-declaration]
kunmap(umem->pgs[i]);
^~~~~~
vunmap
net//xdp/xdp_umem.c: In function 'xdp_umem_reg':
>> net//xdp/xdp_umem.c:384:25: error: implicit declaration of function 'kmap'; did you mean 'vmap'? [-Werror=implicit-function-declaration]
umem->pages[i].addr = kmap(umem->pgs[i]);
^~~~
vmap
net//xdp/xdp_umem.c:384:23: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
umem->pages[i].addr = kmap(umem->pgs[i]);
^
cc1: some warnings being treated as errors
vim +384 net//xdp/xdp_umem.c
311
312 static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
313 {
314 u32 chunk_size = mr->chunk_size, headroom = mr->headroom;
315 unsigned int chunks, chunks_per_page;
316 u64 addr = mr->addr, size = mr->len;
317 int size_chk, err, i;
318
319 if (chunk_size < XDP_UMEM_MIN_CHUNK_SIZE || chunk_size > PAGE_SIZE) {
320 /* Strictly speaking we could support this, if:
321 * - huge pages, or*
322 * - using an IOMMU, or
323 * - making sure the memory area is consecutive
324 * but for now, we simply say "computer says no".
325 */
326 return -EINVAL;
327 }
328
329 if (!is_power_of_2(chunk_size))
330 return -EINVAL;
331
332 if (!PAGE_ALIGNED(addr)) {
333 /* Memory area has to be page size aligned. For
334 * simplicity, this might change.
335 */
336 return -EINVAL;
337 }
338
339 if ((addr + size) < addr)
340 return -EINVAL;
341
342 chunks = (unsigned int)div_u64(size, chunk_size);
343 if (chunks == 0)
344 return -EINVAL;
345
346 chunks_per_page = PAGE_SIZE / chunk_size;
347 if (chunks < chunks_per_page || chunks % chunks_per_page)
348 return -EINVAL;
349
350 headroom = ALIGN(headroom, 64);
351
352 size_chk = chunk_size - headroom - XDP_PACKET_HEADROOM;
353 if (size_chk < 0)
354 return -EINVAL;
355
356 umem->address = (unsigned long)addr;
357 umem->chunk_mask = ~((u64)chunk_size - 1);
358 umem->size = size;
359 umem->headroom = headroom;
360 umem->chunk_size_nohr = chunk_size - headroom;
361 umem->npgs = size / PAGE_SIZE;
362 umem->pgs = NULL;
363 umem->user = NULL;
364 INIT_LIST_HEAD(&umem->xsk_list);
365 spin_lock_init(&umem->xsk_list_lock);
366
367 refcount_set(&umem->users, 1);
368
369 err = xdp_umem_account_pages(umem);
370 if (err)
371 return err;
372
373 err = xdp_umem_pin_pages(umem);
374 if (err)
375 goto out_account;
376
377 umem->pages = kcalloc(umem->npgs, sizeof(*umem->pages), GFP_KERNEL);
378 if (!umem->pages) {
379 err = -ENOMEM;
380 goto out_account;
381 }
382
383 for (i = 0; i < umem->npgs; i++)
> 384 umem->pages[i].addr = kmap(umem->pgs[i]);
385
386 return 0;
387
388 out_account:
389 xdp_umem_unaccount_pages(umem);
390 return err;
391 }
392
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32965 bytes --]
next prev parent reply other threads:[~2019-06-27 7:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 15:59 [PATCH net-next] xdp: xdp_umem: fix umem pages mapping for 32bits systems Ivan Khoronzhuk
2019-06-26 20:50 ` Björn Töpel
2019-06-29 17:53 ` David Miller
2019-07-01 13:10 ` Björn Töpel
2019-06-27 7:04 ` kbuild test robot [this message]
2019-06-27 9:01 ` kbuild test robot
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=201906271554.KhVqx6OU%lkp@intel.com \
--to=lkp@intel.com \
--cc=ast@kernel.org \
--cc=bjorn.topel@intel.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=hawk@kernel.org \
--cc=ivan.khoronzhuk@linaro.org \
--cc=john.fastabend@gmail.com \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=xdp-newbies@vger.kernel.org \
/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).