search for: send_pkt

Displaying 20 results from an estimated 107 matches for "send_pkt".

2020 May 06
3
[GIT PULL] vhost: fixes
...; > > > are available in the Git repository at: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus > > > > for you to fetch changes up to > > 0b841030625cde5f784dd62aec72d6a766faae70: > > > > vhost: vsock: kick send_pkt worker once device is started (2020-05-02 > > 10:28:21 -0400) > > > > ---------------------------------------------------------------- > > virtio: fixes > > > > A couple of bug fixes. > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com>...
2020 May 06
3
[GIT PULL] vhost: fixes
...; > > > are available in the Git repository at: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus > > > > for you to fetch changes up to > > 0b841030625cde5f784dd62aec72d6a766faae70: > > > > vhost: vsock: kick send_pkt worker once device is started (2020-05-02 > > 10:28:21 -0400) > > > > ---------------------------------------------------------------- > > virtio: fixes > > > > A couple of bug fixes. > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com>...
2020 May 01
0
[PATCH v2] vhost: vsock: kick send_pkt worker once device is started
...ies to connect > an initializing virtio vsock server. > > The abnormal flow looks like: > host-userspace vhost vsock guest vsock > ============== =========== ============ > connect() --------> vhost_transport_send_pkt_work() initializing > | vq->private_data==NULL > | will not be queued > V > schedule_timeout(2s) > vhost_vsock_start() <--------- device ready > set vq->private_data &g...
2019 Mar 05
4
[PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
...virtio_transport *t; struct virtio_vsock_pkt_info info = { .op = VIRTIO_VSOCK_OP_RST, .type = le16_to_cpu(pkt->hdr.type), @@ -680,7 +681,11 @@ static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt) if (!pkt) return -ENOMEM; - return virtio_transport_get_ops()->send_pkt(pkt); + t = virtio_transport_get_ops(); + if (!t) + return -ENOTCONN; + + return t->send_pkt(pkt); } static void virtio_transport_wait_close(struct sock *sk, long timeout) -- 2.21.0
2019 Mar 05
4
[PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
...virtio_transport *t; struct virtio_vsock_pkt_info info = { .op = VIRTIO_VSOCK_OP_RST, .type = le16_to_cpu(pkt->hdr.type), @@ -680,7 +681,11 @@ static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt) if (!pkt) return -ENOMEM; - return virtio_transport_get_ops()->send_pkt(pkt); + t = virtio_transport_get_ops(); + if (!t) + return -ENOTCONN; + + return t->send_pkt(pkt); } static void virtio_transport_wait_close(struct sock *sk, long timeout) -- 2.21.0
2023 Mar 22
0
[RFC PATCH v4] virtio/vsock: allocate multiple skbuffs on tx
...> >diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c >index 6564192e7f20..a300f25749ea 100644 >--- a/net/vmw_vsock/virtio_transport_common.c >+++ b/net/vmw_vsock/virtio_transport_common.c >@@ -196,7 +196,8 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk, > const struct virtio_transport *t_ops; > struct virtio_vsock_sock *vvs; > u32 pkt_len = info->pkt_len; >- struct sk_buff *skb; >+ u32 rest_len; >+ int ret; > > info->type = virtio_transport_get_type(sk_vsock(vsk)); > >@@ -216,10...
2023 Mar 21
0
[RFC PATCH v2] virtio/vsock: allocate multiple skbuffs on tx
...virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c >>> index 6564192e7f20..3fdf1433ec28 100644 >>> --- a/net/vmw_vsock/virtio_transport_common.c >>> +++ b/net/vmw_vsock/virtio_transport_common.c >>> @@ -196,7 +196,8 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk, >>> ????const struct virtio_transport *t_ops; >>> ????struct virtio_vsock_sock *vvs; >>> ????u32 pkt_len = info->pkt_len; >>> -??? struct sk_buff *skb; >>> +??? u32 rest_len; >>> +??? int ret; >>> >&gt...
2019 Mar 06
2
[PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
...; .op = VIRTIO_VSOCK_OP_RST, > > .type = le16_to_cpu(pkt->hdr.type), > > @@ -680,7 +681,11 @@ static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt) > > if (!pkt) > > return -ENOMEM; > > > > - return virtio_transport_get_ops()->send_pkt(pkt); > > + t = virtio_transport_get_ops(); > > + if (!t) > > + return -ENOTCONN; > > pkt is leaked here. This is an easy mistake to make because the code is > unclear. Thank you for your kind words :) > The pkt argument is the received packet that we must reply...
2019 Mar 06
2
[PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
...; .op = VIRTIO_VSOCK_OP_RST, > > .type = le16_to_cpu(pkt->hdr.type), > > @@ -680,7 +681,11 @@ static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt) > > if (!pkt) > > return -ENOMEM; > > > > - return virtio_transport_get_ops()->send_pkt(pkt); > > + t = virtio_transport_get_ops(); > > + if (!t) > > + return -ENOTCONN; > > pkt is leaked here. This is an easy mistake to make because the code is > unclear. Thank you for your kind words :) > The pkt argument is the received packet that we must reply...
2020 May 06
0
[GIT PULL] vhost: fixes
...he Git repository at: > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus > > > > > > for you to fetch changes up to > > > 0b841030625cde5f784dd62aec72d6a766faae70: > > > > > > vhost: vsock: kick send_pkt worker once device is started (2020-05-02 > > > 10:28:21 -0400) > > > > > > ---------------------------------------------------------------- > > > virtio: fixes > > > > > > A couple of bug fixes. > > > > > > Signed-off-by: Mich...
2013 Jun 27
1
[RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko
...u32 len; > + u32 off; > +}; > + > +struct virtio_vsock_pkt_info { > + struct sockaddr_vm *src; > + struct sockaddr_vm *dst; > + struct iovec *iov; > + u32 len; > + u8 type; > + u8 op; > + u8 shut; > +}; > + > +struct virtio_transport_pkt_ops { > + int (*send_pkt)(struct vsock_sock *vsk, > + struct virtio_vsock_pkt_info *info); > +}; > + > +void virtio_vsock_dumppkt(const char *func, > + const struct virtio_vsock_pkt *pkt); > + > +struct sock * > +virtio_transport_get_pending(struct sock *listener, > + struct virtio_v...
2013 Jun 27
1
[RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko
...u32 len; > + u32 off; > +}; > + > +struct virtio_vsock_pkt_info { > + struct sockaddr_vm *src; > + struct sockaddr_vm *dst; > + struct iovec *iov; > + u32 len; > + u8 type; > + u8 op; > + u8 shut; > +}; > + > +struct virtio_transport_pkt_ops { > + int (*send_pkt)(struct vsock_sock *vsk, > + struct virtio_vsock_pkt_info *info); > +}; > + > +void virtio_vsock_dumppkt(const char *func, > + const struct virtio_vsock_pkt *pkt); > + > +struct sock * > +virtio_transport_get_pending(struct sock *listener, > + struct virtio_v...
2023 Mar 21
0
[RFC PATCH v3] virtio/vsock: allocate multiple skbuffs on tx
...> >diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c >index 6564192e7f20..e0b2c6ecbe22 100644 >--- a/net/vmw_vsock/virtio_transport_common.c >+++ b/net/vmw_vsock/virtio_transport_common.c >@@ -196,7 +196,8 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk, > const struct virtio_transport *t_ops; > struct virtio_vsock_sock *vvs; > u32 pkt_len = info->pkt_len; >- struct sk_buff *skb; >+ u32 rest_len; >+ int ret; > > info->type = virtio_transport_get_type(sk_vsock(vsk)); > >@@ -216,10...
2013 Jun 27
0
[RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko
...*trans; + struct work_struct work; + struct list_head list; + void *buf; + u32 len; + u32 off; +}; + +struct virtio_vsock_pkt_info { + struct sockaddr_vm *src; + struct sockaddr_vm *dst; + struct iovec *iov; + u32 len; + u8 type; + u8 op; + u8 shut; +}; + +struct virtio_transport_pkt_ops { + int (*send_pkt)(struct vsock_sock *vsk, + struct virtio_vsock_pkt_info *info); +}; + +void virtio_vsock_dumppkt(const char *func, + const struct virtio_vsock_pkt *pkt); + +struct sock * +virtio_transport_get_pending(struct sock *listener, + struct virtio_vsock_pkt *pkt); +struct virtio_vsock_pkt * +v...
2019 Sep 27
0
[RFC PATCH 05/13] vsock/virtio: add transport parameter to the virtio_transport_reset_no_sock()
...k_sock *' parameter to virtio_transport_get_ops(). In some cases, like in the virtio_transport_reset_no_sock(), we don't have any socket assigned to the packet received, so we can't use the virtio_transport_get_ops(). In order to allow virtio_transport_reset_no_sock() to use the '.send_pkt' callback from the 'vhost_transport' or 'virtio_transport', we add the 'struct virtio_transport *' to it and to its caller: virtio_transport_recv_pkt(). We moved the 'vhost_transport' and 'virtio_transport' definition, to pass their address to the virtio...
2018 Dec 12
0
[PATCH v2 4/5] VSOCK: increase send pkt len in mergeable mode to improve performance
...size of pkt in advance. */ - if (likely(mergeable)) + if (likely(vsock->mergeable)) vsock_hlen = sizeof(struct virtio_vsock_pkt); else vsock_hlen = sizeof(struct virtio_vsock_hdr); @@ -195,7 +195,7 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, spin_unlock_bh(&vsock->send_pkt_list_lock); headcount = get_rx_bufs(vq, vq->heads, vsock_hlen + pkt->len, - &in, likely(mergeable) ? UIO_MAXIOV : 1); + &in, likely(vsock->mergeable) ? UIO_MAXIOV : 1); if (headcount <= 0) { spin_lock_bh(&vsock->send_pkt_list_lock); list_add(&pkt-...
2014 Jul 05
0
[RFC V2 3/7] VSOCK: Introduce virtio-vsock-common.ko
...work_struct work; + struct list_head list; + void *buf; + u32 len; + u32 off; +}; + +struct virtio_vsock_pkt_info { + u32 remote_cid, remote_port; + struct iovec *iov; + u32 pkt_len; + u16 type; + u16 op; + u32 flags; + u16 dgram_id; + u16 dgram_len; +}; + +struct virtio_transport_pkt_ops { + int (*send_pkt)(struct vsock_sock *vsk, + struct virtio_vsock_pkt_info *info); +}; + +void virtio_vsock_dumppkt(const char *func, + const struct virtio_vsock_pkt *pkt); + +struct sock * +virtio_transport_get_pending(struct sock *listener, + struct virtio_vsock_pkt *pkt); +struct virtio_vsock_pkt * +v...
2016 Dec 07
0
[PATCH v2 2/4] vhost-vsock: add pkt cancel capability
...+++++++++++++++++++++++++++++++++++++++++ include/linux/virtio_vsock.h | 3 +++ 2 files changed, 44 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index a504e2e0..d01e4a4 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -218,6 +218,46 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) return len; } +static int +vhost_transport_cancel_pkt(struct vsock_sock *vsk) +{ + struct vhost_vsock *vsock; + struct virtio_vsock_pkt *pkt, *n; + int cnt = 0; + LIST_HEAD(freeme); + + /* Find the vhost_vsock according to guest context id */ + vsock = vhost_vsoc...
2019 Mar 06
0
[PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
...io_vsock_pkt_info info = { > .op = VIRTIO_VSOCK_OP_RST, > .type = le16_to_cpu(pkt->hdr.type), > @@ -680,7 +681,11 @@ static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt) > if (!pkt) > return -ENOMEM; > > - return virtio_transport_get_ops()->send_pkt(pkt); > + t = virtio_transport_get_ops(); > + if (!t) > + return -ENOTCONN; pkt is leaked here. This is an easy mistake to make because the code is unclear. The pkt argument is the received packet that we must reply to. The reply packet is allocated just before line 680 and must be fre...
2019 Sep 27
0
[RFC PATCH 06/13] vsock: add 'struct vsock_sock *' param to vsock_core_get_transport()
...+virtio_transport_get_ops(struct vsock_sock *vsk) { - const struct vsock_transport *t = vsock_core_get_transport(); + const struct vsock_transport *t = vsock_core_get_transport(vsk); return container_of(t, struct virtio_transport, transport); } @@ -168,7 +169,7 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk, struct virtio_vsock_pkt *pkt; u32 pkt_len = info->pkt_len; - src_cid = virtio_transport_get_ops()->transport.get_local_cid(); + src_cid = virtio_transport_get_ops(vsk)->transport.get_local_cid(); src_port = vsk->local_addr.svm_port; if (!info->r...