Patch "tuntap: set transport header before passing it to kernel" has been added to the 3.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tuntap: set transport header before passing it to kernel

to the 3.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tuntap-set-transport-header-before-passing-it-to-kernel.patch
and it can be found in the queue-3.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From b8d36d82fe14dc012f0ada08a1046c1053fa6504 Mon Sep 17 00:00:00 2001
From: Jason Wang <jasowang@xxxxxxxxxx>
Date: Mon, 25 Mar 2013 20:19:56 +0000
Subject: tuntap: set transport header before passing it to kernel

From: Jason Wang <jasowang@xxxxxxxxxx>

[ Upstream commit 38502af77e07b5d6650b9ff99a0b482d86366592 ]

Currently, for the packets receives from tuntap, before doing header check,
kernel just reset the transport header in netif_receive_skb() which pretends no
l4 header. This is suboptimal for precise packet length estimation (introduced
in 1def9238) which needs correct l4 header for gso packets.

So this patch set the transport header to csum_start for partial checksum
packets, otherwise it first try skb_flow_dissect(), if it fails, just reset the
transport header.

Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx>
Cc: Eric Dumazet <edumazet@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/net/tun.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -70,6 +70,7 @@
 #include <net/sock.h>
 
 #include <asm/uaccess.h>
+#include <net/flow_keys.h>
 
 /* Uncomment to enable debugging */
 /* #define TUN_DEBUG 1 */
@@ -1051,6 +1052,7 @@ static ssize_t tun_get_user(struct tun_s
 	bool zerocopy = false;
 	int err;
 	u32 rxhash;
+	struct flow_keys keys;
 
 	if (!(tun->flags & TUN_NO_PI)) {
 		if ((len -= sizeof(pi)) > total_len)
@@ -1205,6 +1207,14 @@ static ssize_t tun_get_user(struct tun_s
 	}
 
 	skb_reset_network_header(skb);
+
+	if (skb->ip_summed == CHECKSUM_PARTIAL)
+		skb_set_transport_header(skb, skb_checksum_start_offset(skb));
+	else if (skb_flow_dissect(skb, &keys))
+		skb_set_transport_header(skb, keys.thoff);
+	else
+		skb_reset_transport_header(skb);
+
 	rxhash = skb_get_rxhash(skb);
 	netif_rx_ni(skb);
 


Patches currently in stable-queue which might be from jasowang@xxxxxxxxxx are

queue-3.9/tuntap-forbid-changing-mq-flag-for-persistent-device.patch
queue-3.9/packet-set-transport-header-before-doing-xmit.patch
queue-3.9/netback-set-transport-header-before-passing-it-to-kernel.patch
queue-3.9/net_sched-better-precise-estimation-on-packet-length-for-untrusted-packets.patch
queue-3.9/tuntap-set-sock_zerocopy-flag-during-open.patch
queue-3.9/tuntap-set-transport-header-before-passing-it-to-kernel.patch
queue-3.9/tuntap-correct-the-return-value-in-tun_set_iff.patch
queue-3.9/macvtap-set-transport-header-before-passing-skb-to-lower-device.patch
queue-3.9/vhost_net-clear-msg.control-for-non-zerocopy-case-during-tx.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]