forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/infiniband/hw/hfi1/qp.h
....@@ -58,28 +58,22 @@
5858 extern const struct rvt_operation_params hfi1_post_parms[];
5959
6060 /*
61
- * Send if not busy or waiting for I/O and either
62
- * a RC response is pending or we can process send work requests.
63
- */
64
-static inline int hfi1_send_ok(struct rvt_qp *qp)
65
-{
66
- return !(qp->s_flags & (RVT_S_BUSY | RVT_S_ANY_WAIT_IO)) &&
67
- (verbs_txreq_queued(qp) ||
68
- (qp->s_flags & RVT_S_RESP_PENDING) ||
69
- !(qp->s_flags & RVT_S_ANY_WAIT_SEND));
70
-}
71
-
72
-/*
7361 * Driver specific s_flags starting at bit 31 down to HFI1_S_MIN_BIT_MASK
7462 *
7563 * HFI1_S_AHG_VALID - ahg header valid on chip
7664 * HFI1_S_AHG_CLEAR - have send engine clear ahg state
7765 * HFI1_S_WAIT_PIO_DRAIN - qp waiting for PIOs to drain
66
+ * HFI1_S_WAIT_TID_SPACE - a QP is waiting for TID resource
67
+ * HFI1_S_WAIT_TID_RESP - waiting for a TID RDMA WRITE response
68
+ * HFI1_S_WAIT_HALT - halt the first leg send engine
7869 * HFI1_S_MIN_BIT_MASK - the lowest bit that can be used by hfi1
7970 */
8071 #define HFI1_S_AHG_VALID 0x80000000
8172 #define HFI1_S_AHG_CLEAR 0x40000000
8273 #define HFI1_S_WAIT_PIO_DRAIN 0x20000000
74
+#define HFI1_S_WAIT_TID_SPACE 0x10000000
75
+#define HFI1_S_WAIT_TID_RESP 0x08000000
76
+#define HFI1_S_WAIT_HALT 0x04000000
8377 #define HFI1_S_MIN_BIT_MASK 0x01000000
8478
8579 /*
....@@ -88,6 +82,21 @@
8882
8983 #define HFI1_S_ANY_WAIT_IO (RVT_S_ANY_WAIT_IO | HFI1_S_WAIT_PIO_DRAIN)
9084 #define HFI1_S_ANY_WAIT (HFI1_S_ANY_WAIT_IO | RVT_S_ANY_WAIT_SEND)
85
+#define HFI1_S_ANY_TID_WAIT_SEND (RVT_S_WAIT_SSN_CREDIT | RVT_S_WAIT_DMA)
86
+
87
+/*
88
+ * Send if not busy or waiting for I/O and either
89
+ * a RC response is pending or we can process send work requests.
90
+ */
91
+static inline int hfi1_send_ok(struct rvt_qp *qp)
92
+{
93
+ struct hfi1_qp_priv *priv = qp->priv;
94
+
95
+ return !(qp->s_flags & (RVT_S_BUSY | HFI1_S_ANY_WAIT_IO)) &&
96
+ (verbs_txreq_queued(iowait_get_ib_work(&priv->s_iowait)) ||
97
+ (qp->s_flags & RVT_S_RESP_PENDING) ||
98
+ !(qp->s_flags & RVT_S_ANY_WAIT_SEND));
99
+}
91100
92101 /*
93102 * free_ahg - clear ahg from QP
....@@ -104,20 +113,6 @@
104113 }
105114
106115 /**
107
- * hfi1_create_qp - create a queue pair for a device
108
- * @ibpd: the protection domain who's device we create the queue pair for
109
- * @init_attr: the attributes of the queue pair
110
- * @udata: user data for libibverbs.so
111
- *
112
- * Returns the queue pair on success, otherwise returns an errno.
113
- *
114
- * Called by the ib_create_qp() core verbs function.
115
- */
116
-struct ib_qp *hfi1_create_qp(struct ib_pd *ibpd,
117
- struct ib_qp_init_attr *init_attr,
118
- struct ib_udata *udata);
119
-
120
-/**
121116 * hfi1_qp_wakeup - wake up on the indicated event
122117 * @qp: the QP
123118 * @flag: flag the qp on which the qp is stalled
....@@ -129,8 +124,8 @@
129124
130125 void qp_iter_print(struct seq_file *s, struct rvt_qp_iter *iter);
131126
132
-void _hfi1_schedule_send(struct rvt_qp *qp);
133
-void hfi1_schedule_send(struct rvt_qp *qp);
127
+bool _hfi1_schedule_send(struct rvt_qp *qp);
128
+bool hfi1_schedule_send(struct rvt_qp *qp);
134129
135130 void hfi1_migrate_qp(struct rvt_qp *qp);
136131
....@@ -150,4 +145,5 @@
150145 u32 mtu_from_qp(struct rvt_dev_info *rdi, struct rvt_qp *qp, u32 pmtu);
151146 int mtu_to_path_mtu(u32 mtu);
152147 void hfi1_error_port_qps(struct hfi1_ibport *ibp, u8 sl);
148
+void hfi1_qp_unbusy(struct rvt_qp *qp, struct iowait_work *wait);
153149 #endif /* _QP_H */