* the ring but after the wqe has been
* setup.
*
- * Returns 0 on success, -EINVAL on failure
+ * Returns 1 to force direct progress, 0 otherwise, -EINVAL on failure
*/
int qib_check_send_wqe(struct rvt_qp *qp,
struct rvt_swqe *wqe)
{
struct rvt_ah *ah;
+ int ret = 0;
switch (qp->ibqp.qp_type) {
case IB_QPT_RC:
ah = ibah_to_rvtah(wqe->ud_wr.ah);
if (wqe->length > (1 << ah->log_pmtu))
return -EINVAL;
+ /* progress hint */
+ ret = 1;
break;
default:
break;
}
- return 0;
+ return ret;
}
#ifdef CONFIG_DEBUG_FS
* @qp: the QP to post on
* @wr: the work request to send
*/
-static int rvt_post_one_wr(struct rvt_qp *qp, struct ib_send_wr *wr)
+static int rvt_post_one_wr(struct rvt_qp *qp,
+ struct ib_send_wr *wr,
+ int *call_send)
{
struct rvt_swqe *wqe;
u32 next;
/* general part of wqe valid - allow for driver checks */
if (rdi->driver_f.check_send_wqe) {
ret = rdi->driver_f.check_send_wqe(qp, wqe);
- if (ret)
+ if (ret < 0)
goto bail_inval_free;
+ if (ret)
+ *call_send = ret;
}
log_pmtu = qp->log_pmtu;
call_send = qp->s_head == ACCESS_ONCE(qp->s_last) && !wr->next;
for (; wr; wr = wr->next) {
- err = rvt_post_one_wr(qp, wr);
+ err = rvt_post_one_wr(qp, wr, &call_send);
if (unlikely(err)) {
*bad_wr = wr;
goto bail;
struct sdma_txreq *stx,
unsigned seq);
static void iowait_wakeup(struct iowait *wait, int reason);
+static void qp_pio_drain(struct rvt_qp *qp);
static inline unsigned mk_qpn(struct rvt_qpn_table *qpt,
struct rvt_qpn_map *map, unsigned off)
default:
break;
}
- return 0;
+ return wqe->length <= piothreshold;
}
/**