Displaying 20 results from an estimated 50 matches for "virtio_transport_send_pkt_work".
2023 May 02
1
[Patch net] vsock: improve tap delivery accuracy
...k/virtio_transport.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index e95df847176b..055678628c07 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -109,9 +109,6 @@ virtio_transport_send_pkt_work(struct work_struct *work)
if (!skb)
break;
- virtio_transport_deliver_tap_pkt(skb);
- reply = virtio_vsock_skb_reply(skb);
-
sg_init_one(&hdr, virtio_vsock_hdr(skb), sizeof(*virtio_vsock_hdr(skb)));
sgs[out_sg++] = &hdr;
if (skb->len > 0) {
@@ -128,6 +125,8 @@ virt...
2020 Apr 21
2
[PATCH net] vsock/virtio: postpone packet delivery to monitoring devices
...virtio_transport.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index dfbaf6bd8b1c..d8db837a96fe 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -115,8 +115,6 @@ virtio_transport_send_pkt_work(struct work_struct *work)
list_del_init(&pkt->list);
spin_unlock_bh(&vsock->send_pkt_list_lock);
- virtio_transport_deliver_tap_pkt(pkt);
-
reply = pkt->reply;
sg_init_one(&hdr, &pkt->hdr, sizeof(pkt->hdr));
@@ -137,6 +135,11 @@ virtio_transport_send_...
2020 Apr 21
2
[PATCH net] vsock/virtio: postpone packet delivery to monitoring devices
...virtio_transport.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index dfbaf6bd8b1c..d8db837a96fe 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -115,8 +115,6 @@ virtio_transport_send_pkt_work(struct work_struct *work)
list_del_init(&pkt->list);
spin_unlock_bh(&vsock->send_pkt_list_lock);
- virtio_transport_deliver_tap_pkt(pkt);
-
reply = pkt->reply;
sg_init_one(&hdr, &pkt->hdr, sizeof(pkt->hdr));
@@ -137,6 +135,11 @@ virtio_transport_send_...
2019 Jun 28
0
[PATCH v2 2/3] vsock/virtio: stop workers during the .remove()
...k->rx_run)
+ goto out;
+
while (!list_empty(&pkts)) {
struct virtio_vsock_pkt *pkt;
@@ -102,6 +109,7 @@ static void virtio_transport_loopback_work(struct work_struct *work)
virtio_transport_recv_pkt(pkt);
}
+out:
mutex_unlock(&vsock->rx_lock);
}
@@ -130,6 +138,9 @@ virtio_transport_send_pkt_work(struct work_struct *work)
mutex_lock(&vsock->tx_lock);
+ if (!vsock->tx_run)
+ goto out;
+
vq = vsock->vqs[VSOCK_VQ_TX];
for (;;) {
@@ -188,6 +199,7 @@ virtio_transport_send_pkt_work(struct work_struct *work)
if (added)
virtqueue_kick(vq);
+out:
mutex_unlock(&...
2019 Jul 05
0
[PATCH v3 2/3] vsock/virtio: stop workers during the .remove()
...k->rx_run)
+ goto out;
+
while (!list_empty(&pkts)) {
struct virtio_vsock_pkt *pkt;
@@ -102,6 +109,7 @@ static void virtio_transport_loopback_work(struct work_struct *work)
virtio_transport_recv_pkt(pkt);
}
+out:
mutex_unlock(&vsock->rx_lock);
}
@@ -130,6 +138,9 @@ virtio_transport_send_pkt_work(struct work_struct *work)
mutex_lock(&vsock->tx_lock);
+ if (!vsock->tx_run)
+ goto out;
+
vq = vsock->vqs[VSOCK_VQ_TX];
for (;;) {
@@ -188,6 +199,7 @@ virtio_transport_send_pkt_work(struct work_struct *work)
if (added)
virtqueue_kick(vq);
+out:
mutex_unlock(&...
2020 Apr 21
2
[PATCH net] vsock/virtio: postpone packet delivery to monitoring devices
...> >
> > This patch fixes this issue, postponing the packet delivery
> > to monitoring devices, only when it is properly queued in the
>
> s/,//
>
> > virqueue.
>
> s/virqueue/virtqueue/
>
Thanks, I'll fix in the v2!
> > @@ -137,6 +135,11 @@ virtio_transport_send_pkt_work(struct work_struct *work)
> > break;
> > }
> >
> > + /* Deliver to monitoring devices all correctly transmitted
> > + * packets.
> > + */
> > + virtio_transport_deliver_tap_pkt(pkt);
> > +
>
> The device may see the tx packet and...
2020 Apr 21
2
[PATCH net] vsock/virtio: postpone packet delivery to monitoring devices
...> >
> > This patch fixes this issue, postponing the packet delivery
> > to monitoring devices, only when it is properly queued in the
>
> s/,//
>
> > virqueue.
>
> s/virqueue/virtqueue/
>
Thanks, I'll fix in the v2!
> > @@ -137,6 +135,11 @@ virtio_transport_send_pkt_work(struct work_struct *work)
> > break;
> > }
> >
> > + /* Deliver to monitoring devices all correctly transmitted
> > + * packets.
> > + */
> > + virtio_transport_deliver_tap_pkt(pkt);
> > +
>
> The device may see the tx packet and...
2023 Feb 16
0
[RFC PATCH v1 05/12] vsock/virtio: non-linear skb support
...-
> 1 file changed, 25 insertions(+), 6 deletions(-)
>
>diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
>index 28b5a8e8e094..b8a7d6dc9f46 100644
>--- a/net/vmw_vsock/virtio_transport.c
>+++ b/net/vmw_vsock/virtio_transport.c
>@@ -100,7 +100,8 @@ virtio_transport_send_pkt_work(struct work_struct *work)
> vq = vsock->vqs[VSOCK_VQ_TX];
>
> for (;;) {
>- struct scatterlist hdr, buf, *sgs[2];
>+ struct scatterlist *sgs[MAX_SKB_FRAGS + 1];
>+ struct scatterlist bufs[MAX_SKB_FRAGS + 1];
+ 1 is for the header, right?
I'd add a comment just to be c...
2023 Aug 22
0
[PATCH net-next v6 2/4] vsock/virtio: support to send non-linear skb
...1 file changed, 35 insertions(+), 6 deletions(-)
>
> diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
> index e95df847176b..7bbcc8093e51 100644
> --- a/net/vmw_vsock/virtio_transport.c
> +++ b/net/vmw_vsock/virtio_transport.c
> @@ -100,7 +100,9 @@ virtio_transport_send_pkt_work(struct work_struct *work)
> vq = vsock->vqs[VSOCK_VQ_TX];
>
> for (;;) {
> - struct scatterlist hdr, buf, *sgs[2];
> + /* +1 is for packet header. */
> + struct scatterlist *sgs[MAX_SKB_FRAGS + 1];
> + struct scatterlist bufs[MAX_SKB_FRAGS + 1];
Note that MAX_SKB_...
2019 Apr 05
2
[PATCH RFC 3/4] vsock/virtio: change the maximum packet size allowed
...kt_len = virtio_transport_get_credit(vvs, pkt_len);
>
> I think drivers/vhost/vsock.c:vhost_transport_do_send_pkt() now works
> correctly even with pkt_len > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE.
Correct.
>
> The other ->send_pkt() callback is
> net/vmw_vsock/virtio_transport.c:virtio_transport_send_pkt_work() and it
> can already send any size packet.
>
> Do you remember why VIRTIO_VSOCK_MAX_PKT_BUF_SIZE still needs to be the
> limit? I'm wondering if we can get rid of it now and just limit packets
> to the available credits.
There are 2 reasons why I left this limit:
1. When the...
2019 Apr 05
2
[PATCH RFC 3/4] vsock/virtio: change the maximum packet size allowed
...kt_len = virtio_transport_get_credit(vvs, pkt_len);
>
> I think drivers/vhost/vsock.c:vhost_transport_do_send_pkt() now works
> correctly even with pkt_len > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE.
Correct.
>
> The other ->send_pkt() callback is
> net/vmw_vsock/virtio_transport.c:virtio_transport_send_pkt_work() and it
> can already send any size packet.
>
> Do you remember why VIRTIO_VSOCK_MAX_PKT_BUF_SIZE still needs to be the
> limit? I'm wondering if we can get rid of it now and just limit packets
> to the available credits.
There are 2 reasons why I left this limit:
1. When the...
2014 Jul 05
0
[RFC V2 4/7] VSOCK: Introduce virtio-vsock.ko
...pkt = virtio_transport_alloc_pkt(vsk, info, pkt_len,
+ src_cid, src_port,
+ dst_cid, dst_port);
+ if (!pkt) {
+ virtio_transport_put_credit(trans, pkt_len);
+ return -ENOMEM;
+ }
+
+ pr_debug("%s:info->pkt_len= %d\n", __func__, info->pkt_len);
+
+ /* Will be released in virtio_transport_send_pkt_work */
+ sock_hold(&trans->vsk->sk);
+ virtio_transport_inc_tx_pkt(pkt);
+
+ /* Put pkt in the virtqueue */
+ sg_init_one(&hdr, &pkt->hdr, sizeof(pkt->hdr));
+ sgs[out_sg++] = &hdr;
+ if (info->iov && info->pkt_len > 0) {
+ sg_init_one(&buf, pkt->buf...
2015 Dec 09
0
[PATCH v3 2/4] VSOCK: Introduce virtio-vsock.ko
...{
+ mutex_lock(&vsock->tx_lock);
+ vsock->total_tx_buf -= pkt_len;
+ mutex_unlock(&vsock->tx_lock);
+ virtio_transport_put_credit(trans, pkt_len);
+ return -ENOMEM;
+ }
+
+ pr_debug("%s:info->pkt_len= %d\n", __func__, info->pkt_len);
+
+ /* Will be released in virtio_transport_send_pkt_work */
+ sock_hold(&trans->vsk->sk);
+ virtio_transport_inc_tx_pkt(pkt);
+
+ /* Put pkt in the virtqueue */
+ sg_init_one(&hdr, &pkt->hdr, sizeof(pkt->hdr));
+ sgs[out_sg++] = &hdr;
+ if (info->msg && info->pkt_len > 0) {
+ sg_init_one(&buf, pkt->buf...
2015 Dec 10
1
[PATCH v3 2/4] VSOCK: Introduce virtio-vsock.ko
...; + vsock->total_tx_buf -= pkt_len;
> + mutex_unlock(&vsock->tx_lock);
> + virtio_transport_put_credit(trans, pkt_len);
> + return -ENOMEM;
> + }
> +
> + pr_debug("%s:info->pkt_len= %d\n", __func__, info->pkt_len);
> +
> + /* Will be released in virtio_transport_send_pkt_work */
> + sock_hold(&trans->vsk->sk);
> + virtio_transport_inc_tx_pkt(pkt);
> +
> + /* Put pkt in the virtqueue */
> + sg_init_one(&hdr, &pkt->hdr, sizeof(pkt->hdr));
> + sgs[out_sg++] = &hdr;
> + if (info->msg && info->pkt_len > 0) {
&...
2015 Dec 10
1
[PATCH v3 2/4] VSOCK: Introduce virtio-vsock.ko
...; + vsock->total_tx_buf -= pkt_len;
> + mutex_unlock(&vsock->tx_lock);
> + virtio_transport_put_credit(trans, pkt_len);
> + return -ENOMEM;
> + }
> +
> + pr_debug("%s:info->pkt_len= %d\n", __func__, info->pkt_len);
> +
> + /* Will be released in virtio_transport_send_pkt_work */
> + sock_hold(&trans->vsk->sk);
> + virtio_transport_inc_tx_pkt(pkt);
> +
> + /* Put pkt in the virtqueue */
> + sg_init_one(&hdr, &pkt->hdr, sizeof(pkt->hdr));
> + sgs[out_sg++] = &hdr;
> + if (info->msg && info->pkt_len > 0) {
&...
2019 Jun 28
11
[PATCH v2 0/3] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock
before registering the driver", Stefan pointed out some possible issues
in the .probe() and .remove() callbacks of the virtio-vsock driver.
This series tries to solve these issues:
- Patch 1 adds RCU critical sections to avoid use-after-free of
'the_virtio_vsock' pointer.
- Patch 2 stops workers before to
2019 Jun 28
11
[PATCH v2 0/3] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock
before registering the driver", Stefan pointed out some possible issues
in the .probe() and .remove() callbacks of the virtio-vsock driver.
This series tries to solve these issues:
- Patch 1 adds RCU critical sections to avoid use-after-free of
'the_virtio_vsock' pointer.
- Patch 2 stops workers before to
2019 Jul 05
4
[PATCH v3 0/3] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock
before registering the driver", Stefan pointed out some possible issues
in the .probe() and .remove() callbacks of the virtio-vsock driver.
This series tries to solve these issues:
- Patch 1 adds RCU critical sections to avoid use-after-free of
'the_virtio_vsock' pointer.
- Patch 2 stops workers before to
2019 May 28
8
[PATCH 0/4] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock
before registering the driver", Stefan pointed out some possible issues
in the .probe() and .remove() callbacks of the virtio-vsock driver.
This series tries to solve these issues:
- Patch 1 postpones the 'the_virtio_vsock' assignment at the end of the
.probe() to avoid that some sockets queue works when
2019 May 28
8
[PATCH 0/4] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock
before registering the driver", Stefan pointed out some possible issues
in the .probe() and .remove() callbacks of the virtio-vsock driver.
This series tries to solve these issues:
- Patch 1 postpones the 'the_virtio_vsock' assignment at the end of the
.probe() to avoid that some sockets queue works when