Displaying 20 results from an estimated 74 matches for "tun_put_us".
Did you mean:
tun_put_user
2014 Dec 18
2
[PATCH 08/10] tun: Re-uanble UFO support.
...; + * Do not change the gso_type as it may
> + * not be upderstood by legacy applications.
> + */
Isn't this an issue that we use SKB_GSO_UDP for a UDPv6 packet? Especially
consider we want to fix UFOv6 in the future? We probably can use
SKB_GSO_UDP6 here and try to fix it in tun_put_user() if a legacy userspace
is detected.
> ipv6_proxy_select_ident(skb);
Question still for vlan, is network header correctly set here? Looks like
ipv6_proxy_select_ident() depends on correct network header to work.
> + }
> break;
> - }
> default:
> tun->dev-&...
2014 Dec 18
2
[PATCH 08/10] tun: Re-uanble UFO support.
...; + * Do not change the gso_type as it may
> + * not be upderstood by legacy applications.
> + */
Isn't this an issue that we use SKB_GSO_UDP for a UDPv6 packet? Especially
consider we want to fix UFOv6 in the future? We probably can use
SKB_GSO_UDP6 here and try to fix it in tun_put_user() if a legacy userspace
is detected.
> ipv6_proxy_select_ident(skb);
Question still for vlan, is network header correctly set here? Looks like
ipv6_proxy_select_ident() depends on correct network header to work.
> + }
> break;
> - }
> default:
> tun->dev-&...
2014 Feb 13
2
[PATCH net] virtio-net: alloc big buffers also when guest can receive UFO
...be truncated when mergeable rx
>> > buffer is disabled.
> Not truncated, they will be dropped.
>
Why dropped? We enable the ufo on tap0 if VIRTIO_NET_F_GUEST_UFO is
negotiated. So skb was queued on the receive queue. But since the
receive buffer is small, it will be truncated during tun_put_user().
2014 Feb 13
2
[PATCH net] virtio-net: alloc big buffers also when guest can receive UFO
...be truncated when mergeable rx
>> > buffer is disabled.
> Not truncated, they will be dropped.
>
Why dropped? We enable the ufo on tap0 if VIRTIO_NET_F_GUEST_UFO is
negotiated. So skb was queued on the receive queue. But since the
receive buffer is small, it will be truncated during tun_put_user().
2014 Oct 23
0
[PATCH RFC] tun: fix sparse warnings for virtio headers
...;gso_type |= SKB_GSO_TCP_ECN;
- skb_shinfo(skb)->gso_size = gso.gso_size;
+ skb_shinfo(skb)->gso_size = __virtio16_to_cpu(false, gso.gso_size);
if (skb_shinfo(skb)->gso_size == 0) {
tun->dev->stats.rx_frame_errors++;
kfree_skb(skb);
@@ -1245,8 +1245,8 @@ static ssize_t tun_put_user(struct tun_struct *tun,
struct skb_shared_info *sinfo = skb_shinfo(skb);
/* This is a hint as to how much should be linear. */
- gso.hdr_len = skb_headlen(skb);
- gso.gso_size = sinfo->gso_size;
+ gso.hdr_len = __cpu_to_virtio16(false, skb_headlen(skb));
+ gso.gso_size = __cp...
2014 Oct 23
0
[PATCH RFC] tun: fix sparse warnings for virtio headers
...;gso_type |= SKB_GSO_TCP_ECN;
- skb_shinfo(skb)->gso_size = gso.gso_size;
+ skb_shinfo(skb)->gso_size = __virtio16_to_cpu(false, gso.gso_size);
if (skb_shinfo(skb)->gso_size == 0) {
tun->dev->stats.rx_frame_errors++;
kfree_skb(skb);
@@ -1245,8 +1245,8 @@ static ssize_t tun_put_user(struct tun_struct *tun,
struct skb_shared_info *sinfo = skb_shinfo(skb);
/* This is a hint as to how much should be linear. */
- gso.hdr_len = skb_headlen(skb);
- gso.gso_size = sinfo->gso_size;
+ gso.hdr_len = __cpu_to_virtio16(false, skb_headlen(skb));
+ gso.gso_size = __cp...
2014 Dec 18
0
[PATCH 08/10] tun: Re-uanble UFO support.
...gso_type as it may
>> + * not be upderstood by legacy applications.
>> + */
>
> Isn't this an issue that we use SKB_GSO_UDP for a UDPv6 packet? Especially
> consider we want to fix UFOv6 in the future? We probably can use
> SKB_GSO_UDP6 here and try to fix it in tun_put_user() if a legacy userspace
> is detected.
There is a slight problem with this. This will force fragmentation of IPv6
traffic between VMs since UFO6 wouldn't be enabled on a destination device.
So, suddenly older VMs will see a performance regression for large UDPv6 traffic.
With this code,...
2014 Dec 18
0
[PATCH 08/10] tun: Re-uanble UFO support.
...gso_type as it may
>> + * not be upderstood by legacy applications.
>> + */
>
> Isn't this an issue that we use SKB_GSO_UDP for a UDPv6 packet? Especially
> consider we want to fix UFOv6 in the future? We probably can use
> SKB_GSO_UDP6 here and try to fix it in tun_put_user() if a legacy userspace
> is detected.
There is a slight problem with this. This will force fragmentation of IPv6
traffic between VMs since UFO6 wouldn't be enabled on a destination device.
So, suddenly older VMs will see a performance regression for large UDPv6 traffic.
With this code,...
2017 Jan 20
4
[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
..._endian(q)))
+ macvtap_is_little_endian(q), true))
BUG();
if (copy_to_iter(&vnet_hdr, sizeof(vnet_hdr), iter) !=
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index cd8e02c..2cd10b2 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1360,7 +1360,7 @@ static ssize_t tun_put_user(struct tun_struct *tun,
return -EINVAL;
if (virtio_net_hdr_from_skb(skb, &gso,
- tun_is_little_endian(tun))) {
+ tun_is_little_endian(tun), true)) {
struct skb_shared_info *sinfo = skb_shinfo(skb);
pr_err("unexpected GSO type: "
"0x%x...
2017 Jan 20
4
[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
..._endian(q)))
+ macvtap_is_little_endian(q), true))
BUG();
if (copy_to_iter(&vnet_hdr, sizeof(vnet_hdr), iter) !=
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index cd8e02c..2cd10b2 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1360,7 +1360,7 @@ static ssize_t tun_put_user(struct tun_struct *tun,
return -EINVAL;
if (virtio_net_hdr_from_skb(skb, &gso,
- tun_is_little_endian(tun))) {
+ tun_is_little_endian(tun), true)) {
struct skb_shared_info *sinfo = skb_shinfo(skb);
pr_err("unexpected GSO type: "
"0x%x...
2017 Jan 22
2
[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
...G();
>>
>> if (copy_to_iter(&vnet_hdr, sizeof(vnet_hdr), iter) !=
>> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
>> index cd8e02c..2cd10b2 100644
>> --- a/drivers/net/tun.c
>> +++ b/drivers/net/tun.c
>> @@ -1360,7 +1360,7 @@ static ssize_t tun_put_user(struct tun_struct *tun,
>> return -EINVAL;
>>
>> if (virtio_net_hdr_from_skb(skb, &gso,
>> - tun_is_little_endian(tun))) {
>> + tun_is_little_endian(tun), true)) {
>> struct skb_shared_info *sinfo = skb_shinfo(skb);
>>...
2017 Jan 22
2
[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
...G();
>>
>> if (copy_to_iter(&vnet_hdr, sizeof(vnet_hdr), iter) !=
>> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
>> index cd8e02c..2cd10b2 100644
>> --- a/drivers/net/tun.c
>> +++ b/drivers/net/tun.c
>> @@ -1360,7 +1360,7 @@ static ssize_t tun_put_user(struct tun_struct *tun,
>> return -EINVAL;
>>
>> if (virtio_net_hdr_from_skb(skb, &gso,
>> - tun_is_little_endian(tun))) {
>> + tun_is_little_endian(tun), true)) {
>> struct skb_shared_info *sinfo = skb_shinfo(skb);
>>...
2011 Jun 10
1
[PATCH] virtio_net: introduce VIRTIO_NET_HDR_F_DATA_VALID
...CHECKSUM_UNNECESSARY) {
+ vnet_hdr->flags = VIRTIO_NET_HDR_F_DATA_VALID;
} /* else everything is zero */
return 0;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 74e9405..f43fa45 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -788,6 +788,8 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
gso.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
gso.csum_start = skb_checksum_start_offset(skb);
gso.csum_offset = skb->csum_offset;
+ } else if (skb->ip_summed == CHECKSUM_UNNECESSARY) {
+ gso.flags = VIRTIO_NET_HDR_F_DATA_VALID;
} /* else everything is z...
2011 Jun 10
1
[PATCH] virtio_net: introduce VIRTIO_NET_HDR_F_DATA_VALID
...CHECKSUM_UNNECESSARY) {
+ vnet_hdr->flags = VIRTIO_NET_HDR_F_DATA_VALID;
} /* else everything is zero */
return 0;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 74e9405..f43fa45 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -788,6 +788,8 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
gso.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
gso.csum_start = skb_checksum_start_offset(skb);
gso.csum_offset = skb->csum_offset;
+ } else if (skb->ip_summed == CHECKSUM_UNNECESSARY) {
+ gso.flags = VIRTIO_NET_HDR_F_DATA_VALID;
} /* else everything is z...
2009 Nov 04
0
[PATCHv8 1/3] tun: export underlying socket
...s & TUN_FASYNC)
kill_fasync(&tun->fasync, SIGIO, POLL_IN);
- wake_up_interruptible(&tun->socket.wait);
+ wake_up_interruptible_poll(&tun->socket.wait, POLLIN |
+ POLLRDNORM | POLLRDBAND);
return NETDEV_TX_OK;
drop:
@@ -743,7 +746,7 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
len = min_t(int, skb->len, len);
skb_copy_datagram_const_iovec(skb, 0, iv, total, len);
- total += len;
+ total += skb->len;
tun->dev->stats.tx_packets++;
tun->dev->stats.tx_bytes += len;
@@ -751,34 +754,23 @@ static __inline__ ssize_t tun_put...
2009 Nov 04
0
[PATCHv8 1/3] tun: export underlying socket
...s & TUN_FASYNC)
kill_fasync(&tun->fasync, SIGIO, POLL_IN);
- wake_up_interruptible(&tun->socket.wait);
+ wake_up_interruptible_poll(&tun->socket.wait, POLLIN |
+ POLLRDNORM | POLLRDBAND);
return NETDEV_TX_OK;
drop:
@@ -743,7 +746,7 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
len = min_t(int, skb->len, len);
skb_copy_datagram_const_iovec(skb, 0, iv, total, len);
- total += len;
+ total += skb->len;
tun->dev->stats.tx_packets++;
tun->dev->stats.tx_bytes += len;
@@ -751,34 +754,23 @@ static __inline__ ssize_t tun_put...
2009 Nov 03
1
[PATCHv7 1/3] tun: export underlying socket
...s & TUN_FASYNC)
kill_fasync(&tun->fasync, SIGIO, POLL_IN);
- wake_up_interruptible(&tun->socket.wait);
+ wake_up_interruptible_poll(&tun->socket.wait, POLLIN |
+ POLLRDNORM | POLLRDBAND);
return NETDEV_TX_OK;
drop:
@@ -743,7 +746,7 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
len = min_t(int, skb->len, len);
skb_copy_datagram_const_iovec(skb, 0, iv, total, len);
- total += len;
+ total += skb->len;
tun->dev->stats.tx_packets++;
tun->dev->stats.tx_bytes += len;
@@ -751,34 +754,23 @@ static __inline__ ssize_t tun_put...
2009 Nov 03
1
[PATCHv7 1/3] tun: export underlying socket
...s & TUN_FASYNC)
kill_fasync(&tun->fasync, SIGIO, POLL_IN);
- wake_up_interruptible(&tun->socket.wait);
+ wake_up_interruptible_poll(&tun->socket.wait, POLLIN |
+ POLLRDNORM | POLLRDBAND);
return NETDEV_TX_OK;
drop:
@@ -743,7 +746,7 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
len = min_t(int, skb->len, len);
skb_copy_datagram_const_iovec(skb, 0, iv, total, len);
- total += len;
+ total += skb->len;
tun->dev->stats.tx_packets++;
tun->dev->stats.tx_bytes += len;
@@ -751,34 +754,23 @@ static __inline__ ssize_t tun_put...
2017 Nov 30
2
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
...ug("Discarded rx packet: "
>> " len %d, expected %zd\n", err, sock_len);
>> vhost_discard_vq_desc(vq, headcount);
>> + kfree_skb((struct sk_buff *)msg.msg_control);
> You do not need a cast here.
>
> Also, we have
>
> ret = tun_put_user(tun, tfile, skb, to);
> if (unlikely(ret < 0))
> kfree_skb(skb);
> else
> consume_skb(skb);
>
> return ret;
>
> So it looks like recvmsg actually always consumes the skb.
> So I was wrong when I said you ne...
2017 Nov 30
2
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
...ug("Discarded rx packet: "
>> " len %d, expected %zd\n", err, sock_len);
>> vhost_discard_vq_desc(vq, headcount);
>> + kfree_skb((struct sk_buff *)msg.msg_control);
> You do not need a cast here.
>
> Also, we have
>
> ret = tun_put_user(tun, tfile, skb, to);
> if (unlikely(ret < 0))
> kfree_skb(skb);
> else
> consume_skb(skb);
>
> return ret;
>
> So it looks like recvmsg actually always consumes the skb.
> So I was wrong when I said you ne...