Displaying 20 results from an estimated 159 matches for "pkt_len".
2019 Apr 05
2
[PATCH RFC 3/4] vsock/virtio: change the maximum packet size allowed
...ec 100644
> > --- a/net/vmw_vsock/virtio_transport_common.c
> > +++ b/net/vmw_vsock/virtio_transport_common.c
> > @@ -167,8 +167,8 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
> > vvs = vsk->trans;
> >
> > /* we can send less than pkt_len bytes */
> > - if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
> > - pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
> > + if (pkt_len > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE)
> > + pkt_len = VIRTIO_VSOCK_MAX_PKT_BUF_SIZE;
>
> The next line limits pkt_len based on availab...
2019 Apr 05
2
[PATCH RFC 3/4] vsock/virtio: change the maximum packet size allowed
...ec 100644
> > --- a/net/vmw_vsock/virtio_transport_common.c
> > +++ b/net/vmw_vsock/virtio_transport_common.c
> > @@ -167,8 +167,8 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
> > vvs = vsk->trans;
> >
> > /* we can send less than pkt_len bytes */
> > - if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
> > - pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
> > + if (pkt_len > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE)
> > + pkt_len = VIRTIO_VSOCK_MAX_PKT_BUF_SIZE;
>
> The next line limits pkt_len based on availab...
2019 Apr 04
1
[PATCH RFC 3/4] vsock/virtio: change the maximum packet size allowed
...ock/virtio_transport_common.c
index f32301d823f5..822e5d07a4ec 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -167,8 +167,8 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
vvs = vsk->trans;
/* we can send less than pkt_len bytes */
- if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
- pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
+ if (pkt_len > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE)
+ pkt_len = VIRTIO_VSOCK_MAX_PKT_BUF_SIZE;
/* virtio_transport_get_credit might return less than pkt_len credit */
pkt_len = virtio_t...
2019 Aug 01
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...function allocates a new packet, copying
the user message, but (before this series) it limits the packet size to
the VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE (4K):
static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
struct virtio_vsock_pkt_info *info)
{
...
/* we can send less than pkt_len bytes */
if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
/* virtio_transport_get_credit might return less than pkt_len credit */
pkt_len = virtio_transport_get_credit(vvs, pkt_len);
/* Do not send zero length OP_RW pkt */
if (pkt_len == 0 &...
2019 Aug 01
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...function allocates a new packet, copying
the user message, but (before this series) it limits the packet size to
the VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE (4K):
static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
struct virtio_vsock_pkt_info *info)
{
...
/* we can send less than pkt_len bytes */
if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
/* virtio_transport_get_credit might return less than pkt_len credit */
pkt_len = virtio_transport_get_credit(vvs, pkt_len);
/* Do not send zero length OP_RW pkt */
if (pkt_len == 0 &...
2023 Mar 21
0
[RFC PATCH v3] virtio/vsock: allocate multiple skbuffs on tx
...0b2c6ecbe22 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 +217,6 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
>
> vvs = vsk->trans;
>
>- /* we can...
2023 Mar 22
0
[RFC PATCH v4] virtio/vsock: allocate multiple skbuffs on tx
...300f25749ea 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 +217,6 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
>
> vvs = vsk->trans;
>
>- /* we can...
2019 Aug 01
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...e this series) it limits the packet size to
> > the VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE (4K):
> >
> > static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
> > struct virtio_vsock_pkt_info *info)
> > {
> > ...
> > /* we can send less than pkt_len bytes */
> > if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
> > pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
> >
> > /* virtio_transport_get_credit might return less than pkt_len credit */
> > pkt_len = virtio_transport_get_credit(vvs, pkt_len);
> >
>...
2019 Aug 01
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...e this series) it limits the packet size to
> > the VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE (4K):
> >
> > static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
> > struct virtio_vsock_pkt_info *info)
> > {
> > ...
> > /* we can send less than pkt_len bytes */
> > if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
> > pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
> >
> > /* virtio_transport_get_credit might return less than pkt_len credit */
> > pkt_len = virtio_transport_get_credit(vvs, pkt_len);
> >
>...
2023 Mar 21
0
[RFC PATCH v2] virtio/vsock: allocate multiple skbuffs on tx
...ransport_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 +217,6 @@ static int virtio_transport_send_pkt_info(stru...
2019 Sep 01
3
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...RTIO_VSOCK_DEFAULT_RX_BUF_SIZE (4K):
> > > >
> > > > static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
> > > > struct virtio_vsock_pkt_info *info)
> > > > {
> > > > ...
> > > > /* we can send less than pkt_len bytes */
> > > > if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
> > > > pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
> > > >
> > > > /* virtio_transport_get_credit might return less than pkt_len credit */
> > > > pkt_len = virtio_...
2019 Sep 01
3
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...RTIO_VSOCK_DEFAULT_RX_BUF_SIZE (4K):
> > > >
> > > > static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
> > > > struct virtio_vsock_pkt_info *info)
> > > > {
> > > > ...
> > > > /* we can send less than pkt_len bytes */
> > > > if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
> > > > pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
> > > >
> > > > /* virtio_transport_get_credit might return less than pkt_len credit */
> > > > pkt_len = virtio_...
2019 Apr 05
0
[PATCH RFC 3/4] vsock/virtio: change the maximum packet size allowed
...index f32301d823f5..822e5d07a4ec 100644
> --- a/net/vmw_vsock/virtio_transport_common.c
> +++ b/net/vmw_vsock/virtio_transport_common.c
> @@ -167,8 +167,8 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
> vvs = vsk->trans;
>
> /* we can send less than pkt_len bytes */
> - if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
> - pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
> + if (pkt_len > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE)
> + pkt_len = VIRTIO_VSOCK_MAX_PKT_BUF_SIZE;
The next line limits pkt_len based on available credits:
/* virtio_trans...
2015 Dec 09
0
[PATCH v3 2/4] VSOCK: Introduce virtio-vsock.ko
...sock *vsk,
+ struct virtio_vsock_pkt_info *info)
+{
+ u32 src_cid, src_port, dst_cid, dst_port;
+ int ret, in_sg = 0, out_sg = 0;
+ struct virtio_transport *trans;
+ struct virtio_vsock_pkt *pkt;
+ struct virtio_vsock *vsock;
+ struct scatterlist hdr, buf, *sgs[2];
+ struct virtqueue *vq;
+ u32 pkt_len = info->pkt_len;
+ DEFINE_WAIT(wait);
+
+ vsock = virtio_vsock_get();
+ if (!vsock)
+ return -ENODEV;
+
+ src_cid = virtio_transport_get_local_cid();
+ src_port = vsk->local_addr.svm_port;
+ if (!info->remote_cid) {
+ dst_cid = vsk->remote_addr.svm_cid;
+ dst_port = vsk->remote_ad...
2019 Apr 08
0
[PATCH RFC 3/4] vsock/virtio: change the maximum packet size allowed
.../net/vmw_vsock/virtio_transport_common.c
> > > +++ b/net/vmw_vsock/virtio_transport_common.c
> > > @@ -167,8 +167,8 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
> > > vvs = vsk->trans;
> > >
> > > /* we can send less than pkt_len bytes */
> > > - if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
> > > - pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
> > > + if (pkt_len > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE)
> > > + pkt_len = VIRTIO_VSOCK_MAX_PKT_BUF_SIZE;
> >
> > The next line l...
2014 Jul 05
0
[RFC V2 4/7] VSOCK: Introduce virtio-vsock.ko
...sock *vsk,
+ struct virtio_vsock_pkt_info *info)
+{
+ u32 src_cid, src_port, dst_cid, dst_port;
+ int ret, in_sg = 0, out_sg = 0;
+ struct virtio_transport *trans;
+ struct virtio_vsock_pkt *pkt;
+ struct virtio_vsock *vsock;
+ struct scatterlist hdr, buf, *sgs[2];
+ struct virtqueue *vq;
+ u32 pkt_len = info->pkt_len;
+ DEFINE_WAIT(wait);
+
+ vsock = virtio_vsock_get();
+ if (!vsock)
+ return -ENODEV;
+
+ src_cid = virtio_transport_get_local_cid();
+ src_port = vsk->local_addr.svm_port;
+ if (!info->remote_cid) {
+ dst_cid = vsk->remote_addr.svm_cid;
+ dst_port = vsk->remote_ad...
2018 Dec 12
0
[PATCH v2 4/5] VSOCK: increase send pkt len in mergeable mode to improve performance
...gt;mrg_rxbuf_hdr.num_buffers = cpu_to_le16(headcount);
nbytes = copy_to_iter(&pkt->hdr, vsock_hlen, &iov_iter);
if (nbytes != vsock_hlen) {
@@ -303,6 +303,22 @@ static void vhost_transport_send_pkt_work(struct vhost_work *work)
return len;
}
+static u32
+vhost_transport_get_max_pkt_len(u32 guest_cid)
+{
+ int len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
+ struct vhost_vsock *vsock;
+
+ vsock = vhost_vsock_get(guest_cid);
+ if (!vsock)
+ return len;
+
+ if (vsock->mergeable)
+ len = VIRTIO_VSOCK_MAX_PKT_BUF_SIZE;
+
+ return len;
+}
+
static int
vhost_transport_cancel_pkt(struct...
2015 Dec 11
1
[PATCH v3 3/4] VSOCK: Introduce vhost-vsock.ko
...ansport_send_pkt(struct vsock_sock *vsk,
> + struct virtio_vsock_pkt_info *info)
> +{
> + u32 src_cid, src_port, dst_cid, dst_port;
> + struct virtio_transport *trans;
> + struct virtio_vsock_pkt *pkt;
> + struct vhost_virtqueue *vq;
> + struct vhost_vsock *vsock;
> + u32 pkt_len = info->pkt_len;
> + DEFINE_WAIT(wait);
> +
> + src_cid = vhost_transport_get_local_cid();
> + src_port = vsk->local_addr.svm_port;
> + if (!info->remote_cid) {
> + dst_cid = vsk->remote_addr.svm_cid;
> + dst_port = vsk->remote_addr.svm_port;
> + } else {
&g...
2015 Dec 11
1
[PATCH v3 3/4] VSOCK: Introduce vhost-vsock.ko
...ansport_send_pkt(struct vsock_sock *vsk,
> + struct virtio_vsock_pkt_info *info)
> +{
> + u32 src_cid, src_port, dst_cid, dst_port;
> + struct virtio_transport *trans;
> + struct virtio_vsock_pkt *pkt;
> + struct vhost_virtqueue *vq;
> + struct vhost_vsock *vsock;
> + u32 pkt_len = info->pkt_len;
> + DEFINE_WAIT(wait);
> +
> + src_cid = vhost_transport_get_local_cid();
> + src_port = vsk->local_addr.svm_port;
> + if (!info->remote_cid) {
> + dst_cid = vsk->remote_addr.svm_cid;
> + dst_port = vsk->remote_addr.svm_port;
> + } else {
&g...
2019 Jul 17
0
[PATCH v4 5/5] vsock/virtio: change the maximum packet size allowed
...ock/virtio_transport_common.c
index 56fab3f03d0e..94cc0fa3e848 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -181,8 +181,8 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
vvs = vsk->trans;
/* we can send less than pkt_len bytes */
- if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
- pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
+ if (pkt_len > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE)
+ pkt_len = VIRTIO_VSOCK_MAX_PKT_BUF_SIZE;
/* virtio_transport_get_credit might return less than pkt_len credit */
pkt_len = virtio_t...