search for: vhost_vsock_get

Displaying 20 results from an estimated 78 matches for "vhost_vsock_get".

2018 Nov 05
2
[PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host
...8 @@ #define VHOST_VSOCK_DEFAULT_HOST_CID 2 enum { - VHOST_VSOCK_FEATURES = VHOST_FEATURES, + VHOST_VSOCK_FEATURES = VHOST_FEATURES | + (1ULL << VIRTIO_VSOCK_F_MRG_RXBUF), }; /* Used to track all the vhost_vsock instances on the system. */ @@ -80,6 +81,68 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) return vsock; } +static int get_rx_bufs(struct vhost_virtqueue *vq, + struct vring_used_elem *heads, int datalen, + unsigned *iovcount, unsigned int quota) +{ + unsigned int out, in; + int seg = 0; + int headcount = 0; + unsigned d; + int ret; + /* + * len is always initialize...
2018 Nov 05
2
[PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host
...8 @@ #define VHOST_VSOCK_DEFAULT_HOST_CID 2 enum { - VHOST_VSOCK_FEATURES = VHOST_FEATURES, + VHOST_VSOCK_FEATURES = VHOST_FEATURES | + (1ULL << VIRTIO_VSOCK_F_MRG_RXBUF), }; /* Used to track all the vhost_vsock instances on the system. */ @@ -80,6 +81,68 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) return vsock; } +static int get_rx_bufs(struct vhost_virtqueue *vq, + struct vring_used_elem *heads, int datalen, + unsigned *iovcount, unsigned int quota) +{ + unsigned int out, in; + int seg = 0; + int headcount = 0; + unsigned d; + int ret; + /* + * len is always initialize...
2018 Dec 12
4
[PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host
...8 @@ #define VHOST_VSOCK_DEFAULT_HOST_CID 2 enum { - VHOST_VSOCK_FEATURES = VHOST_FEATURES, + VHOST_VSOCK_FEATURES = VHOST_FEATURES | + (1ULL << VIRTIO_VSOCK_F_MRG_RXBUF), }; /* Used to track all the vhost_vsock instances on the system. */ @@ -80,6 +81,69 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) return vsock; } +/* This segment of codes are copied from drivers/vhost/net.c */ +static int get_rx_bufs(struct vhost_virtqueue *vq, + struct vring_used_elem *heads, int datalen, + unsigned *iovcount, unsigned int quota) +{ + unsigned int out, in; + int seg = 0; + int headcount...
2018 Dec 12
4
[PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host
...8 @@ #define VHOST_VSOCK_DEFAULT_HOST_CID 2 enum { - VHOST_VSOCK_FEATURES = VHOST_FEATURES, + VHOST_VSOCK_FEATURES = VHOST_FEATURES | + (1ULL << VIRTIO_VSOCK_F_MRG_RXBUF), }; /* Used to track all the vhost_vsock instances on the system. */ @@ -80,6 +81,69 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) return vsock; } +/* This segment of codes are copied from drivers/vhost/net.c */ +static int get_rx_bufs(struct vhost_virtqueue *vq, + struct vring_used_elem *heads, int datalen, + unsigned *iovcount, unsigned int quota) +{ + unsigned int out, in; + int seg = 0; + int headcount...
2018 Nov 06
0
[PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host
...gt; > enum { > - VHOST_VSOCK_FEATURES = VHOST_FEATURES, > + VHOST_VSOCK_FEATURES = VHOST_FEATURES | > + (1ULL << VIRTIO_VSOCK_F_MRG_RXBUF), > }; > > /* Used to track all the vhost_vsock instances on the system. */ > @@ -80,6 +81,68 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) > return vsock; > } > > +static int get_rx_bufs(struct vhost_virtqueue *vq, > + struct vring_used_elem *heads, int datalen, > + unsigned *iovcount, unsigned int quota) > +{ > + unsigned int out, in; > + int seg = 0; > + int headcount = 0; > + u...
2018 Dec 13
4
[PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host
...- VHOST_VSOCK_FEATURES = VHOST_FEATURES, >> + VHOST_VSOCK_FEATURES = VHOST_FEATURES | >> + (1ULL << VIRTIO_VSOCK_F_MRG_RXBUF), >> }; >> >> /* Used to track all the vhost_vsock instances on the system. */ >> @@ -80,6 +81,69 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) >> return vsock; >> } >> >> +/* This segment of codes are copied from drivers/vhost/net.c */ >> +static int get_rx_bufs(struct vhost_virtqueue *vq, >> + struct vring_used_elem *heads, int datalen, >> + unsigned *iovcount, unsigned int qu...
2018 Dec 13
4
[PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host
...- VHOST_VSOCK_FEATURES = VHOST_FEATURES, >> + VHOST_VSOCK_FEATURES = VHOST_FEATURES | >> + (1ULL << VIRTIO_VSOCK_F_MRG_RXBUF), >> }; >> >> /* Used to track all the vhost_vsock instances on the system. */ >> @@ -80,6 +81,69 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) >> return vsock; >> } >> >> +/* This segment of codes are copied from drivers/vhost/net.c */ >> +static int get_rx_bufs(struct vhost_virtqueue *vq, >> + struct vring_used_elem *heads, int datalen, >> + unsigned *iovcount, unsigned int qu...
2018 Nov 06
2
[PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host
..._FEATURES = VHOST_FEATURES, >> + VHOST_VSOCK_FEATURES = VHOST_FEATURES | >> + (1ULL << VIRTIO_VSOCK_F_MRG_RXBUF), >> }; >> >> /* Used to track all the vhost_vsock instances on the system. */ >> @@ -80,6 +81,68 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) >> return vsock; >> } >> >> +static int get_rx_bufs(struct vhost_virtqueue *vq, >> + struct vring_used_elem *heads, int datalen, >> + unsigned *iovcount, unsigned int quota) >> +{ >> + unsigned int out, in; >...
2018 Nov 06
2
[PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host
..._FEATURES = VHOST_FEATURES, >> + VHOST_VSOCK_FEATURES = VHOST_FEATURES | >> + (1ULL << VIRTIO_VSOCK_F_MRG_RXBUF), >> }; >> >> /* Used to track all the vhost_vsock instances on the system. */ >> @@ -80,6 +81,68 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) >> return vsock; >> } >> >> +static int get_rx_bufs(struct vhost_virtqueue *vq, >> + struct vring_used_elem *heads, int datalen, >> + unsigned *iovcount, unsigned int quota) >> +{ >> + unsigned int out, in; >...
2018 Dec 12
0
[PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host
...> > enum { > - VHOST_VSOCK_FEATURES = VHOST_FEATURES, > + VHOST_VSOCK_FEATURES = VHOST_FEATURES | > + (1ULL << VIRTIO_VSOCK_F_MRG_RXBUF), > }; > > /* Used to track all the vhost_vsock instances on the system. */ > @@ -80,6 +81,69 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) > return vsock; > } > > +/* This segment of codes are copied from drivers/vhost/net.c */ > +static int get_rx_bufs(struct vhost_virtqueue *vq, > + struct vring_used_elem *heads, int datalen, > + unsigned *iovcount, unsigned int quota) > +{ > + unsigne...
2019 Nov 28
5
[RFC PATCH 0/3] vsock: support network namespace
Hi, now that we have multi-transport upstream, I started to take a look to support network namespace (netns) in vsock. As we partially discussed in the multi-transport proposal [1], it could be nice to support network namespace in vsock to reach the following goals: - isolate host applications from guest applications using the same ports with CID_ANY - assign the same CID of VMs running in
2019 Nov 28
5
[RFC PATCH 0/3] vsock: support network namespace
Hi, now that we have multi-transport upstream, I started to take a look to support network namespace (netns) in vsock. As we partially discussed in the multi-transport proposal [1], it could be nice to support network namespace in vsock to reach the following goals: - isolate host applications from guest applications using the same ports with CID_ANY - assign the same CID of VMs running in
2018 Dec 13
0
[PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host
...T_FEATURES, > >> + VHOST_VSOCK_FEATURES = VHOST_FEATURES | > >> + (1ULL << VIRTIO_VSOCK_F_MRG_RXBUF), > >> }; > >> > >> /* Used to track all the vhost_vsock instances on the system. */ > >> @@ -80,6 +81,69 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) > >> return vsock; > >> } > >> > >> +/* This segment of codes are copied from drivers/vhost/net.c */ > >> +static int get_rx_bufs(struct vhost_virtqueue *vq, > >> + struct vring_used_elem *heads, int datalen, > >> +...
2019 May 16
0
[PATCH net 3/4] vhost: vsock: add weight support
...t.com> --- drivers/vhost/vsock.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 47c6d4d..1fa9deb 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -86,6 +86,7 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) struct vhost_virtqueue *vq) { struct vhost_virtqueue *tx_vq = &vsock->vqs[VSOCK_VQ_TX]; + int pkts = 0, total_len = 0; bool added = false; bool restart_tx = false; @@ -97,7 +98,7 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) /* Avoid further v...
2018 Sep 27
3
[PATCH net V2] vhost-vsock: fix use after free
...--- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -210,21 +210,27 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) struct vhost_vsock *vsock; int len = pkt->len; + spin_lock_bh(&vhost_vsock_lock); + /* Find the vhost_vsock according to guest context id */ - vsock = vhost_vsock_get(le64_to_cpu(pkt->hdr.dst_cid)); + vsock = __vhost_vsock_get(le64_to_cpu(pkt->hdr.dst_cid)); if (!vsock) { virtio_transport_free_pkt(pkt); + spin_unlock_bh(&vhost_vsock_lock); return -ENODEV; } if (pkt->reply) atomic_inc(&vsock->queued_replies); - spin_lock_bh...
2018 Sep 27
3
[PATCH net V2] vhost-vsock: fix use after free
...--- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -210,21 +210,27 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) struct vhost_vsock *vsock; int len = pkt->len; + spin_lock_bh(&vhost_vsock_lock); + /* Find the vhost_vsock according to guest context id */ - vsock = vhost_vsock_get(le64_to_cpu(pkt->hdr.dst_cid)); + vsock = __vhost_vsock_get(le64_to_cpu(pkt->hdr.dst_cid)); if (!vsock) { virtio_transport_free_pkt(pkt); + spin_unlock_bh(&vhost_vsock_lock); return -ENODEV; } if (pkt->reply) atomic_inc(&vsock->queued_replies); - spin_lock_bh...
2015 Dec 06
2
[PATCH] VSOCK: fix returnvar.cocci warnings
...ion(+), 2 deletions(-) --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -56,8 +56,7 @@ struct vhost_vsock { static u32 vhost_transport_get_local_cid(void) { - u32 cid = VHOST_VSOCK_DEFAULT_HOST_CID; - return cid; + return VHOST_VSOCK_DEFAULT_HOST_CID; } static struct vhost_vsock *vhost_vsock_get(u32 guest_cid)
2016 Dec 07
1
[PATCH] vhost-vsock: fix orphan connection reset
...1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index e3b30ea..a504e2e0 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -506,7 +506,7 @@ static void vhost_vsock_reset_orphans(struct sock *sk) * executing. */ - if (!vhost_vsock_get(vsk->local_addr.svm_cid)) { + if (!vhost_vsock_get(vsk->remote_addr.svm_cid)) { sock_set_flag(sk, SOCK_DONE); vsk->peer_shutdown = SHUTDOWN_MASK; sk->sk_state = SS_UNCONNECTED; -- 2.7.4
2016 Dec 08
1
[PATCH-RESEND] vhost-vsock: fix orphan connection reset
...1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index e3b30ea..a504e2e0 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -506,7 +506,7 @@ static void vhost_vsock_reset_orphans(struct sock *sk) * executing. */ - if (!vhost_vsock_get(vsk->local_addr.svm_cid)) { + if (!vhost_vsock_get(vsk->remote_addr.svm_cid)) { sock_set_flag(sk, SOCK_DONE); vsk->peer_shutdown = SHUTDOWN_MASK; sk->sk_state = SS_UNCONNECTED; -- 2.7.4
2018 Sep 27
0
[PATCH net V2] vhost-vsock: fix use after free
...s/vhost/vsock.c > @@ -210,21 +210,27 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) > struct vhost_vsock *vsock; > int len = pkt->len; > > + spin_lock_bh(&vhost_vsock_lock); > + > /* Find the vhost_vsock according to guest context id */ > - vsock = vhost_vsock_get(le64_to_cpu(pkt->hdr.dst_cid)); > + vsock = __vhost_vsock_get(le64_to_cpu(pkt->hdr.dst_cid)); > if (!vsock) { > virtio_transport_free_pkt(pkt); > + spin_unlock_bh(&vhost_vsock_lock); > return -ENODEV; > } > > if (pkt->reply) > atomic_inc(&am...