mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
RDMA v6.8 first rc
irdma and bnxt_re fixes:
- Missing error unwind in hf1
- For bnxt - fix fenching behavior to work on new chips, fail unsupported
SRQ resize back to userspace, propogate SRQ FW failure back to
userspace.
- Correctly fail unsupported SRQ resize back to userspace in bnxt
- Adjust a memcpy in mlx5 to not overflow a struct field.
- Prevent userspace from triggering mlx5 fw syndrome logging from sysfs
- Use the correct access mode for MLX5_IB_METHOD_DEVX_OBJ_MODIFY to avoid
a userspace failure on modify
- For irdma - Don't UAF a concurrent tasklet during destroy, prevent
userspace from issuing invalid QP attrs, fix a possible CQ overflow,
capture a missing HW async error event
- sendmsg() triggerable memory access crash in hfi1
- Fix the srpt_service_guid parameter to not crash due to missing function
pointer
- Don't leak objects in error unwind in qedr
- Don't weirdly cast function pointers in srpt
-----BEGIN PGP SIGNATURE-----
iHUEABYIAB0WIQRRRCHOFoQz/8F5bUaFwuHvBreFYQUCZdUweQAKCRCFwuHvBreF
YXH/AQCsg2hU9k0CiyDql2pW+fu+91bG4FFHed1zimdpzIrXcAEA1qcFIK+EWlPZ
HDxyvbp3dupmnH2QHjEQChzXt3EhdQk=
=+bP+
-----END PGP SIGNATURE-----
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Jason Gunthorpe:
"Mostly irdma and bnxt_re fixes:
- Missing error unwind in hf1
- For bnxt - fix fenching behavior to work on new chips, fail
unsupported SRQ resize back to userspace, propogate SRQ FW failure
back to userspace.
- Correctly fail unsupported SRQ resize back to userspace in bnxt
- Adjust a memcpy in mlx5 to not overflow a struct field.
- Prevent userspace from triggering mlx5 fw syndrome logging from
sysfs
- Use the correct access mode for MLX5_IB_METHOD_DEVX_OBJ_MODIFY to
avoid a userspace failure on modify
- For irdma - Don't UAF a concurrent tasklet during destroy, prevent
userspace from issuing invalid QP attrs, fix a possible CQ
overflow, capture a missing HW async error event
- sendmsg() triggerable memory access crash in hfi1
- Fix the srpt_service_guid parameter to not crash due to missing
function pointer
- Don't leak objects in error unwind in qedr
- Don't weirdly cast function pointers in srpt"
* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
RDMA/srpt: fix function pointer cast warnings
RDMA/qedr: Fix qedr_create_user_qp error flow
RDMA/srpt: Support specifying the srpt_service_guid parameter
IB/hfi1: Fix sdma.h tx->num_descs off-by-one error
RDMA/irdma: Add AE for too many RNRS
RDMA/irdma: Set the CQ read threshold for GEN 1
RDMA/irdma: Validate max_send_wr and max_recv_wr
RDMA/irdma: Fix KASAN issue with tasklet
RDMA/mlx5: Relax DEVX access upon modify commands
IB/mlx5: Don't expose debugfs entries for RRoCE general parameters if not supported
RDMA/mlx5: Fix fortify source warning while accessing Eth segment
RDMA/bnxt_re: Add a missing check in bnxt_qplib_query_srq
RDMA/bnxt_re: Return error for SRQ resize
RDMA/bnxt_re: Fix unconditional fence for newer adapters
RDMA/bnxt_re: Remove a redundant check inside bnxt_re_vf_res_config
RDMA/bnxt_re: Avoid creating fence MR for newer adapters
IB/hfi1: Fix a memleak in init_credit_return
This commit is contained in:
commit
9fc1ccccfd
|
|
@ -401,6 +401,10 @@ static void bnxt_re_create_fence_wqe(struct bnxt_re_pd *pd)
|
|||
struct bnxt_re_fence_data *fence = &pd->fence;
|
||||
struct ib_mr *ib_mr = &fence->mr->ib_mr;
|
||||
struct bnxt_qplib_swqe *wqe = &fence->bind_wqe;
|
||||
struct bnxt_re_dev *rdev = pd->rdev;
|
||||
|
||||
if (bnxt_qplib_is_chip_gen_p5_p7(rdev->chip_ctx))
|
||||
return;
|
||||
|
||||
memset(wqe, 0, sizeof(*wqe));
|
||||
wqe->type = BNXT_QPLIB_SWQE_TYPE_BIND_MW;
|
||||
|
|
@ -455,6 +459,9 @@ static void bnxt_re_destroy_fence_mr(struct bnxt_re_pd *pd)
|
|||
struct device *dev = &rdev->en_dev->pdev->dev;
|
||||
struct bnxt_re_mr *mr = fence->mr;
|
||||
|
||||
if (bnxt_qplib_is_chip_gen_p5_p7(rdev->chip_ctx))
|
||||
return;
|
||||
|
||||
if (fence->mw) {
|
||||
bnxt_re_dealloc_mw(fence->mw);
|
||||
fence->mw = NULL;
|
||||
|
|
@ -486,6 +493,9 @@ static int bnxt_re_create_fence_mr(struct bnxt_re_pd *pd)
|
|||
struct ib_mw *mw;
|
||||
int rc;
|
||||
|
||||
if (bnxt_qplib_is_chip_gen_p5_p7(rdev->chip_ctx))
|
||||
return 0;
|
||||
|
||||
dma_addr = dma_map_single(dev, fence->va, BNXT_RE_FENCE_BYTES,
|
||||
DMA_BIDIRECTIONAL);
|
||||
rc = dma_mapping_error(dev, dma_addr);
|
||||
|
|
@ -1817,7 +1827,7 @@ int bnxt_re_modify_srq(struct ib_srq *ib_srq, struct ib_srq_attr *srq_attr,
|
|||
switch (srq_attr_mask) {
|
||||
case IB_SRQ_MAX_WR:
|
||||
/* SRQ resize is not supported */
|
||||
break;
|
||||
return -EINVAL;
|
||||
case IB_SRQ_LIMIT:
|
||||
/* Change the SRQ threshold */
|
||||
if (srq_attr->srq_limit > srq->qplib_srq.max_wqe)
|
||||
|
|
@ -1832,13 +1842,12 @@ int bnxt_re_modify_srq(struct ib_srq *ib_srq, struct ib_srq_attr *srq_attr,
|
|||
/* On success, update the shadow */
|
||||
srq->srq_limit = srq_attr->srq_limit;
|
||||
/* No need to Build and send response back to udata */
|
||||
break;
|
||||
return 0;
|
||||
default:
|
||||
ibdev_err(&rdev->ibdev,
|
||||
"Unsupported srq_attr_mask 0x%x", srq_attr_mask);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bnxt_re_query_srq(struct ib_srq *ib_srq, struct ib_srq_attr *srq_attr)
|
||||
|
|
@ -2556,11 +2565,6 @@ static int bnxt_re_build_inv_wqe(const struct ib_send_wr *wr,
|
|||
wqe->type = BNXT_QPLIB_SWQE_TYPE_LOCAL_INV;
|
||||
wqe->local_inv.inv_l_key = wr->ex.invalidate_rkey;
|
||||
|
||||
/* Need unconditional fence for local invalidate
|
||||
* opcode to work as expected.
|
||||
*/
|
||||
wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_UC_FENCE;
|
||||
|
||||
if (wr->send_flags & IB_SEND_SIGNALED)
|
||||
wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_SIGNAL_COMP;
|
||||
if (wr->send_flags & IB_SEND_SOLICITED)
|
||||
|
|
@ -2583,12 +2587,6 @@ static int bnxt_re_build_reg_wqe(const struct ib_reg_wr *wr,
|
|||
wqe->frmr.levels = qplib_frpl->hwq.level;
|
||||
wqe->type = BNXT_QPLIB_SWQE_TYPE_REG_MR;
|
||||
|
||||
/* Need unconditional fence for reg_mr
|
||||
* opcode to function as expected.
|
||||
*/
|
||||
|
||||
wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_UC_FENCE;
|
||||
|
||||
if (wr->wr.send_flags & IB_SEND_SIGNALED)
|
||||
wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_SIGNAL_COMP;
|
||||
|
||||
|
|
@ -2719,6 +2717,18 @@ static int bnxt_re_post_send_shadow_qp(struct bnxt_re_dev *rdev,
|
|||
return rc;
|
||||
}
|
||||
|
||||
static void bnxt_re_legacy_set_uc_fence(struct bnxt_qplib_swqe *wqe)
|
||||
{
|
||||
/* Need unconditional fence for non-wire memory opcode
|
||||
* to work as expected.
|
||||
*/
|
||||
if (wqe->type == BNXT_QPLIB_SWQE_TYPE_LOCAL_INV ||
|
||||
wqe->type == BNXT_QPLIB_SWQE_TYPE_FAST_REG_MR ||
|
||||
wqe->type == BNXT_QPLIB_SWQE_TYPE_REG_MR ||
|
||||
wqe->type == BNXT_QPLIB_SWQE_TYPE_BIND_MW)
|
||||
wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_UC_FENCE;
|
||||
}
|
||||
|
||||
int bnxt_re_post_send(struct ib_qp *ib_qp, const struct ib_send_wr *wr,
|
||||
const struct ib_send_wr **bad_wr)
|
||||
{
|
||||
|
|
@ -2798,8 +2808,11 @@ int bnxt_re_post_send(struct ib_qp *ib_qp, const struct ib_send_wr *wr,
|
|||
rc = -EINVAL;
|
||||
goto bad;
|
||||
}
|
||||
if (!rc)
|
||||
if (!rc) {
|
||||
if (!bnxt_qplib_is_chip_gen_p5_p7(qp->rdev->chip_ctx))
|
||||
bnxt_re_legacy_set_uc_fence(&wqe);
|
||||
rc = bnxt_qplib_post_send(&qp->qplib_qp, &wqe);
|
||||
}
|
||||
bad:
|
||||
if (rc) {
|
||||
ibdev_err(&qp->rdev->ibdev,
|
||||
|
|
|
|||
|
|
@ -280,9 +280,6 @@ static void bnxt_re_set_resource_limits(struct bnxt_re_dev *rdev)
|
|||
|
||||
static void bnxt_re_vf_res_config(struct bnxt_re_dev *rdev)
|
||||
{
|
||||
|
||||
if (test_bit(BNXT_RE_FLAG_ERR_DEVICE_DETACHED, &rdev->flags))
|
||||
return;
|
||||
rdev->num_vfs = pci_sriov_get_totalvfs(rdev->en_dev->pdev);
|
||||
if (!bnxt_qplib_is_chip_gen_p5_p7(rdev->chip_ctx)) {
|
||||
bnxt_re_set_resource_limits(rdev);
|
||||
|
|
|
|||
|
|
@ -744,7 +744,8 @@ int bnxt_qplib_query_srq(struct bnxt_qplib_res *res,
|
|||
bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, &sbuf, sizeof(req),
|
||||
sizeof(resp), 0);
|
||||
rc = bnxt_qplib_rcfw_send_message(rcfw, &msg);
|
||||
srq->threshold = le16_to_cpu(sb->srq_limit);
|
||||
if (!rc)
|
||||
srq->threshold = le16_to_cpu(sb->srq_limit);
|
||||
dma_free_coherent(&rcfw->pdev->dev, sbuf.size,
|
||||
sbuf.sb, sbuf.dma_addr);
|
||||
|
||||
|
|
|
|||
|
|
@ -2086,7 +2086,7 @@ int init_credit_return(struct hfi1_devdata *dd)
|
|||
"Unable to allocate credit return DMA range for NUMA %d\n",
|
||||
i);
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
goto free_cr_base;
|
||||
}
|
||||
}
|
||||
set_dev_node(&dd->pcidev->dev, dd->node);
|
||||
|
|
@ -2094,6 +2094,10 @@ int init_credit_return(struct hfi1_devdata *dd)
|
|||
ret = 0;
|
||||
done:
|
||||
return ret;
|
||||
|
||||
free_cr_base:
|
||||
free_credit_return(dd);
|
||||
goto done;
|
||||
}
|
||||
|
||||
void free_credit_return(struct hfi1_devdata *dd)
|
||||
|
|
|
|||
|
|
@ -3158,7 +3158,7 @@ int _pad_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx)
|
|||
{
|
||||
int rval = 0;
|
||||
|
||||
if ((unlikely(tx->num_desc + 1 == tx->desc_limit))) {
|
||||
if ((unlikely(tx->num_desc == tx->desc_limit))) {
|
||||
rval = _extend_sdma_tx_descs(dd, tx);
|
||||
if (rval) {
|
||||
__sdma_txclean(dd, tx);
|
||||
|
|
|
|||
|
|
@ -346,6 +346,7 @@ enum irdma_cqp_op_type {
|
|||
#define IRDMA_AE_LLP_TOO_MANY_KEEPALIVE_RETRIES 0x050b
|
||||
#define IRDMA_AE_LLP_DOUBT_REACHABILITY 0x050c
|
||||
#define IRDMA_AE_LLP_CONNECTION_ESTABLISHED 0x050e
|
||||
#define IRDMA_AE_LLP_TOO_MANY_RNRS 0x050f
|
||||
#define IRDMA_AE_RESOURCE_EXHAUSTION 0x0520
|
||||
#define IRDMA_AE_RESET_SENT 0x0601
|
||||
#define IRDMA_AE_TERMINATE_SENT 0x0602
|
||||
|
|
|
|||
|
|
@ -387,6 +387,7 @@ static void irdma_process_aeq(struct irdma_pci_f *rf)
|
|||
case IRDMA_AE_LLP_TOO_MANY_RETRIES:
|
||||
case IRDMA_AE_LCE_QP_CATASTROPHIC:
|
||||
case IRDMA_AE_LCE_FUNCTION_CATASTROPHIC:
|
||||
case IRDMA_AE_LLP_TOO_MANY_RNRS:
|
||||
case IRDMA_AE_LCE_CQ_CATASTROPHIC:
|
||||
case IRDMA_AE_UDA_XMIT_DGRAM_TOO_LONG:
|
||||
default:
|
||||
|
|
@ -570,6 +571,13 @@ static void irdma_destroy_irq(struct irdma_pci_f *rf,
|
|||
dev->irq_ops->irdma_dis_irq(dev, msix_vec->idx);
|
||||
irq_update_affinity_hint(msix_vec->irq, NULL);
|
||||
free_irq(msix_vec->irq, dev_id);
|
||||
if (rf == dev_id) {
|
||||
tasklet_kill(&rf->dpc_tasklet);
|
||||
} else {
|
||||
struct irdma_ceq *iwceq = (struct irdma_ceq *)dev_id;
|
||||
|
||||
tasklet_kill(&iwceq->dpc_tasklet);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -839,7 +839,9 @@ static int irdma_validate_qp_attrs(struct ib_qp_init_attr *init_attr,
|
|||
|
||||
if (init_attr->cap.max_inline_data > uk_attrs->max_hw_inline ||
|
||||
init_attr->cap.max_send_sge > uk_attrs->max_hw_wq_frags ||
|
||||
init_attr->cap.max_recv_sge > uk_attrs->max_hw_wq_frags)
|
||||
init_attr->cap.max_recv_sge > uk_attrs->max_hw_wq_frags ||
|
||||
init_attr->cap.max_send_wr > uk_attrs->max_hw_wq_quanta ||
|
||||
init_attr->cap.max_recv_wr > uk_attrs->max_hw_rq_quanta)
|
||||
return -EINVAL;
|
||||
|
||||
if (rdma_protocol_roce(&iwdev->ibdev, 1)) {
|
||||
|
|
@ -2184,9 +2186,8 @@ static int irdma_create_cq(struct ib_cq *ibcq,
|
|||
info.cq_base_pa = iwcq->kmem.pa;
|
||||
}
|
||||
|
||||
if (dev->hw_attrs.uk_attrs.hw_rev >= IRDMA_GEN_2)
|
||||
info.shadow_read_threshold = min(info.cq_uk_init_info.cq_size / 2,
|
||||
(u32)IRDMA_MAX_CQ_READ_THRESH);
|
||||
info.shadow_read_threshold = min(info.cq_uk_init_info.cq_size / 2,
|
||||
(u32)IRDMA_MAX_CQ_READ_THRESH);
|
||||
|
||||
if (irdma_sc_cq_init(cq, &info)) {
|
||||
ibdev_dbg(&iwdev->ibdev, "VERBS: init cq fail\n");
|
||||
|
|
|
|||
|
|
@ -458,6 +458,12 @@ void mlx5_ib_init_cong_debugfs(struct mlx5_ib_dev *dev, u32 port_num)
|
|||
dbg_cc_params->root = debugfs_create_dir("cc_params", mlx5_debugfs_get_dev_root(mdev));
|
||||
|
||||
for (i = 0; i < MLX5_IB_DBG_CC_MAX; i++) {
|
||||
if ((i == MLX5_IB_DBG_CC_GENERAL_RTT_RESP_DSCP_VALID ||
|
||||
i == MLX5_IB_DBG_CC_GENERAL_RTT_RESP_DSCP))
|
||||
if (!MLX5_CAP_GEN(mdev, roce) ||
|
||||
!MLX5_CAP_ROCE(mdev, roce_cc_general))
|
||||
continue;
|
||||
|
||||
dbg_cc_params->params[i].offset = i;
|
||||
dbg_cc_params->params[i].dev = dev;
|
||||
dbg_cc_params->params[i].port_num = port_num;
|
||||
|
|
|
|||
|
|
@ -2949,7 +2949,7 @@ DECLARE_UVERBS_NAMED_METHOD(
|
|||
MLX5_IB_METHOD_DEVX_OBJ_MODIFY,
|
||||
UVERBS_ATTR_IDR(MLX5_IB_ATTR_DEVX_OBJ_MODIFY_HANDLE,
|
||||
UVERBS_IDR_ANY_OBJECT,
|
||||
UVERBS_ACCESS_WRITE,
|
||||
UVERBS_ACCESS_READ,
|
||||
UA_MANDATORY),
|
||||
UVERBS_ATTR_PTR_IN(
|
||||
MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_IN,
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ static void set_eth_seg(const struct ib_send_wr *wr, struct mlx5_ib_qp *qp,
|
|||
*/
|
||||
copysz = min_t(u64, *cur_edge - (void *)eseg->inline_hdr.start,
|
||||
left);
|
||||
memcpy(eseg->inline_hdr.start, pdata, copysz);
|
||||
memcpy(eseg->inline_hdr.data, pdata, copysz);
|
||||
stride = ALIGN(sizeof(struct mlx5_wqe_eth_seg) -
|
||||
sizeof(eseg->inline_hdr.start) + copysz, 16);
|
||||
*size += stride / 16;
|
||||
|
|
|
|||
|
|
@ -1879,8 +1879,17 @@ static int qedr_create_user_qp(struct qedr_dev *dev,
|
|||
/* RQ - read access only (0) */
|
||||
rc = qedr_init_user_queue(udata, dev, &qp->urq, ureq.rq_addr,
|
||||
ureq.rq_len, true, 0, alloc_and_init);
|
||||
if (rc)
|
||||
if (rc) {
|
||||
ib_umem_release(qp->usq.umem);
|
||||
qp->usq.umem = NULL;
|
||||
if (rdma_protocol_roce(&dev->ibdev, 1)) {
|
||||
qedr_free_pbl(dev, &qp->usq.pbl_info,
|
||||
qp->usq.pbl_tbl);
|
||||
} else {
|
||||
kfree(qp->usq.pbl_tbl);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
memset(&in_params, 0, sizeof(in_params));
|
||||
|
|
|
|||
|
|
@ -79,12 +79,16 @@ module_param(srpt_srq_size, int, 0444);
|
|||
MODULE_PARM_DESC(srpt_srq_size,
|
||||
"Shared receive queue (SRQ) size.");
|
||||
|
||||
static int srpt_set_u64_x(const char *buffer, const struct kernel_param *kp)
|
||||
{
|
||||
return kstrtou64(buffer, 16, (u64 *)kp->arg);
|
||||
}
|
||||
static int srpt_get_u64_x(char *buffer, const struct kernel_param *kp)
|
||||
{
|
||||
return sprintf(buffer, "0x%016llx\n", *(u64 *)kp->arg);
|
||||
}
|
||||
module_param_call(srpt_service_guid, NULL, srpt_get_u64_x, &srpt_service_guid,
|
||||
0444);
|
||||
module_param_call(srpt_service_guid, srpt_set_u64_x, srpt_get_u64_x,
|
||||
&srpt_service_guid, 0444);
|
||||
MODULE_PARM_DESC(srpt_service_guid,
|
||||
"Using this value for ioc_guid, id_ext, and cm_listen_id instead of using the node_guid of the first HCA.");
|
||||
|
||||
|
|
@ -210,10 +214,12 @@ static const char *get_ch_state_name(enum rdma_ch_state s)
|
|||
/**
|
||||
* srpt_qp_event - QP event callback function
|
||||
* @event: Description of the event that occurred.
|
||||
* @ch: SRPT RDMA channel.
|
||||
* @ptr: SRPT RDMA channel.
|
||||
*/
|
||||
static void srpt_qp_event(struct ib_event *event, struct srpt_rdma_ch *ch)
|
||||
static void srpt_qp_event(struct ib_event *event, void *ptr)
|
||||
{
|
||||
struct srpt_rdma_ch *ch = ptr;
|
||||
|
||||
pr_debug("QP event %d on ch=%p sess_name=%s-%d state=%s\n",
|
||||
event->event, ch, ch->sess_name, ch->qp->qp_num,
|
||||
get_ch_state_name(ch->state));
|
||||
|
|
@ -1807,8 +1813,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
|
|||
ch->cq_size = ch->rq_size + sq_size;
|
||||
|
||||
qp_init->qp_context = (void *)ch;
|
||||
qp_init->event_handler
|
||||
= (void(*)(struct ib_event *, void*))srpt_qp_event;
|
||||
qp_init->event_handler = srpt_qp_event;
|
||||
qp_init->send_cq = ch->cq;
|
||||
qp_init->recv_cq = ch->cq;
|
||||
qp_init->sq_sig_type = IB_SIGNAL_REQ_WR;
|
||||
|
|
|
|||
|
|
@ -1103,7 +1103,7 @@ struct mlx5_ifc_roce_cap_bits {
|
|||
u8 sw_r_roce_src_udp_port[0x1];
|
||||
u8 fl_rc_qp_when_roce_disabled[0x1];
|
||||
u8 fl_rc_qp_when_roce_enabled[0x1];
|
||||
u8 reserved_at_7[0x1];
|
||||
u8 roce_cc_general[0x1];
|
||||
u8 qp_ooo_transmit_default[0x1];
|
||||
u8 reserved_at_9[0x15];
|
||||
u8 qp_ts_format[0x2];
|
||||
|
|
|
|||
|
|
@ -269,7 +269,10 @@ struct mlx5_wqe_eth_seg {
|
|||
union {
|
||||
struct {
|
||||
__be16 sz;
|
||||
u8 start[2];
|
||||
union {
|
||||
u8 start[2];
|
||||
DECLARE_FLEX_ARRAY(u8, data);
|
||||
};
|
||||
} inline_hdr;
|
||||
struct {
|
||||
__be16 type;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user