lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 26 Oct 2010 14:59:33 -0700
From:	John Fastabend <john.r.fastabend@...el.com>
To:	jesse@...ira.com
Cc:	john.r.fastabend@...el.com, netdev@...r.kernel.org,
	bhutchings@...arflare.com
Subject: [RFC][net-next-2.6 PATCH v2] 8021q: set hard_header_len when VLAN
	offload features are toggled

Toggling the vlan tx|rx hw offloads needs to set the hard_header_len
as well otherwise we end up using LL_RESERVED_SPACE incorrectly.
This results in pskb_expand_head() being used unnecessarily.

This add a check in vlan_transfer_features  to catch the ETH_FLAG_TXVLAN
flag and set the header length. This requires drivers to add the
ETH_FLAG_TXVLAN to vlan_features.

Signed-off-by: John Fastabend <john.r.fastabend@...el.com>
---

 net/8021q/vlan.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 05b867e..825011b 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -334,6 +334,16 @@ static void vlan_transfer_features(struct net_device *dev,
 	vlandev->features &= ~dev->vlan_features;
 	vlandev->features |= dev->features & dev->vlan_features;
 	vlandev->gso_max_size = dev->gso_max_size;
+
+	/* is ETH_FLAGS_TXVLAN being toggled */
+	if ((vlandev->features & ETH_FLAG_TXVLAN) ^
+	    (old_features & ETH_FLAG_TXVLAN)) {
+		if (vlandev->features & ETH_FLAG_TXVLAN)
+			vlandev->hard_header_len -= VLAN_HLEN;
+		else
+			vlandev->hard_header_len += VLAN_HLEN;
+	}
+
 #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
 	vlandev->fcoe_ddp_xid = dev->fcoe_ddp_xid;
 #endif

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ