History

packet: minor: convert status bits into shifting format

This makes it more readable and clearer what bits are still free to use. The compiler reduces this to a constant for us anyway.

Daniel Borkmann committed 13 years ago

Commit 7276d5d1 parent 7a513841 file · +11 −11Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/if_packet.h+11−11
@@ -86,19 +86,19 @@ struct tpacket_auxdata { · 85 unmodified lines
8686 };
8787
8888 /* Rx ring - header status */
89−#define TP_STATUS_KERNEL 0x0
90−#define TP_STATUS_USER 0x1
91−#define TP_STATUS_COPY 0x2
92−#define TP_STATUS_LOSING 0x4
93−#define TP_STATUS_CSUMNOTREADY 0x8
94−#define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */
95−#define TP_STATUS_BLK_TMO 0x20
89+#define TP_STATUS_KERNEL 0
90+#define TP_STATUS_USER (1 << 0)
91+#define TP_STATUS_COPY (1 << 1)
92+#define TP_STATUS_LOSING (1 << 2)
93+#define TP_STATUS_CSUMNOTREADY (1 << 3)
94+#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */
95+#define TP_STATUS_BLK_TMO (1 << 5)
9696
9797 /* Tx ring - header status */
98−#define TP_STATUS_AVAILABLE 0x0
99−#define TP_STATUS_SEND_REQUEST 0x1
100−#define TP_STATUS_SENDING 0x2
101−#define TP_STATUS_WRONG_FORMAT 0x4
98+#define TP_STATUS_AVAILABLE 0
99+#define TP_STATUS_SEND_REQUEST (1 << 0)
100+#define TP_STATUS_SENDING (1 << 1)
101+#define TP_STATUS_WRONG_FORMAT (1 << 2)
102102
103103 /* Rx ring - feature request bits */
104104 #define TP_FT_REQ_FILL_RXHASH 0x1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t