github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/socket_rds.txt (about)

     1  # Copyright 2018 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  # AF_RDS support.
     5  
     6  include <linux/socket.h>
     7  include <linux/net.h>
     8  include <uapi/linux/in6.h>
     9  include <uapi/linux/rds.h>
    10  
    11  resource sock_rds[sock]
    12  
    13  socket$rds(domain const[AF_RDS], type const[SOCK_SEQPACKET], proto const[0]) sock_rds
    14  bind$rds(fd sock_rds, addr ptr[in, sockaddr_in], addrlen len[addr])
    15  connect$rds(fd sock_rds, addr ptr[in, sockaddr_in], addrlen len[addr])
    16  sendmsg$rds(fd sock_rds, msg ptr[in, msghdr_rds], f flags[send_flags])
    17  
    18  setsockopt$RDS_CANCEL_SENT_TO(fd sock_rds, level const[SOL_RDS], opt const[RDS_CANCEL_SENT_TO], val ptr[in, sockaddr_in], len len[val])
    19  setsockopt$RDS_GET_MR(fd sock_rds, level const[SOL_RDS], opt const[RDS_GET_MR], val ptr[in, rds_get_mr_args], len len[val])
    20  setsockopt$RDS_GET_MR_FOR_DEST(fd sock_rds, level const[SOL_RDS], opt const[RDS_GET_MR_FOR_DEST], val ptr[in, rds_get_mr_for_dest_args], len len[val])
    21  setsockopt$RDS_FREE_MR(fd sock_rds, level const[SOL_RDS], opt const[RDS_FREE_MR], val ptr[in, rds_free_mr_args], len len[val])
    22  setsockopt$RDS_RECVERR(fd sock_rds, level const[SOL_RDS], opt const[RDS_RECVERR], val ptr[in, bool32], len len[val])
    23  setsockopt$RDS_CONG_MONITOR(fd sock_rds, level const[SOL_RDS], opt const[RDS_CONG_MONITOR], val ptr[in, bool32], len len[val])
    24  setsockopt$SO_RDS_TRANSPORT(fd sock_rds, level const[SOL_RDS], opt const[SO_RDS_TRANSPORT], val ptr[in, flags[rds_transport, int32]], len len[val])
    25  setsockopt$SO_RDS_MSG_RXPATH_LATENCY(fd sock_rds, level const[SOL_RDS], opt const[SO_RDS_MSG_RXPATH_LATENCY], val ptr[in, rds_rx_trace_so], len len[val])
    26  
    27  msghdr_rds {
    28  	addr	ptr[in, sockaddr_in, opt]
    29  	addrlen	len[addr, int32]
    30  	vec	ptr[in, array[iovec[out, array[int8]]]]
    31  	vlen	len[vec, intptr]
    32  	ctrl	ptr[in, array[cmsghdr_rds], opt]
    33  	ctrllen	bytesize[ctrl, intptr]
    34  	f	flags[send_flags, int32]
    35  }
    36  
    37  cmsghdr_rds [
    38  	rdma_args	cmsghdr_rds_t[RDS_CMSG_RDMA_ARGS, rds_rdma_args]
    39  	rdma_dest	cmsghdr_rds_t[RDS_CMSG_RDMA_DEST, rds_rdma_cookie_t]
    40  	rdma_map	cmsghdr_rds_t[RDS_CMSG_RDMA_MAP, rds_get_mr_args]
    41  	fadd		cmsghdr_rds_t[RDS_CMSG_ATOMIC_FADD, rds_atomic_args]
    42  	cswp		cmsghdr_rds_t[RDS_CMSG_ATOMIC_CSWP, rds_atomic_args]
    43  	mask_fadd	cmsghdr_rds_t[RDS_CMSG_MASKED_ATOMIC_FADD, rds_atomic_args]
    44  	mask_cswp	cmsghdr_rds_t[RDS_CMSG_MASKED_ATOMIC_CSWP, rds_atomic_args]
    45  	zcopy_cookie	cmsghdr_rds_t[RDS_CMSG_ZCOPY_COOKIE, int32]
    46  ] [varlen]
    47  
    48  type cmsghdr_rds_t[TYPE, DATA] {
    49  	cmsg_len	len[parent, intptr]
    50  	cmsg_level	const[SOL_RDS, int32]
    51  	cmsg_type	const[TYPE, int32]
    52  	data		DATA
    53  } [align[PTR_SIZE]]
    54  
    55  rds_rdma_args {
    56  	cookie		rds_rdma_cookie_t
    57  	remote_vec	rds_iovec
    58  	local_vec	ptr64[in, array[rds_iovec]]
    59  	nr_local	len[local_vec, int64]
    60  	flags		flags[rds_rdma_flags, int64]
    61  	user_token	int64
    62  }
    63  
    64  rds_atomic_args {
    65  	cookie		rds_rdma_cookie_t
    66  	local_addr	ptr64[in, int64]
    67  	remote_addr	ptr64[in, int64]
    68  	arg1		int64
    69  	arg2		int64
    70  	mask1		int64
    71  	mask2		int64
    72  	flags		flags[rds_rdma_flags, int64]
    73  	user_token	int64
    74  }
    75  
    76  rds_get_mr_args {
    77  	vec		rds_iovec
    78  	cookie_addr	ptr64[out, int8]
    79  	flags		flags[rds_rdma_flags, int64]
    80  }
    81  
    82  rds_get_mr_for_dest_args {
    83  	dest_addr	sockaddr_storage
    84  	vec		rds_iovec
    85  	cookie_addr	ptr64[out, int8]
    86  	flags		flags[rds_rdma_flags, int64]
    87  } [packed]
    88  
    89  rds_free_mr_args {
    90  	cookie	rds_rdma_cookie_t
    91  	flags	flags[rds_rdma_flags, int64]
    92  }
    93  
    94  rds_rx_trace_so {
    95  	rx_traces	len[rx_trace_pos, int8]
    96  	rx_trace_pos	array[int8, 0:RDS_MSG_RX_DGRAM_TRACE_MAX]
    97  }
    98  
    99  rds_iovec {
   100  	addr	ptr64[out, array[int8]]
   101  	bytes	len[addr, int64]
   102  }
   103  
   104  rds_rdma_cookie_t {
   105  # This should be a resource, but it's unclear how to obtain it.
   106  	key	int32
   107  	off	int32
   108  } [align[8]]
   109  
   110  rds_transport = RDS_TRANS_IB, RDS_TRANS_IWARP, RDS_TRANS_TCP, RDS_TRANS_NONE
   111  rds_rdma_flags = RDS_RDMA_READWRITE, RDS_RDMA_FENCE, RDS_RDMA_INVALIDATE, RDS_RDMA_USE_ONCE, RDS_RDMA_DONTWAIT, RDS_RDMA_NOTIFY_ME, RDS_RDMA_SILENT