diff options
Diffstat (limited to 'drivers/net/virtio_net.c')
| -rw-r--r-- | drivers/net/virtio_net.c | 14 | 
1 files changed, 12 insertions, 2 deletions
| diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 0383a3e136d6..3f10c72743e9 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -3658,6 +3658,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) @@ -3675,6 +3678,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) @@ -3743,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;  		} @@ -3758,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;  		}  	} | 
