Commit 4ba8d970 authored by Heng Qi's avatar Heng Qi Committed by David S. Miller
Browse files

virtio-net: unbreak vq resizing when coalescing is not negotiated



Don't break the resize action if the vq coalescing feature
named VIRTIO_NET_F_VQ_NOTF_COAL is not negotiated.

Fixes: f61fe5f0 ("virtio-net: fix the vq coalescing setting for vq resize")
Signed-off-by: default avatarHeng Qi <hengqi@linux.alibaba.com>
Reviewed-by: default avatarXuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: default avatarEugenio Pé rez <eperezma@redhat.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b50f2af9
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -3749,7 +3749,11 @@ static int virtnet_set_ringparam(struct net_device *dev,
			err = virtnet_send_tx_ctrl_coal_vq_cmd(vi, i,
							       vi->intr_coal_tx.max_usecs,
							       vi->intr_coal_tx.max_packets);
			if (err)

			/* Don't break the tx resize action if the vq coalescing is not
			 * supported. The same is true for rx resize below.
			 */
			if (err && err != -EOPNOTSUPP)
				return err;
		}

@@ -3764,7 +3768,7 @@ static int virtnet_set_ringparam(struct net_device *dev,
							       vi->intr_coal_rx.max_usecs,
							       vi->intr_coal_rx.max_packets);
			mutex_unlock(&vi->rq[i].dim_lock);
			if (err)
			if (err && err != -EOPNOTSUPP)
				return err;
		}
	}