* [PATCH] cleanup of the NETIF_F_* flag definitions
@ 2006-08-12 19:24 Peter Zijlstra
2006-08-12 19:37 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2006-08-12 19:24 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller
Cleanup the NETIF_F_ flag definitions
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/netdevice.h | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
Index: linux-2.6/include/linux/netdevice.h
===================================================================
--- linux-2.6.orig/include/linux/netdevice.h
+++ linux-2.6/include/linux/netdevice.h
@@ -298,18 +298,20 @@ struct net_device
/* Net device features */
unsigned long features;
-#define NETIF_F_SG 1 /* Scatter/gather IO. */
-#define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */
-#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */
-#define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */
-#define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */
-#define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */
-#define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */
-#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
-#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
-#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
-#define NETIF_F_GSO 2048 /* Enable software GSO. */
-#define NETIF_F_LLTX 4096 /* LockLess TX */
+#define NETIF_F_SG 0x0001 /* Scatter/gather IO. */
+#define NETIF_F_IP_CSUM 0x0002 /* Can checksum only TCP/UDP over IPv4. */
+#define NETIF_F_NO_CSUM 0x0004 /* Does not require checksum. F.e. loopack. */
+#define NETIF_F_HW_CSUM 0x0008 /* Can checksum all the packets. */
+
+#define NETIF_F_HIGHDMA 0x0010 /* Can DMA to high memory. */
+#define NETIF_F_FRAGLIST 0x0020 /* Scatter/gather IO. */
+#define NETIF_F_HW_VLAN_TX 0x0040 /* Transmit VLAN hw acceleration */
+#define NETIF_F_HW_VLAN_RX 0x0080 /* Receive VLAN hw acceleration */
+
+#define NETIF_F_HW_VLAN_FILTER 0x0100 /* Receive filtering on VLAN */
+#define NETIF_F_VLAN_CHALLENGED 0x0200 /* Device cannot handle VLAN packets */
+#define NETIF_F_GSO 0x0400 /* Enable software GSO. */
+#define NETIF_F_LLTX 0x0800 /* LockLess TX */
/* Segmentation offload features */
#define NETIF_F_GSO_SHIFT 16
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cleanup of the NETIF_F_* flag definitions
2006-08-12 19:24 [PATCH] cleanup of the NETIF_F_* flag definitions Peter Zijlstra
@ 2006-08-12 19:37 ` Jeff Garzik
2006-08-13 13:06 ` Herbert Xu
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2006-08-12 19:37 UTC (permalink / raw)
To: Peter Zijlstra, David S. Miller; +Cc: netdev
Peter Zijlstra wrote:
> Cleanup the NETIF_F_ flag definitions
>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
If you are going to do a cleanup here, you should use the form that
makes it _immediately_ obvious which bit(s) are being used:
#define NETIF_F_SG (1 << 0)
#define NETIF_F_IP_CSUM (1 << 1)
#define NETIF_F_NO_CSUM (1 << 2)
[...]
Maybe DaveM's brain automatically translates all hex numbers into bit
numbers, but not everybody's brain works that way... :) It is better to
use a form that requires no human brain translation...
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cleanup of the NETIF_F_* flag definitions
2006-08-12 19:37 ` Jeff Garzik
@ 2006-08-13 13:06 ` Herbert Xu
0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2006-08-13 13:06 UTC (permalink / raw)
To: Jeff Garzik; +Cc: a.p.zijlstra, davem, netdev
Jeff Garzik <jeff@garzik.org> wrote:
> Peter Zijlstra wrote:
>> Cleanup the NETIF_F_ flag definitions
>>
>> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
>
> If you are going to do a cleanup here, you should use the form that
> makes it _immediately_ obvious which bit(s) are being used:
Also, please avoid changing the values if possible.
It shouldn't really break anything as far as I know, but it does
change a user-visible interface since we export (for some reason
unbeknownst to me) the features value to user-space via sysfs.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-08-13 13:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-12 19:24 [PATCH] cleanup of the NETIF_F_* flag definitions Peter Zijlstra
2006-08-12 19:37 ` Jeff Garzik
2006-08-13 13:06 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).