From: kernel test robot <lkp@intel.com>
To: David Wei <davidhwei@meta.com>
Cc: oe-kbuild-all@lists.linux.dev, Pavel Begunkov <asml.silence@gmail.com>
Subject: [isilence:zc/veth2 14/16] io_uring/zc_rx.c:644:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}'
Date: Fri, 20 Oct 2023 12:18:59 +0800 [thread overview]
Message-ID: <202310201228.dMoBeQiV-lkp@intel.com> (raw)
tree: https://github.com/isilence/linux zc/veth2
head: 731b7375c43d08e971bcafcd9e90c1c0c8250678
commit: 1e65d03befc872b1f243c468fd33761c1a5d253f [14/16] make it work
config: um-i386_defconfig (https://download.01.org/0day-ci/archive/20231020/202310201228.dMoBeQiV-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231020/202310201228.dMoBeQiV-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310201228.dMoBeQiV-lkp@intel.com/
All warnings (new ones prefixed by >>):
io_uring/zc_rx.c: In function 'is_zc_rx_page':
io_uring/zc_rx.c:62:51: warning: right shift count >= width of type [-Wshift-count-overflow]
return PagePrivate(page) && ((page_private(page) >> 48) == 0xface);
^~
io_uring/zc_rx.c: At top level:
io_uring/zc_rx.c:186:5: warning: no previous declaration for 'io_zc_rx_create_pool' [-Wmissing-declarations]
int io_zc_rx_create_pool(struct io_ring_ctx *ctx,
^~~~~~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:30:0,
from io_uring/zc_rx.c:2:
io_uring/zc_rx.c: In function 'zc_rx_recv_skb':
>> io_uring/zc_rx.c:644:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
printk("----- zc_rx_recv_skb: start=%d, offset=%d, len=%lu, nr_frags=%d\n", start, offset, len, skb_shinfo(skb)->nr_frags);
^
include/linux/printk.h:427:11: note: in definition of macro 'printk_index_wrap'
_p_func(_fmt, ##__VA_ARGS__); \
^~~~
io_uring/zc_rx.c:644:2: note: in expansion of macro 'printk'
printk("----- zc_rx_recv_skb: start=%d, offset=%d, len=%lu, nr_frags=%d\n", start, offset, len, skb_shinfo(skb)->nr_frags);
^~~~~~
vim +644 io_uring/zc_rx.c
623
624 static int
625 zc_rx_recv_skb(read_descriptor_t *desc, struct sk_buff *skb,
626 unsigned int offset, size_t len)
627 {
628 struct io_zc_rx_ifq *ifq;
629 struct sk_buff *frag_iter;
630 unsigned start, start_off;
631 int i, copy, end, off;
632 int ret = 0;
633
634 ifq = io_zc_rx_ifq_skb(skb);
635 if (!ifq) {
636 pr_debug("non zerocopy pages are not supported\n");
637 return -EFAULT;
638 }
639 start = skb_headlen(skb);
640 start_off = offset;
641
642 // TODO: copy payload in skb linear data */
643 WARN_ON(offset < start);
> 644 printk("----- zc_rx_recv_skb: start=%d, offset=%d, len=%lu, nr_frags=%d\n", start, offset, len, skb_shinfo(skb)->nr_frags);
645
646 // TODO: make sure theres at least nr_frags entries in cq ring
647 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
648 const skb_frag_t *frag;
649
650 WARN_ON(start > offset + len);
651
652 frag = &skb_shinfo(skb)->frags[i];
653 end = start + skb_frag_size(frag);
654 printk("----- zc_rx_recv_skb: skb frag size=%d, end=%d\n", skb_frag_size(frag), end);
655
656 if (offset < end) {
657 copy = end - offset;
658 if (copy > len)
659 copy = len;
660
661 off = offset - start;
662 ret = zc_rx_recv_frag(ifq, frag, off, copy);
663 if (ret < 0) {
664 printk("----- zc_rx_recv_skb: recv_frag err=%d\n", ret);
665 goto out;
666 }
667
668 offset += ret;
669 len -= ret;
670 if (len == 0 || ret != copy)
671 goto out;
672 }
673 start = end;
674 }
675
676 skb_walk_frags(skb, frag_iter) {
677 WARN_ON(start > offset + len);
678
679 end = start + frag_iter->len;
680 if (offset < end) {
681 copy = end - offset;
682 if (copy > len)
683 copy = len;
684
685 off = offset - start;
686 ret = zc_rx_recv_skb(desc, frag_iter, off, copy);
687 if (ret < 0)
688 goto out;
689
690 offset += ret;
691 len -= ret;
692 if (len == 0 || ret != copy)
693 goto out;
694 }
695 start = end;
696 }
697
698 out:
699 printk("----- zc_rx_recv_skb: updating tail, tail=%u, cached_tail=%u\n", ifq->ring->cq.tail, ifq->cached_cq_tail);
700 smp_store_release(&ifq->ring->cq.tail, ifq->cached_cq_tail);
701 if (offset == start_off)
702 return ret;
703 printk("----- zc_rx_recv_skb: out, offset=%d, start_off=%d\n", offset, start_off);
704 return offset - start_off;
705 }
706
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-10-20 4:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202310201228.dMoBeQiV-lkp@intel.com \
--to=lkp@intel.com \
--cc=asml.silence@gmail.com \
--cc=davidhwei@meta.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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.