From: Jason Wang <jasowang@redhat.com>
To: vyasevic@redhat.com
Cc: mst@redhat.com, netdev@vger.kernel.org,
Vladislav Yasevich <vyasevich@gmail.com>,
virtualization@lists.linux-foundation.org, stefanha@redhat.com,
ben@decadent.org.uk
Subject: Re: [PATCH 08/10] tun: Re-uanble UFO support.
Date: Fri, 19 Dec 2014 04:45:36 +0008 [thread overview]
Message-ID: <1418963856.8471.1@smtp.corp.redhat.com> (raw)
In-Reply-To: <5492EEDE.5050000@redhat.com>
On Thu, Dec 18, 2014 at 11:12 PM, Vlad Yasevich <vyasevic@redhat.com>
wrote:
> On 12/18/2014 12:51 AM, Jason Wang wrote:
>>
>>
>> ----- Original Message -----
>>> Now that UFO is split into v4 and v6 parts, we can bring
>>> back v4 support without any trouble.
>>>
>>> Continue to handle legacy applications by selecting the
>>> IPv6 fragment id but do not change the gso type. Thist
>>> makes sure that two legacy VMs may still communicate.
>>>
>>> Based on original work from Ben Hutchings.
>>>
>>> Fixes: 88e0e0e5aa7a ("drivers/net: Disable UFO through virtio")
>>> CC: Ben Hutchings <ben@decadent.org.uk>
>>> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
>>> ---
>>> drivers/net/tun.c | 26 ++++++++++++++------------
>>> 1 file changed, 14 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
>>> index 9dd3746..8c32fca 100644
>>> --- a/drivers/net/tun.c
>>> +++ b/drivers/net/tun.c
>>> @@ -175,7 +175,7 @@ struct tun_struct {
>>> struct net_device *dev;
>>> netdev_features_t set_features;
>>> #define TUN_USER_FEATURES
>>> (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO| \
>>> - NETIF_F_TSO6)
>>> + NETIF_F_TSO6|NETIF_F_UFO)
>>>
>>> int vnet_hdr_sz;
>>> int sndbuf;
>>> @@ -1152,20 +1152,15 @@ static ssize_t tun_get_user(struct
>>> tun_struct *tun,
>>> struct tun_file *tfile,
>>> skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6;
>>> break;
>>> case VIRTIO_NET_HDR_GSO_UDP:
>>> - {
>>> - static bool warned;
>>> -
>>> - if (!warned) {
>>> - warned = true;
>>> - netdev_warn(tun->dev,
>>> - "%s: using disabled UFO feature; please fix this
>>> program\n",
>>> - current->comm);
>>> - }
>>> skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
>>> - if (skb->protocol == htons(ETH_P_IPV6))
>>> + if (vlan_get_protocol(skb) == htons(ETH_P_IPV6)) {
>>
>> This probably means UDPv6 with vlan does not work well, looks like
>> another
>> independent fixe and also for stable.
>
> Ok. I can split this out.
>
>>> + /* This allows legacy application to work.
>>> + * 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.
>
> 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, a legacy VM will continue to receive large UDPv6
> traffic.
> New VMs will have an updated virtio-net which will reset the gso type
> on input.
I get the point and that's why you still want ipv6 offload helpers to
accept SKB_GSO_UDP. So SKB_GSO_UDP was still ambigious since it can be a
UDP6 packet in fact.
I'm not sure, but probably we could just leave the regression of legacy
guest as is and fix current kernel. The sooner we eliminate the
ambigious
the better for future development.
>
>
>>> 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.
>>> +
>
> Yes, you are right... I wonder how that worked. I'll re-test.
>
> Thanks
> -vlad
> }
>>> break;
>>> - }
>>> default:
>>> tun->dev->stats.rx_frame_errors++;
>>> kfree_skb(skb);
>>> @@ -1273,6 +1268,8 @@ static ssize_t tun_put_user(struct
>>> tun_struct *tun,
>>> gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
>>> else if (sinfo->gso_type & SKB_GSO_TCPV6)
>>> gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
>>> + else if (sinfo->gso_type & SKB_GSO_UDP)
>>> + gso.gso_type = VIRTIO_NET_HDR_GSO_UDP;
>>> else {
>>> pr_err("unexpected GSO type: "
>>> "0x%x, gso_size %d, hdr_len %d\n",
>>> @@ -1780,6 +1777,11 @@ static int set_offload(struct tun_struct
>>> *tun,
>>> unsigned long arg)
>>> features |= NETIF_F_TSO6;
>>> arg &= ~(TUN_F_TSO4|TUN_F_TSO6);
>>> }
>>> +
>>> + if (arg & TUN_F_UFO) {
>>> + features |= NETIF_F_UFO;
>>> + arg &= ~TUN_F_UFO;
>>> + }
>>> }
>>>
>>> /* This gives the user a way to test for new features in future
>>> by
>>> --
>>> 1.9.3
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe netdev"
>>> in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>
>
next prev parent reply other threads:[~2014-12-19 4:37 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 18:20 [PATCH 00/10] Split UFO into v4 and v6 versions Vladislav Yasevich
2014-12-17 18:20 ` [PATCH 01/10] core: Split out UFO6 support Vladislav Yasevich
2014-12-17 18:20 ` [PATCH 02/10] net: Correctly mark IPv6 UFO offload type Vladislav Yasevich
2014-12-17 18:20 ` [PATCH 03/10] ovs: Enable handling of UFO6 packets Vladislav Yasevich
2014-12-17 20:17 ` Sergei Shtylyov
2014-12-17 20:44 ` Vlad Yasevich
2014-12-17 22:26 ` Michael S. Tsirkin
2014-12-17 18:20 ` [PATCH 04/10] loopback: Turn on UFO6 support Vladislav Yasevich
2014-12-17 18:20 ` [PATCH 05/10] veth: Enable " Vladislav Yasevich
2014-12-17 18:20 ` [PATCH 06/10] macvlan: " Vladislav Yasevich
2014-12-17 18:20 ` [PATCH 07/10] s2io: " Vladislav Yasevich
2014-12-17 18:20 ` [PATCH 08/10] tun: Re-uanble UFO support Vladislav Yasevich
2014-12-17 18:20 ` [PATCH 09/10] macvtap: Re-enable " Vladislav Yasevich
2014-12-17 18:20 ` [PATCH 10/10] Revert "drivers/net: Disable UFO through virtio" Vladislav Yasevich
[not found] ` <1418840455-22598-2-git-send-email-vyasevic@redhat.com>
2014-12-17 20:10 ` [PATCH 01/10] core: Split out UFO6 support Ben Hutchings
[not found] ` <1418847039.30883.29.camel@decadent.org.uk>
2014-12-17 20:43 ` Vlad Yasevich
2014-12-17 22:45 ` Michael S. Tsirkin
2014-12-17 23:31 ` Vlad Yasevich
2014-12-18 7:54 ` Michael S. Tsirkin
2014-12-18 15:01 ` Vlad Yasevich
2014-12-18 17:35 ` Michael S. Tsirkin
2014-12-18 17:50 ` Michael S. Tsirkin
2014-12-19 20:13 ` Vlad Yasevich
2014-12-20 21:03 ` Michael S. Tsirkin
2014-12-22 4:06 ` Vlad Yasevich
2014-12-19 19:55 ` Vlad Yasevich
[not found] ` <1418840455-22598-10-git-send-email-vyasevic@redhat.com>
2014-12-17 22:41 ` [PATCH 09/10] macvtap: Re-enable UFO support Michael S. Tsirkin
2014-12-18 2:43 ` Vlad Yasevich
2014-12-18 7:55 ` Michael S. Tsirkin
2014-12-18 15:15 ` Vlad Yasevich
[not found] ` <1418840455-22598-11-git-send-email-vyasevic@redhat.com>
2014-12-17 22:44 ` [PATCH 10/10] Revert "drivers/net: Disable UFO through virtio" Michael S. Tsirkin
2014-12-18 5:28 ` [PATCH 00/10] Split UFO into v4 and v6 versions Jason Wang
[not found] ` <1418840455-22598-9-git-send-email-vyasevic@redhat.com>
2014-12-17 22:33 ` [PATCH 08/10] tun: Re-uanble UFO support Michael S. Tsirkin
2014-12-18 5:51 ` Jason Wang
2014-12-18 15:12 ` Vlad Yasevich
2014-12-19 4:37 ` Jason Wang [this message]
[not found] ` <586203981.237162.1418880532523.JavaMail.zimbra@redhat.com>
2014-12-24 18:11 ` [PATCH 00/10] Split UFO into v4 and v6 versions Ben Hutchings
2014-12-24 18:59 ` Michael S. Tsirkin
2014-12-25 3:02 ` Jason Wang
2014-12-25 7:14 ` Michael S. Tsirkin
2014-12-25 9:50 ` Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1418963856.8471.1@smtp.corp.redhat.com \
--to=jasowang@redhat.com \
--cc=ben@decadent.org.uk \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=vyasevic@redhat.com \
--cc=vyasevich@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).