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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon,  2 Mar 2015 18:40:15 +0100
From:	Florian Westphal <fw@...len.de>
To:	<netdev@...r.kernel.org>
Cc:	Florian Westphal <fw@...len.de>
Subject: [PATCH RFC 01/14] net: gro: shrink napi_gro_cb to fit into hypothetical 44-byte sized skb cb

>From 48 down to 42 bytes using reordering + bitfields.

Signed-off-by: Florian Westphal <fw@...len.de>
---
 include/linux/netdevice.h | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5897b4e..7427185 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1914,8 +1914,11 @@ struct napi_gro_cb {
 	/* This indicates where we are processing relative to skb->data. */
 	int data_offset;
 
-	/* This is non-zero if the packet cannot be merged with the new skb. */
-	u16	flush;
+	/* used in skb_gro_receive() slow path */
+	struct sk_buff *last;
+
+	/* Used in ipv6_gro_receive() and foo-over-udp */
+	u16	proto;
 
 	/* Save the IP ID here and check when we get to the transport layer */
 	u16	flush_id;
@@ -1926,11 +1929,11 @@ struct napi_gro_cb {
 	/* Start offset for remote checksum offload */
 	u16	gro_remcsum_start;
 
-	/* jiffies when first packet was created/queued */
-	unsigned long age;
+	/* used to support CHECKSUM_COMPLETE for tunneling protocols */
+	__wsum	csum;
 
-	/* Used in ipv6_gro_receive() and foo-over-udp */
-	u16	proto;
+	/* jiffies when first packet was created/queued */
+	unsigned int age;
 
 	/* This is non-zero if the packet may be of the same flow. */
 	u8	same_flow:1;
@@ -1950,16 +1953,11 @@ struct napi_gro_cb {
 #define NAPI_GRO_FREE_STOLEN_HEAD 2
 
 	/* Used in foo-over-udp, set in udp[46]_gro_receive */
-	u8	is_ipv6:1;
-
-	/* 7 bit hole */
+	u8	is_ipv6:1,
+		flush:1;
 
-	/* used to support CHECKSUM_COMPLETE for tunneling protocols */
-	__wsum	csum;
-
-	/* used in skb_gro_receive() slow path */
-	struct sk_buff *last;
-};
+	/* 6 bit hole */
+} __packed;
 
 #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb)
 
-- 
2.0.5

--
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