Patch "virtio-net: check feature before configuring the vq coalescing command" has been added to the 6.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    virtio-net: check feature before configuring the vq coalescing command

to the 6.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     virtio-net-check-feature-before-configuring-the-vq-c.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fcebf3a10291e21b75c3cd539acb699d9c97e41c
Author: Heng Qi <hengqi@xxxxxxxxxxxxxxxxx>
Date:   Thu Aug 1 21:23:37 2024 +0800

    virtio-net: check feature before configuring the vq coalescing command
    
    [ Upstream commit b50f2af9fbc5c00103ca8b72752b15310bd77762 ]
    
    Virtio spec says:
    
            The driver MUST have negotiated the VIRTIO_NET_F_VQ_NOTF_COAL
            feature when issuing commands VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET
            and VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET.
    
    So we add the feature negotiation check to
    virtnet_send_{r,t}x_ctrl_coal_vq_cmd as a basis for the next bugfix patch.
    
    Suggested-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
    Signed-off-by: Heng Qi <hengqi@xxxxxxxxxxxxxxxxx>
    Acked-by: Jason Wang <jasowang@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index f32e017b62e9b..21bd0c127b05a 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -3172,6 +3172,9 @@ static int virtnet_send_rx_ctrl_coal_vq_cmd(struct virtnet_info *vi,
 {
 	int err;
 
+	if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_VQ_NOTF_COAL))
+		return -EOPNOTSUPP;
+
 	err = virtnet_send_ctrl_coal_vq_cmd(vi, rxq2vq(queue),
 					    max_usecs, max_packets);
 	if (err)
@@ -3189,6 +3192,9 @@ static int virtnet_send_tx_ctrl_coal_vq_cmd(struct virtnet_info *vi,
 {
 	int err;
 
+	if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_VQ_NOTF_COAL))
+		return -EOPNOTSUPP;
+
 	err = virtnet_send_ctrl_coal_vq_cmd(vi, txq2vq(queue),
 					    max_usecs, max_packets);
 	if (err)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux