@@ -1213,6 +1213,83 @@ s! {
1213
1213
}
1214
1214
1215
1215
// linux/if_xdp.h
1216
+
1217
+ pub struct sockaddr_xdp {
1218
+ pub sxdp_family: crate :: __u16,
1219
+ pub sxdp_flags: crate :: __u16,
1220
+ pub sxdp_ifindex: crate :: __u32,
1221
+ pub sxdp_queue_id: crate :: __u32,
1222
+ pub sxdp_shared_umem_fd: crate :: __u32,
1223
+ }
1224
+
1225
+ pub struct xdp_ring_offset {
1226
+ pub producer: crate :: __u64,
1227
+ pub consumer: crate :: __u64,
1228
+ pub desc: crate :: __u64,
1229
+ pub flags: crate :: __u64,
1230
+ }
1231
+
1232
+ pub struct xdp_mmap_offsets {
1233
+ pub rx: xdp_ring_offset,
1234
+ pub tx: xdp_ring_offset,
1235
+ pub fr: xdp_ring_offset,
1236
+ pub cr: xdp_ring_offset,
1237
+ }
1238
+
1239
+ pub struct xdp_ring_offset_v1 {
1240
+ pub producer: crate :: __u64,
1241
+ pub consumer: crate :: __u64,
1242
+ pub desc: crate :: __u64,
1243
+ }
1244
+
1245
+ pub struct xdp_mmap_offsets_v1 {
1246
+ pub rx: xdp_ring_offset_v1,
1247
+ pub tx: xdp_ring_offset_v1,
1248
+ pub fr: xdp_ring_offset_v1,
1249
+ pub cr: xdp_ring_offset_v1,
1250
+ }
1251
+
1252
+ pub struct xdp_umem_reg {
1253
+ pub addr: crate :: __u64,
1254
+ pub len: crate :: __u64,
1255
+ pub chunk_size: crate :: __u32,
1256
+ pub headroom: crate :: __u32,
1257
+ pub flags: crate :: __u32,
1258
+ pub tx_metadata_len: crate :: __u32,
1259
+ }
1260
+
1261
+ pub struct xdp_umem_reg_v1 {
1262
+ pub addr: crate :: __u64,
1263
+ pub len: crate :: __u64,
1264
+ pub chunk_size: crate :: __u32,
1265
+ pub headroom: crate :: __u32,
1266
+ }
1267
+
1268
+ pub struct xdp_statistics {
1269
+ pub rx_dropped: crate :: __u64,
1270
+ pub rx_invalid_descs: crate :: __u64,
1271
+ pub tx_invalid_descs: crate :: __u64,
1272
+ pub rx_ring_full: crate :: __u64,
1273
+ pub rx_fill_ring_empty_descs: crate :: __u64,
1274
+ pub tx_ring_empty_descs: crate :: __u64,
1275
+ }
1276
+
1277
+ pub struct xdp_statistics_v1 {
1278
+ pub rx_dropped: crate :: __u64,
1279
+ pub rx_invalid_descs: crate :: __u64,
1280
+ pub tx_invalid_descs: crate :: __u64,
1281
+ }
1282
+
1283
+ pub struct xdp_options {
1284
+ pub flags: crate :: __u32,
1285
+ }
1286
+
1287
+ pub struct xdp_desc {
1288
+ pub addr: crate :: __u64,
1289
+ pub len: crate :: __u32,
1290
+ pub options: crate :: __u32,
1291
+ }
1292
+
1216
1293
pub struct xsk_tx_metadata_completion {
1217
1294
pub tx_timestamp: crate :: __u64,
1218
1295
}
@@ -5641,13 +5718,46 @@ pub const SCHED_FLAG_UTIL_CLAMP_MIN: c_int = 0x20;
5641
5718
pub const SCHED_FLAG_UTIL_CLAMP_MAX : c_int = 0x40 ;
5642
5719
5643
5720
// linux/if_xdp.h
5644
- pub const XDP_UMEM_TX_SW_CSUM : __u32 = 1 << 1 ;
5645
- pub const XDP_UMEM_TX_METADATA_LEN : __u32 = 1 << 2 ;
5721
+ pub const XDP_SHARED_UMEM : crate :: __u16 = 1 << 0 ;
5722
+ pub const XDP_COPY : crate :: __u16 = 1 << 1 ;
5723
+ pub const XDP_ZEROCOPY : crate :: __u16 = 1 << 2 ;
5724
+ pub const XDP_USE_NEED_WAKEUP : crate :: __u16 = 1 << 3 ;
5725
+ pub const XDP_USE_SG : crate :: __u16 = 1 << 4 ;
5726
+
5727
+ pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG : crate :: __u32 = 1 << 0 ;
5728
+
5729
+ pub const XDP_RING_NEED_WAKEUP : crate :: __u32 = 1 << 0 ;
5730
+
5731
+ pub const XDP_MMAP_OFFSETS : c_int = 1 ;
5732
+ pub const XDP_RX_RING : c_int = 2 ;
5733
+ pub const XDP_TX_RING : c_int = 3 ;
5734
+ pub const XDP_UMEM_REG : c_int = 4 ;
5735
+ pub const XDP_UMEM_FILL_RING : c_int = 5 ;
5736
+ pub const XDP_UMEM_COMPLETION_RING : c_int = 6 ;
5737
+ pub const XDP_STATISTICS : c_int = 7 ;
5738
+ pub const XDP_OPTIONS : c_int = 8 ;
5739
+
5740
+ pub const XDP_OPTIONS_ZEROCOPY : crate :: __u32 = 1 << 0 ;
5741
+
5742
+ pub const XDP_PGOFF_RX_RING : crate :: off_t = 0 ;
5743
+ pub const XDP_PGOFF_TX_RING : crate :: off_t = 0x80000000 ;
5744
+ pub const XDP_UMEM_PGOFF_FILL_RING : crate :: c_ulonglong = 0x100000000 ;
5745
+ pub const XDP_UMEM_PGOFF_COMPLETION_RING : crate :: c_ulonglong = 0x180000000 ;
5746
+
5747
+ pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT : crate :: c_int = 48 ;
5748
+ pub const XSK_UNALIGNED_BUF_ADDR_MASK : crate :: c_ulonglong = ( 1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT ) - 1 ;
5749
+
5750
+ pub const XDP_PKT_CONTD : crate :: __u32 = 1 << 0 ;
5751
+
5752
+ pub const XDP_UMEM_TX_SW_CSUM : crate :: __u32 = 1 << 1 ;
5753
+ pub const XDP_UMEM_TX_METADATA_LEN : crate :: __u32 = 1 << 2 ;
5754
+
5755
+ pub const XDP_TXMD_FLAGS_TIMESTAMP : crate :: __u32 = 1 << 0 ;
5756
+ pub const XDP_TXMD_FLAGS_CHECKSUM : crate :: __u32 = 1 << 1 ;
5646
5757
5647
- pub const XDP_TXMD_FLAGS_TIMESTAMP : __u32 = 1 << 0 ;
5648
- pub const XDP_TXMD_FLAGS_CHECKSUM : __u32 = 1 << 1 ;
5758
+ pub const XDP_TX_METADATA : crate :: __u32 = 1 << 1 ;
5649
5759
5650
- pub const XDP_TX_METADATA : __u32 = 1 << 1 ;
5760
+ pub const SOL_XDP : c_int = 283 ;
5651
5761
5652
5762
// linux/mount.h
5653
5763
pub const MOUNT_ATTR_RDONLY : crate :: __u64 = 0x00000001 ;
0 commit comments