@@ -65,6 +65,20 @@ ioctl_iow_nr!(VHOST_SCSI_SET_EVENTS_MISSED, VHOST, 0x43, raw::c_uint);
65
65
ioctl_iow_nr ! ( VHOST_SCSI_GET_EVENTS_MISSED , VHOST , 0x44 , raw:: c_uint) ;
66
66
ioctl_iow_nr ! ( VHOST_VSOCK_SET_GUEST_CID , VHOST , 0x60 , raw:: c_ulonglong) ;
67
67
ioctl_iow_nr ! ( VHOST_VSOCK_SET_RUNNING , VHOST , 0x61 , raw:: c_int) ;
68
+ ioctl_ior_nr ! ( VHOST_VDPA_GET_DEVICE_ID , VHOST , 0x70 , raw:: c_uint) ;
69
+ ioctl_ior_nr ! ( VHOST_VDPA_GET_STATUS , VHOST , 0x71 , raw:: c_uchar) ;
70
+ ioctl_iow_nr ! ( VHOST_VDPA_SET_STATUS , VHOST , 0x72 , raw:: c_uchar) ;
71
+ ioctl_ior_nr ! ( VHOST_VDPA_GET_CONFIG , VHOST , 0x73 , vhost_vdpa_config) ;
72
+ ioctl_iow_nr ! ( VHOST_VDPA_SET_CONFIG , VHOST , 0x74 , vhost_vdpa_config) ;
73
+ ioctl_iow_nr ! ( VHOST_VDPA_SET_VRING_ENABLE , VHOST , 0x75 , vhost_vring_state) ;
74
+ ioctl_ior_nr ! ( VHOST_VDPA_GET_VRING_NUM , VHOST , 0x76 , raw:: c_ushort) ;
75
+ ioctl_iow_nr ! ( VHOST_VDPA_SET_CONFIG_CALL , VHOST , 0x77 , raw:: c_int) ;
76
+ ioctl_ior_nr ! (
77
+ VHOST_VDPA_GET_IOVA_RANGE ,
78
+ VHOST ,
79
+ 0x78 ,
80
+ vhost_vdpa_iova_range
81
+ ) ;
68
82
69
83
#[ repr( C ) ]
70
84
#[ derive( Default ) ]
@@ -238,6 +252,21 @@ impl Default for vhost_scsi_target {
238
252
}
239
253
}
240
254
255
+ #[ repr( C ) ]
256
+ #[ derive( Debug ) ]
257
+ pub struct vhost_vdpa_config {
258
+ pub off : raw:: c_uint ,
259
+ pub len : raw:: c_uint ,
260
+ pub buf : __IncompleteArrayField < raw:: c_uchar > ,
261
+ }
262
+
263
+ #[ repr( C ) ]
264
+ #[ derive( Debug , Copy , Clone ) ]
265
+ pub struct vhost_vdpa_iova_range {
266
+ pub first : raw:: c_ulonglong ,
267
+ pub last : raw:: c_ulonglong ,
268
+ }
269
+
241
270
/// Helper to support vhost::set_mem_table()
242
271
pub struct VhostMemory {
243
272
buf : Vec < vhost_memory > ,
@@ -440,6 +469,34 @@ mod tests {
440
469
) ;
441
470
}
442
471
472
+ #[ test]
473
+ fn bindgen_test_layout_vhost_vdpa_config ( ) {
474
+ assert_eq ! (
475
+ :: std:: mem:: size_of:: <vhost_vdpa_config>( ) ,
476
+ 8usize ,
477
+ concat!( "Size of: " , stringify!( vhost_vdpa_config) )
478
+ ) ;
479
+ assert_eq ! (
480
+ :: std:: mem:: align_of:: <vhost_vdpa_config>( ) ,
481
+ 4usize ,
482
+ concat!( "Alignment of " , stringify!( vhost_vdpa_config) )
483
+ ) ;
484
+ }
485
+
486
+ #[ test]
487
+ fn bindgen_test_layout_vhost_vdpa_iova_range ( ) {
488
+ assert_eq ! (
489
+ :: std:: mem:: size_of:: <vhost_vdpa_iova_range>( ) ,
490
+ 16usize ,
491
+ concat!( "Size of: " , stringify!( vhost_vdpa_iova_range) )
492
+ ) ;
493
+ assert_eq ! (
494
+ :: std:: mem:: align_of:: <vhost_vdpa_iova_range>( ) ,
495
+ 8usize ,
496
+ concat!( "Alignment of " , stringify!( vhost_vdpa_iova_range) )
497
+ ) ;
498
+ }
499
+
443
500
#[ test]
444
501
fn test_vhostmemory ( ) {
445
502
let mut obj = VhostMemory :: new ( 2 ) ;
0 commit comments