OLD | NEW |
1 /* SPDX-License-Identifier: BSD-2-Clause */ | 1 /* SPDX-License-Identifier: BSD-2-Clause */ |
2 | 2 |
3 /* This file contains definitions that are shared across the files | 3 /* This file contains definitions that are shared across the files |
4 * that implement Homa for Linux. | 4 * that implement Homa for Linux. |
5 */ | 5 */ |
6 | 6 |
7 #ifndef _HOMA_IMPL_H | 7 #ifndef _HOMA_IMPL_H |
8 #define _HOMA_IMPL_H | 8 #define _HOMA_IMPL_H |
9 | 9 |
10 #include <linux/bug.h> | 10 #include <linux/bug.h> |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 | 537 |
538 /** | 538 /** |
539 * @max_dead_buffs: The largest aggregate number of packet buffers | 539 * @max_dead_buffs: The largest aggregate number of packet buffers |
540 * in dead (but not yet reaped) RPCs that has existed so far in a | 540 * in dead (but not yet reaped) RPCs that has existed so far in a |
541 * single socket. Readable via sysctl, and may be reset via sysctl | 541 * single socket. Readable via sysctl, and may be reset via sysctl |
542 * to begin recalculating. | 542 * to begin recalculating. |
543 */ | 543 */ |
544 int max_dead_buffs; | 544 int max_dead_buffs; |
545 | 545 |
546 /** | 546 /** |
547 * @pacer_kthread: Kernel thread that transmits packets from | |
548 * throttled_rpcs in a way that limits queue buildup in the | |
549 * NIC. | |
550 */ | |
551 struct task_struct *pacer_kthread; | |
552 | |
553 /** | |
554 * @pacer_exit: true means that the pacer thread should exit as | 547 * @pacer_exit: true means that the pacer thread should exit as |
555 * soon as possible. | 548 * soon as possible. |
556 */ | 549 */ |
557 bool pacer_exit; | 550 bool pacer_exit; |
558 | 551 |
559 /** | 552 /** |
| 553 * @pacer_wait_queue: Used to block the pacer thread when there |
| 554 * are no throttled RPCs. |
| 555 */ |
| 556 struct wait_queue_head pacer_wait_queue; |
| 557 |
| 558 /** |
560 * @max_nic_queue_ns: Limits the NIC queue length: we won't queue | 559 * @max_nic_queue_ns: Limits the NIC queue length: we won't queue |
561 * up a packet for transmission if link_idle_time is this many | 560 * up a packet for transmission if link_idle_time is this many |
562 * nanoseconds in the future (or more). Set externally via sysctl. | 561 * nanoseconds in the future (or more). Set externally via sysctl. |
563 */ | 562 */ |
564 int max_nic_queue_ns; | 563 int max_nic_queue_ns; |
565 | 564 |
566 /** | 565 /** |
| 566 * @pacer_kthread: Kernel thread that transmits packets from |
| 567 * throttled_rpcs in a way that limits queue buildup in the |
| 568 * NIC. |
| 569 */ |
| 570 struct task_struct *pacer_kthread; |
| 571 |
| 572 /** |
567 * @ns_per_mbyte: the number of ns that it takes to transmit | 573 * @ns_per_mbyte: the number of ns that it takes to transmit |
568 * 10**6 bytes on our uplink. This is actually a slight overestimate | 574 * 10**6 bytes on our uplink. This is actually a slight overestimate |
569 * of the value, to ensure that we don't underestimate NIC queue | 575 * of the value, to ensure that we don't underestimate NIC queue |
570 * length and queue too many packets. | 576 * length and queue too many packets. |
571 */ | 577 */ |
572 u32 ns_per_mbyte; | 578 u32 ns_per_mbyte; |
573 | 579 |
574 #ifndef __STRIP__ /* See strip.py */ | 580 #ifndef __STRIP__ /* See strip.py */ |
575 /** | 581 /** |
576 * @verbose: Nonzero enables additional logging. Set externally via | 582 * @verbose: Nonzero enables additional logging. Set externally via |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 void homa_message_out_init(struct homa_rpc *rpc, int length); | 992 void homa_message_out_init(struct homa_rpc *rpc, int length); |
987 void homa_need_ack_pkt(struct sk_buff *skb, struct homa_sock *hsk, | 993 void homa_need_ack_pkt(struct sk_buff *skb, struct homa_sock *hsk, |
988 struct homa_rpc *rpc); | 994 struct homa_rpc *rpc); |
989 struct sk_buff *homa_new_data_packet(struct homa_rpc *rpc, | 995 struct sk_buff *homa_new_data_packet(struct homa_rpc *rpc, |
990 struct iov_iter *iter, int offset, | 996 struct iov_iter *iter, int offset, |
991 int length, int max_seg_data); | 997 int length, int max_seg_data); |
992 int homa_net_init(struct net *net); | 998 int homa_net_init(struct net *net); |
993 void homa_net_exit(struct net *net); | 999 void homa_net_exit(struct net *net); |
994 int homa_pacer_main(void *transport); | 1000 int homa_pacer_main(void *transport); |
995 void homa_pacer_stop(struct homa *homa); | 1001 void homa_pacer_stop(struct homa *homa); |
996 bool homa_pacer_xmit(struct homa *homa); | 1002 void homa_pacer_xmit(struct homa *homa); |
997 __poll_t homa_poll(struct file *file, struct socket *sock, | 1003 __poll_t homa_poll(struct file *file, struct socket *sock, |
998 struct poll_table_struct *wait); | 1004 struct poll_table_struct *wait); |
999 int homa_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, | 1005 int homa_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, |
1000 int flags, int *addr_len); | 1006 int flags, int *addr_len); |
1001 void homa_remove_from_throttled(struct homa_rpc *rpc); | 1007 void homa_remove_from_throttled(struct homa_rpc *rpc); |
1002 void homa_resend_pkt(struct sk_buff *skb, struct homa_rpc *rpc, | 1008 void homa_resend_pkt(struct sk_buff *skb, struct homa_rpc *rpc, |
1003 struct homa_sock *hsk); | 1009 struct homa_sock *hsk); |
1004 void homa_rpc_abort(struct homa_rpc *crpc, int error); | 1010 void homa_rpc_abort(struct homa_rpc *crpc, int error); |
1005 void homa_rpc_acked(struct homa_sock *hsk, | 1011 void homa_rpc_acked(struct homa_sock *hsk, |
1006 const struct in6_addr *saddr, struct homa_ack *ack); | 1012 const struct in6_addr *saddr, struct homa_ack *ack); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 * @skb: Get the struct homa for this packet buffer. | 1129 * @skb: Get the struct homa for this packet buffer. |
1124 * Return: see above | 1130 * Return: see above |
1125 */ | 1131 */ |
1126 static inline struct homa *homa_from_skb(struct sk_buff *skb) | 1132 static inline struct homa *homa_from_skb(struct sk_buff *skb) |
1127 { | 1133 { |
1128 return (struct homa *) net_generic(dev_net(skb->dev), homa_net_id); | 1134 return (struct homa *) net_generic(dev_net(skb->dev), homa_net_id); |
1129 } | 1135 } |
1130 | 1136 |
1131 extern struct completion homa_pacer_kthread_done; | 1137 extern struct completion homa_pacer_kthread_done; |
1132 #endif /* _HOMA_IMPL_H */ | 1138 #endif /* _HOMA_IMPL_H */ |
OLD | NEW |