search for: vhost_net_set_features

Displaying 20 results from an estimated 94 matches for "vhost_net_set_features".

Did you mean: vhost_net_get_features
2016 Aug 02
1
[PATCH -next] vhost: fix missing unlock on error in vhost_net_set_features()
Add the missing unlock before return from function vhost_net_set_features() in the error handling case. Fixes: eefe82d9b81f ('vhost: new device IOTLB API') Signed-off-by: Wei Yongjun <weiyj.lk at gmail.com> --- drivers/vhost/net.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c in...
2016 Aug 02
1
[PATCH -next] vhost: fix missing unlock on error in vhost_net_set_features()
Add the missing unlock before return from function vhost_net_set_features() in the error handling case. Fixes: eefe82d9b81f ('vhost: new device IOTLB API') Signed-off-by: Wei Yongjun <weiyj.lk at gmail.com> --- drivers/vhost/net.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c in...
2009 Dec 20
0
[PATCH 2/3] vhost: add access_ok checks
...n->vqs + index; mutex_lock(&vq->mutex); + + /* Verify that ring has been setup correctly. */ + if (!vhost_vq_access_ok(vq)) { + r = -EFAULT; + goto err; + } sock = get_socket(fd); if (IS_ERR(sock)) { r = PTR_ERR(sock); @@ -539,12 +545,17 @@ done: return err; } -static void vhost_net_set_features(struct vhost_net *n, u64 features) +static int vhost_net_set_features(struct vhost_net *n, u64 features) { size_t hdr_size = features & (1 << VHOST_NET_F_VIRTIO_NET_HDR) ? sizeof(struct virtio_net_hdr) : 0; int i; mutex_lock(&n->dev.mutex); + if ((features & (1 <&l...
2009 Dec 20
0
[PATCH 2/3] vhost: add access_ok checks
...n->vqs + index; mutex_lock(&vq->mutex); + + /* Verify that ring has been setup correctly. */ + if (!vhost_vq_access_ok(vq)) { + r = -EFAULT; + goto err; + } sock = get_socket(fd); if (IS_ERR(sock)) { r = PTR_ERR(sock); @@ -539,12 +545,17 @@ done: return err; } -static void vhost_net_set_features(struct vhost_net *n, u64 features) +static int vhost_net_set_features(struct vhost_net *n, u64 features) { size_t hdr_size = features & (1 << VHOST_NET_F_VIRTIO_NET_HDR) ? sizeof(struct virtio_net_hdr) : 0; int i; mutex_lock(&n->dev.mutex); + if ((features & (1 <&l...
2018 Jun 08
3
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...DULE_PARM_DESC(experimental_zcopytx, "Enable Zero Copy TX;" enum { VHOST_NET_FEATURES = VHOST_FEATURES | - (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) | (1ULL << VIRTIO_NET_F_MRG_RXBUF) | (1ULL << VIRTIO_F_IOMMU_PLATFORM) }; @@ -1255,15 +1254,11 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features) (1ULL << VIRTIO_F_VERSION_1))) ? sizeof(struct virtio_net_hdr_mrg_rxbuf) : sizeof(struct virtio_net_hdr); - if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { - /* vhost provides vnet_hdr */ - vhost_hlen = hdr_len; - sock_hle...
2018 Jun 08
3
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...DULE_PARM_DESC(experimental_zcopytx, "Enable Zero Copy TX;" enum { VHOST_NET_FEATURES = VHOST_FEATURES | - (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) | (1ULL << VIRTIO_NET_F_MRG_RXBUF) | (1ULL << VIRTIO_F_IOMMU_PLATFORM) }; @@ -1255,15 +1254,11 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features) (1ULL << VIRTIO_F_VERSION_1))) ? sizeof(struct virtio_net_hdr_mrg_rxbuf) : sizeof(struct virtio_net_hdr); - if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { - /* vhost provides vnet_hdr */ - vhost_hlen = hdr_len; - sock_hle...
2014 Nov 27
1
[PATCH v6 33/46] vhost/net: larger header for virtio 1.0
...y: Michael S. Tsirkin <mst at redhat.com> --- drivers/vhost/net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index cae22f9..1ac58d0 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -1027,7 +1027,8 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features) size_t vhost_hlen, sock_hlen, hdr_len; int i; - hdr_len = (features & (1 << VIRTIO_NET_F_MRG_RXBUF)) ? + hdr_len = (features & ((1ULL << VIRTIO_NET_F_MRG_RXBUF) | + (1ULL << VIRTIO_F_VERSION_1))) ? sizeof(struct virtio_...
2014 Nov 27
1
[PATCH v6 33/46] vhost/net: larger header for virtio 1.0
...y: Michael S. Tsirkin <mst at redhat.com> --- drivers/vhost/net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index cae22f9..1ac58d0 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -1027,7 +1027,8 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features) size_t vhost_hlen, sock_hlen, hdr_len; int i; - hdr_len = (features & (1 << VIRTIO_NET_F_MRG_RXBUF)) ? + hdr_len = (features & ((1ULL << VIRTIO_NET_F_MRG_RXBUF) | + (1ULL << VIRTIO_F_VERSION_1))) ? sizeof(struct virtio_...
2018 Jun 08
2
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...>> enum { >> VHOST_NET_FEATURES = VHOST_FEATURES | >> - (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) | >> (1ULL << VIRTIO_NET_F_MRG_RXBUF) | >> (1ULL << VIRTIO_F_IOMMU_PLATFORM) >> }; >> @@ -1255,15 +1254,11 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features) >> (1ULL << VIRTIO_F_VERSION_1))) ? >> sizeof(struct virtio_net_hdr_mrg_rxbuf) : >> sizeof(struct virtio_net_hdr); >> - if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { >> - /* vhost provides...
2018 Jun 08
2
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...>> enum { >> VHOST_NET_FEATURES = VHOST_FEATURES | >> - (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) | >> (1ULL << VIRTIO_NET_F_MRG_RXBUF) | >> (1ULL << VIRTIO_F_IOMMU_PLATFORM) >> }; >> @@ -1255,15 +1254,11 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features) >> (1ULL << VIRTIO_F_VERSION_1))) ? >> sizeof(struct virtio_net_hdr_mrg_rxbuf) : >> sizeof(struct virtio_net_hdr); >> - if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { >> - /* vhost provides...
2018 Aug 03
4
[PATCH net-next] vhost: switch to use new message format
...+ + mutex_lock(&n->dev.mutex); + for (i = 0; i < VHOST_NET_VQ_MAX; ++i) { + mutex_lock(&n->vqs[i].vq.mutex); + n->vqs[i].vq.acked_backend_features = features; + mutex_unlock(&n->vqs[i].vq.mutex); + } + mutex_unlock(&n->dev.mutex); + + return 0; +} + static int vhost_net_set_features(struct vhost_net *n, u64 features) { size_t vhost_hlen, sock_hlen, hdr_len; @@ -1489,6 +1508,17 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl, if (features & ~VHOST_NET_FEATURES) return -EOPNOTSUPP; return vhost_net_set_features(n, features); + case VHOST_GET_BA...
2018 Aug 03
4
[PATCH net-next] vhost: switch to use new message format
...+ + mutex_lock(&n->dev.mutex); + for (i = 0; i < VHOST_NET_VQ_MAX; ++i) { + mutex_lock(&n->vqs[i].vq.mutex); + n->vqs[i].vq.acked_backend_features = features; + mutex_unlock(&n->vqs[i].vq.mutex); + } + mutex_unlock(&n->dev.mutex); + + return 0; +} + static int vhost_net_set_features(struct vhost_net *n, u64 features) { size_t vhost_hlen, sock_hlen, hdr_len; @@ -1489,6 +1508,17 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl, if (features & ~VHOST_NET_FEATURES) return -EOPNOTSUPP; return vhost_net_set_features(n, features); + case VHOST_GET_BA...
2018 Jun 11
1
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
..._FEATURES = VHOST_FEATURES | >>>> - (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) | >>>> (1ULL << VIRTIO_NET_F_MRG_RXBUF) | >>>> (1ULL << VIRTIO_F_IOMMU_PLATFORM) >>>> }; >>>> @@ -1255,15 +1254,11 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features) >>>> (1ULL << VIRTIO_F_VERSION_1))) ? >>>> sizeof(struct virtio_net_hdr_mrg_rxbuf) : >>>> sizeof(struct virtio_net_hdr); >>>> - if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR...
2018 Aug 03
0
[PATCH net-next] vhost: switch to use new message format
...0; i < VHOST_NET_VQ_MAX; ++i) { > + mutex_lock(&n->vqs[i].vq.mutex); > + n->vqs[i].vq.acked_backend_features = features; > + mutex_unlock(&n->vqs[i].vq.mutex); > + } > + mutex_unlock(&n->dev.mutex); > + > + return 0; > +} > + > static int vhost_net_set_features(struct vhost_net *n, u64 features) > { > size_t vhost_hlen, sock_hlen, hdr_len; > @@ -1489,6 +1508,17 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl, > if (features & ~VHOST_NET_FEATURES) > return -EOPNOTSUPP; > return vhost_net_set_features(n,...
2018 Aug 06
1
[PATCH net-next V2] vhost: switch to use new message format
...+ + mutex_lock(&n->dev.mutex); + for (i = 0; i < VHOST_NET_VQ_MAX; ++i) { + mutex_lock(&n->vqs[i].vq.mutex); + n->vqs[i].vq.acked_backend_features = features; + mutex_unlock(&n->vqs[i].vq.mutex); + } + mutex_unlock(&n->dev.mutex); + + return 0; +} + static int vhost_net_set_features(struct vhost_net *n, u64 features) { size_t vhost_hlen, sock_hlen, hdr_len; @@ -1489,6 +1508,17 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl, if (features & ~VHOST_NET_FEATURES) return -EOPNOTSUPP; return vhost_net_set_features(n, features); + case VHOST_GET_BA...
2020 Jun 24
1
[PATCH] virtio: VIRTIO_F_IOMMU_PLATFORM -> VIRTIO_F_ACCESS_PLATFORM
...@@ -73,7 +73,7 @@ enum { VHOST_NET_FEATURES = VHOST_FEATURES | (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) | (1ULL << VIRTIO_NET_F_MRG_RXBUF) | - (1ULL << VIRTIO_F_IOMMU_PLATFORM) + (1ULL << VIRTIO_F_ACCESS_PLATFORM) }; enum { @@ -1653,7 +1653,7 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features) !vhost_log_access_ok(&n->dev)) goto out_unlock; - if ((features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) { + if ((features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) { if (vhost_init_device_iotlb(&n->dev, true)) goto ou...
2010 Apr 19
2
[PATCH v4] Add mergeable RX bufs support to vhost
...ot;); + vhost_discard_desc(vq, headcount); + break; + } + } + len += vhost_hlen; + vhost_add_used_and_signal_n(&net->dev, vq, vq->heads, headcount); if (unlikely(vq_log)) vhost_log_write(vq, vq_log, log, len); total_len += len; @@ -560,9 +579,24 @@ done: static int vhost_net_set_features(struct vhost_net *n, u64 features) { - size_t hdr_size = features & (1 << VHOST_NET_F_VIRTIO_NET_HDR) ? - sizeof(struct virtio_net_hdr) : 0; + size_t vhost_hlen; + size_t sock_hlen; int i; + + if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { + /* vhost provides vnet_hdr...
2010 Apr 19
2
[PATCH v4] Add mergeable RX bufs support to vhost
...ot;); + vhost_discard_desc(vq, headcount); + break; + } + } + len += vhost_hlen; + vhost_add_used_and_signal_n(&net->dev, vq, vq->heads, headcount); if (unlikely(vq_log)) vhost_log_write(vq, vq_log, log, len); total_len += len; @@ -560,9 +579,24 @@ done: static int vhost_net_set_features(struct vhost_net *n, u64 features) { - size_t hdr_size = features & (1 << VHOST_NET_F_VIRTIO_NET_HDR) ? - sizeof(struct virtio_net_hdr) : 0; + size_t vhost_hlen; + size_t sock_hlen; int i; + + if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { + /* vhost provides vnet_hdr...
2010 Apr 26
1
[PATCH v6] Add mergeable rx buffer support to vhost_net
...vhost_discard_desc(vq, headcount); + break; + } + } + len += vhost_hlen; + vhost_add_used_and_signal_n(&net->dev, vq, vq->heads, + headcount); if (unlikely(vq_log)) vhost_log_write(vq, vq_log, log, len); total_len += len; @@ -561,9 +582,24 @@ done: static int vhost_net_set_features(struct vhost_net *n, u64 features) { - size_t hdr_size = features & (1 << VHOST_NET_F_VIRTIO_NET_HDR) ? - sizeof(struct virtio_net_hdr) : 0; + size_t vhost_hlen; + size_t sock_hlen; int i; + + if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { + /* vhost provides vnet_hdr...
2010 Apr 26
1
[PATCH v6] Add mergeable rx buffer support to vhost_net
...vhost_discard_desc(vq, headcount); + break; + } + } + len += vhost_hlen; + vhost_add_used_and_signal_n(&net->dev, vq, vq->heads, + headcount); if (unlikely(vq_log)) vhost_log_write(vq, vq_log, log, len); total_len += len; @@ -561,9 +582,24 @@ done: static int vhost_net_set_features(struct vhost_net *n, u64 features) { - size_t hdr_size = features & (1 << VHOST_NET_F_VIRTIO_NET_HDR) ? - sizeof(struct virtio_net_hdr) : 0; + size_t vhost_hlen; + size_t sock_hlen; int i; + + if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { + /* vhost provides vnet_hdr...