From: David Miller Subject: Re: [PATCH net] net: accept UFO datagrams from tuntap and packet Date: Sat, 18 Nov 2017 10:42:43 +0900 (KST) Message-ID: <20171118.104243.1900474824000692140.davem@davemloft.net> References: <20171117225913.46812-1-willemdebruijn.kernel@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, jasowang@redhat.com, mkubecek@suse.cz, willemb@google.com To: willemdebruijn.kernel@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:38252 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752195AbdKRBms (ORCPT ); Fri, 17 Nov 2017 20:42:48 -0500 In-Reply-To: <20171117225913.46812-1-willemdebruijn.kernel@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Willem de Bruijn Date: Fri, 17 Nov 2017 17:59:13 -0500 > Tuntap and similar devices can inject GSO packets. Accept type > VIRTIO_NET_HDR_GSO_UDP, even though not generating UFO natively. > > Processes are expected to use feature negotiation such as TUNSETOFFLOAD > to detect supported offload types and refrain from injecting other > packets. This process breaks down with live migration: guest kernels > do not renegotiate flags, so destination hosts need to expose all > features that the source host does. > > Partially revert the UFO removal from 182e0b6b5846~1..d9d30adf5677. > This patch introduces nearly(*) no new code to simplify verification. > It brings back verbatim tuntap UFO negotiation, VIRTIO_NET_HDR_GSO_UDP > insertion and software UFO segmentation. This looks good, one minor nit: > @@ -2369,6 +2369,10 @@ 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) { > + arg &= ~TUN_F_UFO; > + } This can be just simply "arg &= ~TUN_F_UFO;"? If anything the curly braces should be removed for a single statement basic block. Thanks for working so hard on fixing this.