hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/infiniband/hw/qib/qib_qp.c
....@@ -1,5 +1,5 @@
11 /*
2
- * Copyright (c) 2012 - 2017 Intel Corporation. All rights reserved.
2
+ * Copyright (c) 2012 - 2019 Intel Corporation. All rights reserved.
33 * Copyright (c) 2006 - 2012 QLogic Corporation. * All rights reserved.
44 * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
55 *
....@@ -378,39 +378,36 @@
378378 * qib_check_send_wqe - validate wr/wqe
379379 * @qp - The qp
380380 * @wqe - The built wqe
381
+ * @call_send - Determine if the send should be posted or scheduled
381382 *
382
- * validate wr/wqe. This is called
383
- * prior to inserting the wqe into
384
- * the ring but after the wqe has been
385
- * setup.
386
- *
387
- * Returns 1 to force direct progress, 0 otherwise, -EINVAL on failure
383
+ * Returns 0 on success, -EINVAL on failure
388384 */
389385 int qib_check_send_wqe(struct rvt_qp *qp,
390
- struct rvt_swqe *wqe)
386
+ struct rvt_swqe *wqe, bool *call_send)
391387 {
392388 struct rvt_ah *ah;
393
- int ret = 0;
394389
395390 switch (qp->ibqp.qp_type) {
396391 case IB_QPT_RC:
397392 case IB_QPT_UC:
398393 if (wqe->length > 0x80000000U)
399394 return -EINVAL;
395
+ if (wqe->length > qp->pmtu)
396
+ *call_send = false;
400397 break;
401398 case IB_QPT_SMI:
402399 case IB_QPT_GSI:
403400 case IB_QPT_UD:
404
- ah = ibah_to_rvtah(wqe->ud_wr.ah);
401
+ ah = rvt_get_swqe_ah(wqe);
405402 if (wqe->length > (1 << ah->log_pmtu))
406403 return -EINVAL;
407404 /* progress hint */
408
- ret = 1;
405
+ *call_send = true;
409406 break;
410407 default:
411408 break;
412409 }
413
- return ret;
410
+ return 0;
414411 }
415412
416413 #ifdef CONFIG_DEBUG_FS