Thread (5 messages) flat view 5 messages, 3 authors, 2017-11-20

Re: [PATCH net] net: accept UFO datagrams from tuntap and packet

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2017-11-19 00:58:57

On Fri, Nov 17, 2017 at 8:42 PM, David Miller [off-list ref] wrote:
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Fri, 17 Nov 2017 17:59:13 -0500
quoted
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:
quoted
@@ -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.
Okay, I'll fix that up in v2. At least for the initial version I wanted
to make as few changes as possible to the original code.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help