@@ -936,6 +936,7 @@ static inline void homa_set_doff(struct data_header *h, int size)
936
936
* @homa: Overall data about the Homa protocol implementation.
937
937
*/
938
938
static inline void homa_throttle_lock (struct homa * homa )
939
+ __acquires (& homa - > throttle_lock )
939
940
{
940
941
if (!spin_trylock_bh (& homa -> throttle_lock ))
941
942
homa_throttle_lock_slow (homa );
@@ -946,6 +947,7 @@ static inline void homa_throttle_lock(struct homa *homa)
946
947
* @homa: Overall data about the Homa protocol implementation.
947
948
*/
948
949
static inline void homa_throttle_unlock (struct homa * homa )
950
+ __releases (& homa - > throttle_lock )
949
951
{
950
952
spin_unlock_bh (& homa -> throttle_lock );
951
953
}
@@ -967,7 +969,7 @@ static inline struct in6_addr ipv4_to_ipv6(__be32 ip4)
967
969
{
968
970
struct in6_addr ret = {};
969
971
970
- if (ip4 == INADDR_ANY )
972
+ if (ip4 == htonl ( INADDR_ANY ) )
971
973
return in6addr_any ;
972
974
ret .in6_u .u6_addr32 [2 ] = htonl (0xffff );
973
975
ret .in6_u .u6_addr32 [3 ] = ip4 ;
@@ -1040,7 +1042,7 @@ static inline bool is_homa_pkt(struct sk_buff *skb)
1040
1042
* provide a unique identifier for the address in a timetrace record.
1041
1043
* @x: Address (either IPv6 or IPv4-mapped IPv6)
1042
1044
*/
1043
- static inline __be32 tt_addr (const struct in6_addr x )
1045
+ static inline uint32_t tt_addr (const struct in6_addr x )
1044
1046
{
1045
1047
return is_mapped_ipv4 (x ) ? ntohl (x .in6_u .u6_addr32 [3 ])
1046
1048
: (x .in6_u .u6_addr32 [3 ] ? ntohl (x .in6_u .u6_addr32 [3 ])
@@ -1060,132 +1062,129 @@ void unit_hook(char *id);
1060
1062
#endif /* __UNIT_TEST__ */
1061
1063
#endif /* See strip.py */
1062
1064
1063
- extern void homa_abort_rpcs (struct homa * homa , const struct in6_addr * addr ,
1064
- int port , int error );
1065
- extern void homa_abort_sock_rpcs (struct homa_sock * hsk , int error );
1066
- extern void homa_ack_pkt (struct sk_buff * skb , struct homa_sock * hsk ,
1067
- struct homa_rpc * rpc );
1068
- extern void homa_add_packet (struct homa_rpc * rpc , struct sk_buff * skb );
1069
- extern void homa_add_to_throttled (struct homa_rpc * rpc );
1070
- extern int homa_backlog_rcv (struct sock * sk , struct sk_buff * skb );
1071
- extern int homa_bind (struct socket * sk , struct sockaddr * addr ,
1072
- int addr_len );
1073
- extern int homa_check_nic_queue (struct homa * homa , struct sk_buff * skb ,
1074
- bool force );
1075
- extern struct homa_rpc
1076
- * homa_choose_fifo_grant (struct homa * homa );
1077
- extern struct homa_interest
1078
- * homa_choose_interest (struct homa * homa , struct list_head * head ,
1079
- int offset );
1080
- extern void homa_close (struct sock * sock , long timeout );
1081
- extern int homa_copy_to_user (struct homa_rpc * rpc );
1082
- extern void homa_cutoffs_pkt (struct sk_buff * skb , struct homa_sock * hsk );
1083
- extern void homa_data_pkt (struct sk_buff * skb , struct homa_rpc * rpc );
1084
- extern void homa_destroy (struct homa * homa );
1085
- extern int homa_disconnect (struct sock * sk , int flags );
1086
- extern void homa_dispatch_pkts (struct sk_buff * skb , struct homa * homa );
1065
+ void homa_abort_rpcs (struct homa * homa , const struct in6_addr * addr ,
1066
+ int port , int error );
1067
+ void homa_abort_sock_rpcs (struct homa_sock * hsk , int error );
1068
+ void homa_ack_pkt (struct sk_buff * skb , struct homa_sock * hsk ,
1069
+ struct homa_rpc * rpc );
1070
+ void homa_add_packet (struct homa_rpc * rpc , struct sk_buff * skb );
1071
+ void homa_add_to_throttled (struct homa_rpc * rpc );
1072
+ int homa_backlog_rcv (struct sock * sk , struct sk_buff * skb );
1073
+ int homa_bind (struct socket * sk , struct sockaddr * addr ,
1074
+ int addr_len );
1075
+ int homa_check_nic_queue (struct homa * homa , struct sk_buff * skb ,
1076
+ bool force );
1077
+ struct homa_rpc * homa_choose_fifo_grant (struct homa * homa );
1078
+ struct homa_interest * homa_choose_interest (struct homa * homa ,
1079
+ struct list_head * head ,
1080
+ int offset );
1081
+ void homa_close (struct sock * sock , long timeout );
1082
+ int homa_copy_to_user (struct homa_rpc * rpc );
1083
+ void homa_cutoffs_pkt (struct sk_buff * skb , struct homa_sock * hsk );
1084
+ void homa_data_pkt (struct sk_buff * skb , struct homa_rpc * rpc );
1085
+ void homa_destroy (struct homa * homa );
1086
+ int homa_disconnect (struct sock * sk , int flags );
1087
+ void homa_dispatch_pkts (struct sk_buff * skb , struct homa * homa );
1087
1088
#if LINUX_VERSION_CODE < KERNEL_VERSION (6 , 12 , 0 )
1088
- extern int homa_dointvec (struct ctl_table * table , int write ,
1089
- void __user * buffer , size_t * lenp , loff_t * ppos );
1089
+ int homa_dointvec (struct ctl_table * table , int write ,
1090
+ void __user * buffer , size_t * lenp , loff_t * ppos );
1090
1091
#else
1091
- extern int homa_dointvec (const struct ctl_table * table , int write ,
1092
- void __user * buffer , size_t * lenp , loff_t * ppos );
1092
+ int homa_dointvec (const struct ctl_table * table , int write ,
1093
+ void * buffer , size_t * lenp , loff_t * ppos );
1093
1094
#endif
1094
- extern int homa_err_handler_v4 (struct sk_buff * skb , u32 info );
1095
- extern int homa_err_handler_v6 (struct sk_buff * skb ,
1096
- struct inet6_skb_parm * opt , u8 type , u8 code , int offset ,
1097
- __be32 info );
1098
- extern int homa_fill_data_interleaved (struct homa_rpc * rpc ,
1099
- struct sk_buff * skb , struct iov_iter * iter );
1100
- extern void homa_freeze (struct homa_rpc * rpc , enum homa_freeze_type type ,
1101
- char * format );
1102
- extern void homa_freeze_peers (struct homa * homa );
1103
- extern struct homa_gap
1104
- * homa_gap_new (struct list_head * next , int start , int end );
1105
- extern void homa_gap_retry (struct homa_rpc * rpc );
1106
- extern int homa_get_port (struct sock * sk , unsigned short snum );
1107
- extern int homa_getsockopt (struct sock * sk , int level , int optname ,
1108
- char __user * optval , int __user * option );
1109
- extern int homa_hash (struct sock * sk );
1110
- extern enum hrtimer_restart
1111
- homa_hrtimer (struct hrtimer * timer );
1112
- extern int homa_init (struct homa * homa );
1113
- extern void homa_incoming_sysctl_changed (struct homa * homa );
1114
- extern int homa_ioc_abort (struct sock * sk , int * karg );
1115
- extern int homa_ioctl (struct sock * sk , int cmd , int * karg );
1116
- extern void homa_log_throttled (struct homa * homa );
1117
- extern int homa_message_in_init (struct homa_rpc * rpc , int length ,
1118
- int unsched );
1119
- extern int homa_message_out_fill (struct homa_rpc * rpc ,
1120
- struct iov_iter * iter , int xmit );
1121
- extern void homa_message_out_init (struct homa_rpc * rpc , int length );
1122
- extern void homa_need_ack_pkt (struct sk_buff * skb , struct homa_sock * hsk ,
1123
- struct homa_rpc * rpc );
1124
- extern struct sk_buff
1125
- * homa_new_data_packet (struct homa_rpc * rpc ,
1126
- struct iov_iter * iter , int offset , int length ,
1127
- int max_seg_data );
1128
- extern void homa_outgoing_sysctl_changed (struct homa * homa );
1129
- extern int homa_pacer_main (void * transportInfo );
1130
- extern void homa_pacer_stop (struct homa * homa );
1131
- extern void homa_pacer_xmit (struct homa * homa );
1132
- extern __poll_t homa_poll (struct file * file , struct socket * sock ,
1133
- struct poll_table_struct * wait );
1134
- extern char * homa_print_ipv4_addr (__be32 addr );
1135
- extern char * homa_print_ipv6_addr (const struct in6_addr * addr );
1136
- extern char * homa_print_packet (struct sk_buff * skb , char * buffer , int buf_len );
1137
- extern char * homa_print_packet_short (struct sk_buff * skb , char * buffer ,
1138
- int buf_len );
1139
- extern void homa_prios_changed (struct homa * homa );
1140
- extern int homa_recvmsg (struct sock * sk , struct msghdr * msg , size_t len ,
1141
- int flags , int * addr_len );
1142
- extern int homa_register_interests (struct homa_interest * interest ,
1143
- struct homa_sock * hsk , int flags , __u64 id );
1144
- extern void homa_remove_from_throttled (struct homa_rpc * rpc );
1145
- extern void homa_resend_data (struct homa_rpc * rpc , int start , int end ,
1146
- int priority );
1147
- extern void homa_resend_pkt (struct sk_buff * skb , struct homa_rpc * rpc ,
1148
- struct homa_sock * hsk );
1149
- extern void homa_rpc_abort (struct homa_rpc * crpc , int error );
1150
- extern void homa_rpc_acked (struct homa_sock * hsk ,
1151
- const struct in6_addr * saddr , struct homa_ack * ack );
1152
- extern void homa_rpc_free (struct homa_rpc * rpc );
1153
- extern void homa_rpc_handoff (struct homa_rpc * rpc );
1154
- extern int homa_sendmsg (struct sock * sk , struct msghdr * msg , size_t len );
1155
- extern int homa_setsockopt (struct sock * sk , int level , int optname ,
1156
- sockptr_t __user optval , unsigned int optlen );
1157
- extern int homa_shutdown (struct socket * sock , int how );
1158
- extern int homa_snprintf (char * buffer , int size , int used ,
1159
- const char * format , ...) __printf (4 , 5 );
1160
- extern int homa_softirq (struct sk_buff * skb );
1161
- extern void homa_spin (int ns );
1162
- extern char * homa_symbol_for_type (uint8_t type );
1095
+ int homa_err_handler_v4 (struct sk_buff * skb , u32 info );
1096
+ int homa_err_handler_v6 (struct sk_buff * skb ,
1097
+ struct inet6_skb_parm * opt , u8 type , u8 code ,
1098
+ int offset , __be32 info );
1099
+ int homa_fill_data_interleaved (struct homa_rpc * rpc ,
1100
+ struct sk_buff * skb , struct iov_iter * iter );
1101
+ void homa_freeze (struct homa_rpc * rpc , enum homa_freeze_type type ,
1102
+ char * format );
1103
+ void homa_freeze_peers (struct homa * homa );
1104
+ struct homa_gap * homa_gap_new (struct list_head * next , int start , int end );
1105
+ void homa_gap_retry (struct homa_rpc * rpc );
1106
+ int homa_get_port (struct sock * sk , unsigned short snum );
1107
+ int homa_getsockopt (struct sock * sk , int level , int optname ,
1108
+ char __user * optval , int __user * option );
1109
+ int homa_hash (struct sock * sk );
1110
+ enum hrtimer_restart homa_hrtimer (struct hrtimer * timer );
1111
+ int homa_init (struct homa * homa );
1112
+ void homa_incoming_sysctl_changed (struct homa * homa );
1113
+ int homa_ioc_abort (struct sock * sk , int * karg );
1114
+ int homa_ioctl (struct sock * sk , int cmd , int * karg );
1115
+ void homa_log_throttled (struct homa * homa );
1116
+ int homa_message_in_init (struct homa_rpc * rpc , int length ,
1117
+ int unsched );
1118
+ int homa_message_out_fill (struct homa_rpc * rpc ,
1119
+ struct iov_iter * iter , int xmit );
1120
+ void homa_message_out_init (struct homa_rpc * rpc , int length );
1121
+ void homa_need_ack_pkt (struct sk_buff * skb , struct homa_sock * hsk ,
1122
+ struct homa_rpc * rpc );
1123
+ struct sk_buff * homa_new_data_packet (struct homa_rpc * rpc ,
1124
+ struct iov_iter * iter , int offset ,
1125
+ int length , int max_seg_data );
1126
+ void homa_outgoing_sysctl_changed (struct homa * homa );
1127
+ int homa_pacer_main (void * transportInfo );
1128
+ void homa_pacer_stop (struct homa * homa );
1129
+ void homa_pacer_xmit (struct homa * homa );
1130
+ __poll_t homa_poll (struct file * file , struct socket * sock ,
1131
+ struct poll_table_struct * wait );
1132
+ char * homa_print_ipv4_addr (__be32 addr );
1133
+ char * homa_print_ipv6_addr (const struct in6_addr * addr );
1134
+ char * homa_print_packet (struct sk_buff * skb , char * buffer , int buf_len );
1135
+ char * homa_print_packet_short (struct sk_buff * skb , char * buffer ,
1136
+ int buf_len );
1137
+ void homa_prios_changed (struct homa * homa );
1138
+ int homa_recvmsg (struct sock * sk , struct msghdr * msg , size_t len ,
1139
+ int flags , int * addr_len );
1140
+ int homa_register_interests (struct homa_interest * interest ,
1141
+ struct homa_sock * hsk , int flags , __u64 id );
1142
+ void homa_remove_from_throttled (struct homa_rpc * rpc );
1143
+ void homa_resend_data (struct homa_rpc * rpc , int start , int end ,
1144
+ int priority );
1145
+ void homa_resend_pkt (struct sk_buff * skb , struct homa_rpc * rpc ,
1146
+ struct homa_sock * hsk );
1147
+ void homa_rpc_abort (struct homa_rpc * crpc , int error );
1148
+ void homa_rpc_acked (struct homa_sock * hsk ,
1149
+ const struct in6_addr * saddr , struct homa_ack * ack );
1150
+ void homa_rpc_free (struct homa_rpc * rpc );
1151
+ void homa_rpc_handoff (struct homa_rpc * rpc );
1152
+ int homa_sendmsg (struct sock * sk , struct msghdr * msg , size_t len );
1153
+ int homa_setsockopt (struct sock * sk , int level , int optname ,
1154
+ sockptr_t optval , unsigned int optlen );
1155
+ int homa_shutdown (struct socket * sock , int how );
1156
+ int homa_snprintf (char * buffer , int size , int used ,
1157
+ const char * format , ...) __printf (4 , 5 );
1158
+ int homa_softirq (struct sk_buff * skb );
1159
+ void homa_spin (int ns );
1160
+ char * homa_symbol_for_type (uint8_t type );
1163
1161
#if LINUX_VERSION_CODE < KERNEL_VERSION (6 , 12 , 0 )
1164
- extern int homa_sysctl_softirq_cores (struct ctl_table * table ,
1165
- int write , void __user * buffer , size_t * lenp , loff_t * ppos );
1162
+ int homa_sysctl_softirq_cores (struct ctl_table * table , int write ,
1163
+ void __user * buffer , size_t * lenp ,
1164
+ loff_t * ppos );
1166
1165
#else
1167
- extern int homa_sysctl_softirq_cores (const struct ctl_table * table ,
1168
- int write , void __user * buffer , size_t * lenp , loff_t * ppos );
1166
+ int homa_sysctl_softirq_cores (const struct ctl_table * table ,
1167
+ int write , void * buffer , size_t * lenp ,
1168
+ loff_t * ppos );
1169
1169
#endif
1170
- extern void homa_timer (struct homa * homa );
1171
- extern int homa_timer_main (void * transportInfo );
1172
- extern void homa_unhash (struct sock * sk );
1173
- extern void homa_unknown_pkt (struct sk_buff * skb , struct homa_rpc * rpc );
1174
- extern int homa_unsched_priority (struct homa * homa ,
1175
- struct homa_peer * peer , int length );
1176
- extern int homa_validate_incoming (struct homa * homa , int verbose ,
1177
- int * link_errors );
1178
- extern struct homa_rpc
1179
- * homa_wait_for_message (struct homa_sock * hsk , int flags ,
1180
- __u64 id );
1181
- extern int homa_xmit_control (enum homa_packet_type type , void * contents ,
1182
- size_t length , struct homa_rpc * rpc );
1183
- extern int __homa_xmit_control (void * contents , size_t length ,
1184
- struct homa_peer * peer , struct homa_sock * hsk );
1185
- extern void homa_xmit_data (struct homa_rpc * rpc , bool force );
1186
- extern void __homa_xmit_data (struct sk_buff * skb , struct homa_rpc * rpc ,
1187
- int priority );
1188
- extern void homa_xmit_unknown (struct sk_buff * skb , struct homa_sock * hsk );
1170
+ void homa_timer (struct homa * homa );
1171
+ int homa_timer_main (void * transportInfo );
1172
+ void homa_unhash (struct sock * sk );
1173
+ void homa_unknown_pkt (struct sk_buff * skb , struct homa_rpc * rpc );
1174
+ int homa_unsched_priority (struct homa * homa , struct homa_peer * peer ,
1175
+ int length );
1176
+ int homa_validate_incoming (struct homa * homa , int verbose ,
1177
+ int * link_errors );
1178
+ struct homa_rpc * homa_wait_for_message (struct homa_sock * hsk , int flags ,
1179
+ __u64 id );
1180
+ int homa_xmit_control (enum homa_packet_type type , void * contents ,
1181
+ size_t length , struct homa_rpc * rpc );
1182
+ int __homa_xmit_control (void * contents , size_t length ,
1183
+ struct homa_peer * peer , struct homa_sock * hsk );
1184
+ void homa_xmit_data (struct homa_rpc * rpc , bool force );
1185
+ void __homa_xmit_data (struct sk_buff * skb , struct homa_rpc * rpc ,
1186
+ int priority );
1187
+ void homa_xmit_unknown (struct sk_buff * skb , struct homa_sock * hsk );
1189
1188
1190
1189
/**
1191
1190
* homa_check_pacer() - This method is invoked at various places in Homa to
0 commit comments