...
Marshaled Structures
| Code Block |
|---|
295 /* 296 * An IP or a Net number is composed of 1 or more of these descriptor 297 * structures. 298 */ 299 struct lnet_range_expr { 300 »·······__u32 re_lo; 301 »·······__u32 re_hi; 302 »·······__u32 re_stride; 303 }; struct lnet_ioctl_udsp_descr_hdr { 304 305 /* 306 * The literals SRC, DST and RTE are encoded * here. */ A net descriptor has the net type, IE: O2IBLND, SOCKLND, etc and an 307 * expression describing a net number range. 308 */ 309 struct lnet_ioctl_udsp_net_descr { 310 »·······__u32 ud_descrnet_type; 311 »·······struct lnet_range_u32expr ud_net_descrnum_countexpr; 312 }; 313 314 /* 315 * The UDSP descriptor header contains the type of matching criteria, SRC, 316 * DST, RTE, etc and how many expressions. For example an IP can be 317 * composed of 4 lnet_range_expr, a gni can be composed of 1 318 */ 319 struct lnet_ioctl_udsp_descr_hdr { 320 »·······/* 321 »······· * The literals SRC, DST and RTE are encoded 322 »······· * here. 323 »······· */ 324 »·······__u32 ud_descr_type; 325 »·······__u32 ud_descr_count; 326 }; 327 328 /* 329 * each matching expression in the UDSP is described with this */ matching expression in the UDSP is described with this. 330 * The bulk format is as follows: 331 *»·····1. 1x struct lnet_ioctl_udsp_net_descr 332 *»·····»·······-> the net part of the NID 333 *»·····2. >=1 struct lnet_range_expr 334 *»·····»·······-> the address part of the NID 335 */ 336 struct lnet_ioctl_udsp_descr { 337 »·······struct lnet_ioctl_udsp_descr_hdr iud_src_hdr; 338 »·······union action iou_action { 339 »·······»·······__u32 priority; 340 »·······}; 341 »·······struct lnet_ioctl_udsp_net_descr iud_net; 342 »·······char iud_bulk[0]; 343 }; 344 345 /* 346 * The cumulative UDSP descriptor 347 * The bulk format is as follows: 348 *»·····1. >=1 struct lnet_ioctl_udsp_descr 349 { struct lnet_ioctl_udsp_descr_hdr iud_src_hdr; union action iou_action { __u32 priority; } char iud_bulk[0]; }; * 350 * The size indicated in iou_hdr is the total size of the UDSP. 351 * 352 */ 353 struct lnet_ioctl_udsp { struct354 »·······struct libcfs_ioctl_hdr iou_hdr; 355 »·······__u32 iou_idx; 356 »·······__u32 iou_action_type char357 »·······char iou_bulk[0]; 358 }; |
The address is expressed as a list of lnet_range_expr. These need to be marshalled. For IP address there are 4 of these structures. Other type of addresses can have a different number. As an example, gemini will only have one. The marshalled structure will look like this:
...