This enables userspace to get VLAN TPID as well as the VLAN TCI.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -84,17 +84,18 @@ struct tpacket_auxdata { · 83 unmodified lines | ||
| 84 | 84 | __u16 tp_mac; |
| 85 | 85 | __u16 tp_net; |
| 86 | 86 | __u16 tp_vlan_tci; |
| 87 | − __u16 tp_padding; | |
| 87 | + __u16 tp_vlan_tpid; | |
| 88 | 88 | }; |
| 89 | 89 | |
| 90 | 90 | /* Rx ring - header status */ |
| 91 | −#define TP_STATUS_KERNEL 0 | |
| 92 | −#define TP_STATUS_USER (1 << 0) | |
| 93 | −#define TP_STATUS_COPY (1 << 1) | |
| 94 | −#define TP_STATUS_LOSING (1 << 2) | |
| 95 | −#define TP_STATUS_CSUMNOTREADY (1 << 3) | |
| 96 | −#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */ | |
| 97 | −#define TP_STATUS_BLK_TMO (1 << 5) | |
| 91 | +#define TP_STATUS_KERNEL 0 | |
| 92 | +#define TP_STATUS_USER (1 << 0) | |
| 93 | +#define TP_STATUS_COPY (1 << 1) | |
| 94 | +#define TP_STATUS_LOSING (1 << 2) | |
| 95 | +#define TP_STATUS_CSUMNOTREADY (1 << 3) | |
| 96 | +#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */ | |
| 97 | +#define TP_STATUS_BLK_TMO (1 << 5) | |
| 98 | +#define TP_STATUS_VLAN_TPID_VALID (1 << 6) /* auxdata has valid tp_vlan_tpid */ | |
| 98 | 99 | |
| 99 | 100 | /* Tx ring - header status */ |
| 100 | 101 | #define TP_STATUS_AVAILABLE 0 |
| @@ -133,12 +134,15 @@ struct tpacket2_hdr { · 32 unmodified lines | ||
| 133 | 134 | __u32 tp_sec; |
| 134 | 135 | __u32 tp_nsec; |
| 135 | 136 | __u16 tp_vlan_tci; |
| 136 | − __u8 tp_padding[6]; | |
| 137 | + __u16 tp_vlan_tpid; | |
| 138 | + __u8 tp_padding[4]; | |
| 137 | 139 | }; |
| 138 | 140 | |
| 139 | 141 | struct tpacket_hdr_variant1 { |
| 140 | 142 | __u32 tp_rxhash; |
| 141 | 143 | __u32 tp_vlan_tci; |
| 144 | + __u16 tp_vlan_tpid; | |
| 145 | + __u16 tp_padding; | |
| 142 | 146 | }; |
| 143 | 147 | |
| 144 | 148 | struct tpacket3_hdr { |
| @@ -154,7 +158,7 @@ struct tpacket3_hdr { · 9 unmodified lines | ||
| 154 | 158 | union { |
| 155 | 159 | struct tpacket_hdr_variant1 hv1; |
| 156 | 160 | }; |
| 157 | − __u8 tp_padding[12]; | |
| 161 | + __u8 tp_padding[8]; | |
| 158 | 162 | }; |
| 159 | 163 | |
| 160 | 164 | struct tpacket_bd_ts { |