Displaying 20 results from an estimated 48 matches for "vhost_transport_get_local_cid".
2019 Dec 06
5
[PATCH] vhost/vsock: accept only packets with the right dst_cid
...vhost_work *work)
virtio_transport_deliver_tap_pkt(pkt);
/* Only accept correctly addressed packets */
- if (le64_to_cpu(pkt->hdr.src_cid) == vsock->guest_cid)
+ if (le64_to_cpu(pkt->hdr.src_cid) == vsock->guest_cid &&
+ le64_to_cpu(pkt->hdr.dst_cid) ==
+ vhost_transport_get_local_cid())
virtio_transport_recv_pkt(&vhost_transport, pkt);
else
virtio_transport_free_pkt(pkt);
--
2.23.0
2019 Dec 06
5
[PATCH] vhost/vsock: accept only packets with the right dst_cid
...vhost_work *work)
virtio_transport_deliver_tap_pkt(pkt);
/* Only accept correctly addressed packets */
- if (le64_to_cpu(pkt->hdr.src_cid) == vsock->guest_cid)
+ if (le64_to_cpu(pkt->hdr.src_cid) == vsock->guest_cid &&
+ le64_to_cpu(pkt->hdr.dst_cid) ==
+ vhost_transport_get_local_cid())
virtio_transport_recv_pkt(&vhost_transport, pkt);
else
virtio_transport_free_pkt(pkt);
--
2.23.0
2015 Dec 06
2
[PATCH] VSOCK: fix returnvar.cocci warnings
...-off-by: Fengguang Wu <fengguang.wu at intel.com>
Signed-off-by: Julia Lawall <julia.lawall at lip6.fr>
---
vsock.c | 3 +--
1 file changed, 1 insertion(+), 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)
2015 Dec 06
2
[PATCH] VSOCK: fix returnvar.cocci warnings
...-off-by: Fengguang Wu <fengguang.wu at intel.com>
Signed-off-by: Julia Lawall <julia.lawall at lip6.fr>
---
vsock.c | 3 +--
1 file changed, 1 insertion(+), 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)
2015 Dec 09
0
[PATCH v3 3/4] VSOCK: Introduce vhost-vsock.ko
...send_pkt_list;
+ /* Work item to send pkt */
+ struct vhost_work send_pkt_work;
+ /* Wait queue for send pkt */
+ wait_queue_head_t queue_wait;
+ /* Used for global tx buf limitation */
+ u32 total_tx_buf;
+ /* Guest contex id this vhost_vsock instance handles */
+ u32 guest_cid;
+};
+
+static u32 vhost_transport_get_local_cid(void)
+{
+ return VHOST_VSOCK_DEFAULT_HOST_CID;
+}
+
+static struct vhost_vsock *vhost_vsock_get(u32 guest_cid)
+{
+ struct vhost_vsock *vsock;
+
+ mutex_lock(&vhost_vsock_mutex);
+ list_for_each_entry(vsock, &vhost_vsock_list, list) {
+ if (vsock->guest_cid == guest_cid) {
+ mutex_un...
2013 Jun 27
2
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...struct list_head list;
> + /* Head for pkt from host to guest */
> + struct list_head send_pkt_list;
> + /* Work item to send pkt */
> + struct vhost_work send_pkt_work;
> + /* Guest contex id this vhost_vsock instance handles */
> + u32 guest_cid;
> +};
> +
> +static u32 vhost_transport_get_local_cid(void)
> +{
> + u32 cid = VHOST_VSOCK_DEFAULT_HOST_CID;
> + return cid;
> +}
> +
Interesting. So all hosts in fact have the same CID?
> +static struct vhost_vsock *vhost_vsock_get(u32 guest_cid)
> +{
> + struct vhost_vsock *vsock;
> +
> + mutex_lock(&vhost_vsock_m...
2013 Jun 27
2
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...struct list_head list;
> + /* Head for pkt from host to guest */
> + struct list_head send_pkt_list;
> + /* Work item to send pkt */
> + struct vhost_work send_pkt_work;
> + /* Guest contex id this vhost_vsock instance handles */
> + u32 guest_cid;
> +};
> +
> +static u32 vhost_transport_get_local_cid(void)
> +{
> + u32 cid = VHOST_VSOCK_DEFAULT_HOST_CID;
> + return cid;
> +}
> +
Interesting. So all hosts in fact have the same CID?
> +static struct vhost_vsock *vhost_vsock_get(u32 guest_cid)
> +{
> + struct vhost_vsock *vsock;
> +
> + mutex_lock(&vhost_vsock_m...
2013 Jun 27
0
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...X];
+ /* Link to global vhost_vsock_list*/
+ struct list_head list;
+ /* Head for pkt from host to guest */
+ struct list_head send_pkt_list;
+ /* Work item to send pkt */
+ struct vhost_work send_pkt_work;
+ /* Guest contex id this vhost_vsock instance handles */
+ u32 guest_cid;
+};
+
+static u32 vhost_transport_get_local_cid(void)
+{
+ u32 cid = VHOST_VSOCK_DEFAULT_HOST_CID;
+ return cid;
+}
+
+static struct vhost_vsock *vhost_vsock_get(u32 guest_cid)
+{
+ struct vhost_vsock *vsock;
+
+ mutex_lock(&vhost_vsock_mutex);
+ list_for_each_entry(vsock, &vhost_vsock_list, list) {
+ if (vsock->guest_cid == guest_ci...
2015 Dec 11
1
[PATCH v3 3/4] VSOCK: Introduce vhost-vsock.ko
...tx buf limitation */
> + u32 total_tx_buf;
> + /* Guest contex id this vhost_vsock instance handles */
> + u32 guest_cid;
> +};
As with 2/4 there is a fair bit of redundancy in the comments but I
don't see any obvious grouping here that could streamline it.
> +
> +static u32 vhost_transport_get_local_cid(void)
> +{
> + return VHOST_VSOCK_DEFAULT_HOST_CID;
> +}
> +
> +static struct vhost_vsock *vhost_vsock_get(u32 guest_cid)
> +{
> + struct vhost_vsock *vsock;
> +
> + mutex_lock(&vhost_vsock_mutex);
> + list_for_each_entry(vsock, &vhost_vsock_list, list) {
>...
2015 Dec 11
1
[PATCH v3 3/4] VSOCK: Introduce vhost-vsock.ko
...tx buf limitation */
> + u32 total_tx_buf;
> + /* Guest contex id this vhost_vsock instance handles */
> + u32 guest_cid;
> +};
As with 2/4 there is a fair bit of redundancy in the comments but I
don't see any obvious grouping here that could streamline it.
> +
> +static u32 vhost_transport_get_local_cid(void)
> +{
> + return VHOST_VSOCK_DEFAULT_HOST_CID;
> +}
> +
> +static struct vhost_vsock *vhost_vsock_get(u32 guest_cid)
> +{
> + struct vhost_vsock *vsock;
> +
> + mutex_lock(&vhost_vsock_mutex);
> + list_for_each_entry(vsock, &vhost_vsock_list, list) {
>...
2019 Sep 27
0
[RFC PATCH 05/13] vsock/virtio: add transport parameter to the virtio_transport_reset_no_sock()
...5e..92ab3852c954 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -384,6 +384,52 @@ static bool vhost_vsock_more_replies(struct vhost_vsock *vsock)
return val < vq->num;
}
+static struct virtio_transport vhost_transport = {
+ .transport = {
+ .get_local_cid = vhost_transport_get_local_cid,
+
+ .init = virtio_transport_do_socket_init,
+ .destruct = virtio_transport_destruct,
+ .release = virtio_transport_release,
+ .connect = virtio_transport_connect,
+ .shutdown = virtio_transport_shutdown,
+...
2019 Oct 11
6
[PATCH net 0/2] vsock: don't allow half-closed socket in the host transports
We are implementing a test suite for the VSOCK sockets and we discovered
that vmci_transport never allowed half-closed socket on the host side.
As Jorgen explained [1] this is due to the implementation of VMCI.
Since we want to have the same behaviour across all transports, this
series adds a section in the "Implementation notes" to exaplain this
behaviour, and changes the
2019 Oct 11
6
[PATCH net 0/2] vsock: don't allow half-closed socket in the host transports
We are implementing a test suite for the VSOCK sockets and we discovered
that vmci_transport never allowed half-closed socket on the host side.
As Jorgen explained [1] this is due to the implementation of VMCI.
Since we want to have the same behaviour across all transports, this
series adds a section in the "Implementation notes" to exaplain this
behaviour, and changes the
2019 Oct 11
0
[PATCH net 2/2] vhost/vsock: don't allow half-closed socket in the host
...redhat.com>
---
drivers/vhost/vsock.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index 9f57736fe15e..754120aa4478 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -58,6 +58,21 @@ static u32 vhost_transport_get_local_cid(void)
return VHOST_VSOCK_DEFAULT_HOST_CID;
}
+static s64 vhost_transport_stream_has_data(struct vsock_sock *vsk)
+{
+ /* vmci_transport doesn't allow half-closed socket on the host side.
+ * recv() on the host side returns EOF when the guest closes a
+ * connection, also if some data is...
2019 Dec 10
0
[PATCH] vhost/vsock: accept only packets with the right dst_cid
...ransport_deliver_tap_pkt(pkt);
>
> /* Only accept correctly addressed packets */
> - if (le64_to_cpu(pkt->hdr.src_cid) == vsock->guest_cid)
> + if (le64_to_cpu(pkt->hdr.src_cid) == vsock->guest_cid &&
> + le64_to_cpu(pkt->hdr.dst_cid) ==
> + vhost_transport_get_local_cid())
> virtio_transport_recv_pkt(&vhost_transport, pkt);
> else
> virtio_transport_free_pkt(pkt);
> --
> 2.23.0
2019 Dec 11
0
[PATCH] vhost/vsock: accept only packets with the right dst_cid
...ransport_deliver_tap_pkt(pkt);
>
> /* Only accept correctly addressed packets */
> - if (le64_to_cpu(pkt->hdr.src_cid) == vsock->guest_cid)
> + if (le64_to_cpu(pkt->hdr.src_cid) == vsock->guest_cid &&
> + le64_to_cpu(pkt->hdr.dst_cid) ==
> + vhost_transport_get_local_cid())
> virtio_transport_recv_pkt(&vhost_transport, pkt);
> else
> virtio_transport_free_pkt(pkt);
> --
> 2.23.0
2019 Oct 11
1
[PATCH net 2/2] vhost/vsock: don't allow half-closed socket in the host
...sock.c | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
> index 9f57736fe15e..754120aa4478 100644
> --- a/drivers/vhost/vsock.c
> +++ b/drivers/vhost/vsock.c
> @@ -58,6 +58,21 @@ static u32 vhost_transport_get_local_cid(void)
> return VHOST_VSOCK_DEFAULT_HOST_CID;
> }
>
> +static s64 vhost_transport_stream_has_data(struct vsock_sock *vsk)
> +{
> + /* vmci_transport doesn't allow half-closed socket on the host side.
> + * recv() on the host side returns EOF when the guest closes a
>...
2019 Sep 27
0
[RFC PATCH 12/13] vsock: prevent transport modules unloading
...s/vhost/vsock.c
@@ -387,6 +387,7 @@ static bool vhost_vsock_more_replies(struct vhost_vsock *vsock)
static struct virtio_transport vhost_transport = {
.transport = {
.features = VSOCK_TRANSPORT_F_H2G,
+ .module = THIS_MODULE,
.get_local_cid = vhost_transport_get_local_cid,
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
index 2a081d19e20d..f10fa918bf23 100644
--- a/include/net/af_vsock.h
+++ b/include/net/af_vsock.h
@@ -100,6 +100,7 @@ struct vsock_transport_send_notify_data {
struct vsock_transport {
uint64_t features;
+ struct module *module;...
2019 Oct 23
0
[PATCH net-next 13/14] vsock: prevent transport modules unloading
...25ad 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -386,6 +386,8 @@ static bool vhost_vsock_more_replies(struct vhost_vsock *vsock)
static struct virtio_transport vhost_transport = {
.transport = {
+ .module = THIS_MODULE,
+
.get_local_cid = vhost_transport_get_local_cid,
.init = virtio_transport_do_socket_init,
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
index 27a3463e4892..269e2f034789 100644
--- a/include/net/af_vsock.h
+++ b/include/net/af_vsock.h
@@ -100,6 +100,8 @@ struct vsock_transport_send_notify_data {
#define VS...
2018 Dec 12
0
[PATCH v2 4/5] VSOCK: increase send pkt len in mergeable mode to improve performance
...53 insertions(+), 8 deletions(-)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index c7ab0dd..9600133 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -44,6 +44,8 @@ struct vhost_vsock {
atomic_t queued_replies;
u32 guest_cid;
+
+ bool mergeable;
};
static u32 vhost_transport_get_local_cid(void)
@@ -151,7 +153,6 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,
struct vhost_virtqueue *tx_vq = &vsock->vqs[VSOCK_VQ_TX];
bool added = false;
bool restart_tx = false;
- int mergeable;
size_t vsock_hlen;
mutex_lock(&vq->mutex);
@@ -159,12 +160,11 @@ static int g...