From: kernel test robot <lkp@intel.com>
To: Heng Qi <hengqi@linux.alibaba.com>,
netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
"Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>
Subject: Re: [PATCH net-next 1/4] virtio-net: a helper for probing the pseudo-header checksum
Date: Mon, 19 Jun 2023 20:30:45 +0800 [thread overview]
Message-ID: <202306192049.8y7DR5F1-lkp@intel.com> (raw)
In-Reply-To: <20230619105738.117733-2-hengqi@linux.alibaba.com>
Hi Heng,
kernel test robot noticed the following build errors:
[auto build test ERROR 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-2-hengqi%40linux.alibaba.com
patch subject: [PATCH net-next 1/4] virtio-net: a helper for probing the pseudo-header checksum
config: x86_64-randconfig-r014-20230619 (https://download.01.org/0day-ci/archive/20230619/202306192049.8y7DR5F1-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/202306192049.8y7DR5F1-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/202306192049.8y7DR5F1-lkp@intel.com/
All errors (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,
^
2 errors generated.
vim +/csum_ipv6_magic +1648 drivers/net/virtio_net.c
1572
1573 static int virtnet_flow_dissect_udp_tcp(struct virtnet_info *vi, struct sk_buff *skb)
1574 {
1575 struct net_device *dev = vi->dev;
1576 struct flow_keys_basic keys;
1577 struct udphdr *uh;
1578 struct tcphdr *th;
1579 int len, offset;
1580
1581 /* The flow dissector needs this information. */
1582 skb->dev = dev;
1583 skb_reset_mac_header(skb);
1584 skb->protocol = dev_parse_header_protocol(skb);
1585 /* virtio-net does not need to resolve VLAN. */
1586 skb_set_network_header(skb, ETH_HLEN);
1587 if (!skb_flow_dissect_flow_keys_basic(NULL, skb, &keys,
1588 NULL, 0, 0, 0, 0))
1589 return -EINVAL;
1590
1591 /* 1. Pseudo-header checksum calculation requires:
1592 * (1) saddr/daddr (2) IP_PROTO (3) length of transport payload
1593 * 2. We don't parse SCTP because virtio-net currently doesn't
1594 * support CRC offloading for SCTP.
1595 */
1596 if (keys.basic.n_proto == htons(ETH_P_IP)) {
1597 struct iphdr *iph;
1598
1599 /* Flow dissector has verified that there is an IP header. */
1600 iph = ip_hdr(skb);
1601 if (iph->version != 4 || !pskb_may_pull(skb, iph->ihl * 4))
1602 return -EINVAL;
1603
1604 skb->transport_header = skb->mac_header + keys.control.thoff;
1605 offset = skb_transport_offset(skb);
1606 len = skb->len - offset;
1607 if (keys.basic.ip_proto == IPPROTO_UDP) {
1608 if (!pskb_may_pull(skb, offset + sizeof(struct udphdr)))
1609 return -EINVAL;
1610
1611 uh = udp_hdr(skb);
1612 skb->csum_offset = offsetof(struct udphdr, check);
1613 /* Although uh->len is already the 3rd parameter for the calculation
1614 * of the pseudo-header checksum, we have already calculated the
1615 * length of the transport layer, so use 'len' here directly.
1616 */
1617 uh->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, len,
1618 IPPROTO_UDP, 0);
1619 } else if (keys.basic.ip_proto == IPPROTO_TCP) {
1620 if (!pskb_may_pull(skb, offset + sizeof(struct tcphdr)))
1621 return -EINVAL;
1622
1623 th = tcp_hdr(skb);
1624 skb->csum_offset = offsetof(struct tcphdr, check);
1625 th->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, len,
1626 IPPROTO_TCP, 0);
1627 } /* virtio-net doesn't support checksums for SCTP hw offloading.*/
1628 } else if (keys.basic.n_proto == htons(ETH_P_IPV6)) {
1629 struct ipv6hdr *ip6h;
1630
1631 ip6h = ipv6_hdr(skb);
1632 if (ip6h->version != 6)
1633 return -EINVAL;
1634
1635 /* We have skipped the possible extension headers for IPv6.
1636 * If there is a Routing Header, the tx's check value is calculated by
1637 * final_dst, and that value is the rx's daddr.
1638 */
1639 skb->transport_header = skb->mac_header + keys.control.thoff;
1640 offset = skb_transport_offset(skb);
1641 len = skb->len - offset;
1642 if (keys.basic.ip_proto == IPPROTO_UDP) {
1643 if (!pskb_may_pull(skb, offset + sizeof(struct udphdr)))
1644 return -EINVAL;
1645
1646 uh = udp_hdr(skb);
1647 skb->csum_offset = offsetof(struct udphdr, check);
> 1648 uh->check = ~csum_ipv6_magic((const struct in6_addr *)&ip6h->saddr,
1649 (const struct in6_addr *)&ip6h->daddr,
1650 len, IPPROTO_UDP, 0);
1651 } else if (keys.basic.ip_proto == IPPROTO_TCP) {
1652 if (!pskb_may_pull(skb, offset + sizeof(struct tcphdr)))
1653 return -EINVAL;
1654
1655 th = tcp_hdr(skb);
1656 skb->csum_offset = offsetof(struct tcphdr, check);
1657 th->check = ~csum_ipv6_magic((const struct in6_addr *)&ip6h->saddr,
1658 (const struct in6_addr *)&ip6h->daddr,
1659 len, IPPROTO_TCP, 0);
1660 }
1661 }
1662
1663 skb->csum_start = skb->transport_header;
1664
1665 return 0;
1666 }
1667
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2023-06-19 12:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-19 10:57 [PATCH net-next 0/4] virtio-net: avoid XDP and _F_GUEST_CSUM Heng Qi
2023-06-19 10:57 ` [PATCH net-next 1/4] virtio-net: a helper for probing the pseudo-header checksum Heng Qi
2023-06-19 12:30 ` kernel test robot [this message]
2023-06-19 12:30 ` kernel test robot
2023-06-19 10:57 ` [PATCH net-next 2/4] virtio-net: reprobe csum related fields for skb passed by XDP Heng Qi
2023-06-19 11:27 ` Michael S. Tsirkin
2023-06-19 12:29 ` Heng Qi
2023-06-19 13:32 ` kernel test robot
2023-06-19 10:57 ` [PATCH net-next 3/4] virtio-net: support coexistence of XDP and _F_GUEST_CSUM Heng Qi
2023-06-19 11:26 ` Michael S. Tsirkin
2023-06-19 12:31 ` Heng Qi
2023-06-20 3:24 ` Heng Qi
2023-06-20 10:50 ` Michael S. Tsirkin
2023-06-20 11:01 ` Heng Qi
2023-06-20 12:10 ` Michael S. Tsirkin
2023-06-20 14:15 ` Heng Qi
2023-06-19 10:57 ` [PATCH net-next 4/4] virtio-net: remove F_GUEST_CSUM check for XDP loading Heng Qi
2023-06-19 11:16 ` Michael S. Tsirkin
2023-06-19 12:41 ` Heng Qi
2023-06-19 14:33 ` Michael S. Tsirkin
2023-06-19 15:43 ` Heng Qi
2023-06-19 18:36 ` Michael S. Tsirkin
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=202306192049.8y7DR5F1-lkp@intel.com \
--to=lkp@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=hengqi@linux.alibaba.com \
--cc=jasowang@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=xuanzhuo@linux.alibaba.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 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).