tech-net archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: mbuf flags
christos%astron.com@localhost (Christos Zoulas) wrote:
>In article <5298.1425184456%perseus.noi.kre.to@localhost>,
>Robert Elz <kre%munnari.OZ.AU@localhost> wrote:
>> Date: Sun, 1 Mar 2015 00:16:51 +0000 (GMT)
>> From: Robert Swindells <rjs%fdy2.co.uk@localhost>
>> Message-ID: <20150301001651.D680E30285B%ren.fdy2.co.uk@localhost>
>>
>> | Also, keeping everything aligned would require adding an extra hex digit
>> | to every one which would make it less clear what had really changed.
>>
>>Add the extra digits in a separate (change nothing) commit first,
>>then your real change will be smooth, and still look nice.
>>
>
>I have this patch to add the extra link bits for FreeBSD compat needed
>for net80122...
[snip]
Ok, that still doesn't tell me which bit I should use though.
In Kame, the flag I am adding came before the M_LINK ones, it seems
better to me to follow this pattern and move up the M_LINK[0-7] flags
by one bit. This would mess up your patch though.
I presume we would move the M_EXT_ flags up by 4 bits at some point too.
I have modified mbuf.h to just contain the formatting changes:
Index: mbuf.h
===================================================================
RCS file: /cvsroot/src/sys/sys/mbuf.h,v
retrieving revision 1.156
diff -u -r1.156 mbuf.h
--- mbuf.h 5 Sep 2014 05:48:59 -0000 1.156
+++ mbuf.h 1 Mar 2015 22:25:37 -0000
@@ -322,29 +322,32 @@
MBUF_DEFINE(mbuf, MHLEN, MLEN);
/* mbuf flags */
-#define M_EXT 0x00001 /* has associated external storage */
-#define M_PKTHDR 0x00002 /* start of record */
-#define M_EOR 0x00004 /* end of record */
-#define M_PROTO1 0x00008 /* protocol-specific */
+#define M_EXT 0x00000001 /* has associated external storage */
+#define M_PKTHDR 0x00000002 /* start of record */
+#define M_EOR 0x00000004 /* end of record */
+#define M_PROTO1 0x00000008 /* protocol-specific */
/* mbuf pkthdr flags, also in m_flags */
-#define M_AUTHIPHDR 0x00010 /* data origin authentication for IP header */
-#define M_DECRYPTED 0x00020 /* confidentiality */
-#define M_LOOP 0x00040 /* for Mbuf statistics */
-#define M_AUTHIPDGM 0x00080 /* data origin authentication */
-#define M_BCAST 0x00100 /* send/received as link-level broadcast */
-#define M_MCAST 0x00200 /* send/received as link-level multicast */
-#define M_CANFASTFWD 0x00400 /* used by filters to indicate packet can
- be fast-forwarded */
-#define M_ANYCAST6 0x00800 /* received as IPv6 anycast */
-#define M_LINK0 0x01000 /* link layer specific flag */
-#define M_LINK1 0x02000 /* link layer specific flag */
-#define M_LINK2 0x04000 /* link layer specific flag */
-#define M_LINK3 0x08000 /* link layer specific flag */
-#define M_LINK4 0x10000 /* link layer specific flag */
-#define M_LINK5 0x20000 /* link layer specific flag */
-#define M_LINK6 0x40000 /* link layer specific flag */
-#define M_LINK7 0x80000 /* link layer specific flag */
+#define M_AUTHIPHDR 0x00000010 /* data origin authentication for
+ * IP header */
+#define M_DECRYPTED 0x00000020 /* confidentiality */
+#define M_LOOP 0x00000040 /* for Mbuf statistics */
+#define M_AUTHIPDGM 0x00000080 /* data origin authentication */
+#define M_BCAST 0x00000100 /* send/received as link-level
+ * broadcast */
+#define M_MCAST 0x00000200 /* send/received as link-level
+ * multicast */
+#define M_CANFASTFWD 0x00000400 /* used by filters to indicate
+ * packet can be fast-forwarded */
+#define M_ANYCAST6 0x00000800 /* received as IPv6 anycast */
+#define M_LINK0 0x00001000 /* link layer specific flag */
+#define M_LINK1 0x00002000 /* link layer specific flag */
+#define M_LINK2 0x00004000 /* link layer specific flag */
+#define M_LINK3 0x00008000 /* link layer specific flag */
+#define M_LINK4 0x00010000 /* link layer specific flag */
+#define M_LINK5 0x00020000 /* link layer specific flag */
+#define M_LINK6 0x00040000 /* link layer specific flag */
+#define M_LINK7 0x00080000 /* link layer specific flag */
/* additional flags for M_EXT mbufs */
#define M_EXT_FLAGS 0xff000000
Home |
Main Index |
Thread Index |
Old Index