[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202306192151.YMz3NiKw-lkp@intel.com>
Date: Mon, 19 Jun 2023 21:32:46 +0800
From: kernel test robot <lkp@...el.com>
To: Heng Qi <hengqi@...ux.alibaba.com>, netdev@...r.kernel.org,
bpf@...r.kernel.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>
Subject: Re: [PATCH net-next 2/4] virtio-net: reprobe csum related fields for
skb passed by XDP
Hi Heng,
kernel test robot noticed the following build warnings:
[auto build test WARNING on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Heng-Qi/virtio-net-a-helper-for-probing-the-pseudo-header-checksum/20230619-190212
base: net-next/main
patch link: https://lore.kernel.org/r/20230619105738.117733-3-hengqi%40linux.alibaba.com
patch subject: [PATCH net-next 2/4] virtio-net: reprobe csum related fields for skb passed by XDP
config: x86_64-randconfig-r014-20230619 (https://download.01.org/0day-ci/archive/20230619/202306192151.YMz3NiKw-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce: (https://download.01.org/0day-ci/archive/20230619/202306192151.YMz3NiKw-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306192151.YMz3NiKw-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/net/virtio_net.c:1648:17: error: call to undeclared function 'csum_ipv6_magic'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
uh->check = ~csum_ipv6_magic((const struct in6_addr *)&ip6h->saddr,
^
drivers/net/virtio_net.c:1648:17: note: did you mean 'csum_tcpudp_magic'?
include/asm-generic/checksum.h:52:1: note: 'csum_tcpudp_magic' declared here
csum_tcpudp_magic(__be32 saddr, __be32 daddr, __u32 len,
^
drivers/net/virtio_net.c:1657:17: error: call to undeclared function 'csum_ipv6_magic'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
th->check = ~csum_ipv6_magic((const struct in6_addr *)&ip6h->saddr,
^
>> drivers/net/virtio_net.c:1695:19: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
} else if (flags && VIRTIO_NET_HDR_F_DATA_VALID) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/virtio_net.c:1695:19: note: use '&' for a bitwise operation
} else if (flags && VIRTIO_NET_HDR_F_DATA_VALID) {
^~
&
drivers/net/virtio_net.c:1695:19: note: remove constant to silence this warning
} else if (flags && VIRTIO_NET_HDR_F_DATA_VALID) {
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.
vim +1695 drivers/net/virtio_net.c
1667
1668 static int virtnet_set_csum_after_xdp(struct virtnet_info *vi,
1669 struct sk_buff *skb,
1670 __u8 flags)
1671 {
1672 int err;
1673
1674 /* When XDP program is loaded, for example, the vm-vm scenario
1675 * on the same host, packets marked as VIRTIO_NET_HDR_F_NEEDS_CSUM
1676 * will travel. Although these packets are safe from the point of
1677 * view of the vm, to avoid modification by XDP and successful
1678 * forwarding in the upper layer, we re-probe the necessary checksum
1679 * related information: skb->csum_{start, offset}, pseudo-header csum.
1680 *
1681 * This benefits us:
1682 * 1. XDP can be loaded when there's _F_GUEST_CSUM.
1683 * 2. The device verifies the checksum of packets , especially
1684 * benefiting for large packets.
1685 * 3. In the same-host vm-vm scenario, packets marked as
1686 * VIRTIO_NET_HDR_F_NEEDS_CSUM are no longer dropped after being
1687 * processed by XDP.
1688 */
1689 if (flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {
1690 err = virtnet_flow_dissect_udp_tcp(vi, skb);
1691 if (err < 0)
1692 return -EINVAL;
1693
1694 skb->ip_summed = CHECKSUM_PARTIAL;
> 1695 } else if (flags && VIRTIO_NET_HDR_F_DATA_VALID) {
1696 /* We want to benefit from this: XDP guarantees that packets marked
1697 * as VIRTIO_NET_HDR_F_DATA_VALID still have correct csum after they
1698 * are processed.
1699 */
1700 skb->ip_summed = CHECKSUM_UNNECESSARY;
1701 }
1702
1703 return 0;
1704 }
1705
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists