Subject: Re: [PATCH] net: virtio_net: notifications coalescing support

From: Jakub Kicinski <[email-masked]>
Date: Mon, 11 Jul 2022 20:36:59 -0700

On Mon, 11 Jul 2022 14:28:32 +0300 Alvaro Karsz wrote:
> New VirtIO network feature: VIRTIO_NET_F_NOTF_COAL.
> 
> Control a Virtio network device notifications coalescing parameters
> using the control virtqueue.
> 
> A device that supports this fetature can receive
> VIRTIO_NET_CTRL_NOTF_COAL control commands.
> 
> - VIRTIO_NET_CTRL_NOTF_COAL_TX_SET:
>   Ask the network device to change the following parameters:
>   - tx_usecs: Maximum number of usecs to delay a TX notification.
>   - tx_max_packets: Maximum number of packets to send before a
>     TX notification.
> 
> - VIRTIO_NET_CTRL_NOTF_COAL_RX_SET:
>   Ask the network device to change the following parameters:
>   - rx_usecs: Maximum number of usecs to delay a RX notification.
>   - rx_max_packets: Maximum number of packets to receive before a
>     RX notification.
> 
> VirtIO spec. patch:
> https://lists.oasis-open.org/archives/virtio-comment/202206/msg00100.html
> 
> Signed-off-by: Alvaro Karsz <[email-masked]>

Try building with sparse -
https://www.kernel.org/doc/html/latest/dev-tools/sparse.html

+../drivers/net/virtio_net.c:2616:34: warning: incorrect type in assignment (different base types)
+../drivers/net/virtio_net.c:2616:34:    expected restricted __virtio32 [usertype] tx_usecs
+../drivers/net/virtio_net.c:2616:34:    got unsigned int [usertype] tx_coalesce_usecs
+../drivers/net/virtio_net.c:2617:40: warning: incorrect type in assignment (different base types)
+../drivers/net/virtio_net.c:2617:40:    expected restricted __virtio32 [usertype] tx_max_packets
+../drivers/net/virtio_net.c:2617:40:    got unsigned int [usertype] tx_max_coalesced_frames
+../drivers/net/virtio_net.c:2629:34: warning: incorrect type in assignment (different base types)
+../drivers/net/virtio_net.c:2629:34:    expected restricted __virtio32 [usertype] rx_usecs
+../drivers/net/virtio_net.c:2629:34:    got unsigned int [usertype] rx_coalesce_usecs
+../drivers/net/virtio_net.c:2630:40: warning: incorrect type in assignment (different base types)
+../drivers/net/virtio_net.c:2630:40:    expected restricted __virtio32 [usertype] rx_max_packets
+../drivers/net/virtio_net.c:2630:40:    got unsigned int [usertype] rx_max_coalesced_frames