Hi Andrew,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on net-next/master net/master linus/master sparc-next/master
v5.14-rc6 next-20210818]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Andrew-Melnychenko/drivers-net-v...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: i386-randconfig-s001-20210818 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-348-gf0e6938b-dirty
#
https://github.com/0day-ci/linux/commit/2205ca0b751f734cf3ea53258d9b8e3f3...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Andrew-Melnychenko/drivers-net-virtio_net-Added-RSS-support/20210819-015744
git checkout 2205ca0b751f734cf3ea53258d9b8e3f3849fe16
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir
ARCH=i386 SHELL=/bin/bash drivers/net/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> drivers/net/virtio_net.c:1185:33: sparse: sparse: restricted
__le16 degrades to integer
> drivers/net/virtio_net.c:1185:33: sparse: sparse: restricted __le16 degrades to
integer
> drivers/net/virtio_net.c:1185:33: sparse: sparse: restricted __le16 degrades to
integer
> drivers/net/virtio_net.c:1185:33: sparse: sparse: restricted __le16 degrades to
integer
> drivers/net/virtio_net.c:1185:33: sparse: sparse: restricted __le16 degrades to
integer
> drivers/net/virtio_net.c:1185:33: sparse: sparse: restricted __le16 degrades to
integer
> drivers/net/virtio_net.c:1185:33: sparse: sparse: restricted __le16 degrades to
integer
> drivers/net/virtio_net.c:1185:33: sparse: sparse: restricted __le16 degrades to
integer
> drivers/net/virtio_net.c:1185:33: sparse: sparse: restricted __le16 degrades to
integer
> drivers/net/virtio_net.c:1203:43: sparse: sparse: incorrect type in argument 2
(different base types) @@ expected unsigned int [usertype] hash @@ got restricted
__le32 [usertype] hash_value @@
drivers/net/virtio_net.c:1203:43: sparse:
expected unsigned int [usertype] hash
drivers/net/virtio_net.c:1203:43: sparse: got restricted __le32 [usertype]
hash_value
> drivers/net/virtio_net.c:2262:45: sparse: sparse: incorrect type
in assignment (different base types) @@ expected restricted __le32 [usertype]
hash_types @@ got unsigned int [usertype] rss_hash_types_supported @@
drivers/net/virtio_net.c:2262:45: sparse: expected restricted __le32 [usertype]
hash_types
drivers/net/virtio_net.c:2262:45: sparse: got unsigned int [usertype]
rss_hash_types_supported
> drivers/net/virtio_net.c:2264:57: sparse: sparse: incorrect type
in assignment (different base types) @@ expected restricted __le16 [usertype]
indirection_table_mask @@ got int @@
drivers/net/virtio_net.c:2264:57:
sparse: expected restricted __le16 [usertype] indirection_table_mask
drivers/net/virtio_net.c:2264:57: sparse: got int
> drivers/net/virtio_net.c:2278:6: sparse: sparse: symbol
'virtnet_get_hashflow' was not declared. Should it be static?
> drivers/net/virtio_net.c:2396:53: sparse: sparse: incorrect type in assignment
(different base types) @@ expected restricted __le32 [usertype] hash_types @@ got
unsigned int [usertype] rss_hash_types_saved @@
drivers/net/virtio_net.c:2396:53:
sparse: expected restricted __le32 [usertype] hash_types
drivers/net/virtio_net.c:2396:53: sparse: got unsigned int [usertype]
rss_hash_types_saved
> drivers/net/virtio_net.c:2330:6: sparse: sparse: symbol
'virtnet_set_hashflow' was not declared. Should it be static?
> drivers/net/virtio_net.c:2627:5: sparse: sparse: symbol
'virtnet_get_rxfh_key_size' was not declared. Should it be static?
> drivers/net/virtio_net.c:2632:5: sparse: sparse: symbol
'virtnet_get_rxfh_indir_size' was not declared. Should it be static?
> drivers/net/virtio_net.c:2637:5: sparse: sparse: symbol 'virtnet_get_rxfh'
was not declared. Should it be static?
> drivers/net/virtio_net.c:2656:5: sparse: sparse: symbol 'virtnet_set_rxfh'
was not declared. Should it be static?
> drivers/net/virtio_net.c:2676:5: sparse: sparse: symbol 'virtnet_get_rxnfc'
was not declared. Should it be static?
drivers/net/virtio_net.c:2988:61: sparse:
sparse: incorrect type in assignment (different base types) @@ expected restricted
__le32 [usertype] hash_types @@ got unsigned int [usertype] rss_hash_types_saved @@
drivers/net/virtio_net.c:2988:61: sparse: expected restricted __le32 [usertype]
hash_types
drivers/net/virtio_net.c:2988:61: sparse: got unsigned int [usertype]
rss_hash_types_saved
Please review and possibly fold the followup patch.
vim +1185 drivers/net/virtio_net.c
1145
1146 static void receive_buf(struct virtnet_info *vi, struct receive_queue *rq,
1147 void *buf, unsigned int len, void **ctx,
1148 unsigned int *xdp_xmit,
1149 struct virtnet_rq_stats *stats)
1150 {
1151 struct net_device *dev = vi->dev;
1152 struct sk_buff *skb;
1153 struct virtio_net_hdr_mrg_rxbuf *hdr;
1154 struct virtio_net_hdr_v1_hash *hdr_hash;
1155 enum pkt_hash_types rss_hash_type;
1156
1157 if (unlikely(len < vi->hdr_len + ETH_HLEN)) {
1158 pr_debug("%s: short packet %i\n", dev->name, len);
1159 dev->stats.rx_length_errors++;
1160 if (vi->mergeable_rx_bufs) {
1161 put_page(virt_to_head_page(buf));
1162 } else if (vi->big_packets) {
1163 give_pages(rq, buf);
1164 } else {
1165 put_page(virt_to_head_page(buf));
1166 }
1167 return;
1168 }
1169
1170 if (vi->mergeable_rx_bufs)
1171 skb = receive_mergeable(dev, vi, rq, buf, ctx, len, xdp_xmit,
1172 stats);
1173 else if (vi->big_packets)
1174 skb = receive_big(dev, vi, rq, buf, len, stats);
1175 else
1176 skb = receive_small(dev, vi, rq, buf, ctx, len, xdp_xmit, stats);
1177
1178 if (unlikely(!skb))
1179 return;
1180
1181 hdr = skb_vnet_hdr(skb);
1182 if (vi->has_rss_hash_report && (dev->features & NETIF_F_RXHASH))
{
1183 hdr_hash = (struct virtio_net_hdr_v1_hash *)(hdr);
1184
1185 switch (hdr_hash->hash_report) {
1186 case
VIRTIO_NET_HASH_REPORT_TCPv4:
1187 case VIRTIO_NET_HASH_REPORT_UDPv4:
1188 case VIRTIO_NET_HASH_REPORT_TCPv6:
1189 case VIRTIO_NET_HASH_REPORT_UDPv6:
1190 case VIRTIO_NET_HASH_REPORT_TCPv6_EX:
1191 case VIRTIO_NET_HASH_REPORT_UDPv6_EX:
1192 rss_hash_type = PKT_HASH_TYPE_L4;
1193 break;
1194 case VIRTIO_NET_HASH_REPORT_IPv4:
1195 case VIRTIO_NET_HASH_REPORT_IPv6:
1196 case VIRTIO_NET_HASH_REPORT_IPv6_EX:
1197 rss_hash_type = PKT_HASH_TYPE_L3;
1198 break;
1199 case VIRTIO_NET_HASH_REPORT_NONE:
1200 default:
1201 rss_hash_type = PKT_HASH_TYPE_NONE;
1202 }
1203 skb_set_hash(skb, hdr_hash->hash_value, rss_hash_type);
1204 }
1205
1206 if (hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID)
1207 skb->ip_summed = CHECKSUM_UNNECESSARY;
1208
1209 if (virtio_net_hdr_to_skb(skb, &hdr->hdr,
1210 virtio_is_little_endian(vi->vdev))) {
1211 net_warn_ratelimited("%s: bad gso: type: %u, size: %u\n",
1212 dev->name, hdr->hdr.gso_type,
1213 hdr->hdr.gso_size);
1214 goto frame_err;
1215 }
1216
1217 skb_record_rx_queue(skb, vq2rxq(rq->vq));
1218 skb->protocol = eth_type_trans(skb, dev);
1219 pr_debug("Receiving skb proto 0x%04x len %i type %i\n",
1220 ntohs(skb->protocol), skb->len, skb->pkt_type);
1221
1222 napi_gro_receive(&rq->napi, skb);
1223 return;
1224
1225 frame_err:
1226 dev->stats.rx_frame_errors++;
1227 dev_kfree_skb(skb);
1228 }
1229
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org