Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma

Pull rdma fixes from Jason Gunthorpe:
"Most noticeable is that Yishai found a big data corruption regression
due to a change in the scatterlist:

- Do not wrongly combine non-contiguous pages in scatterlist

- Fix compilation warnings on gcc 13

- Oops when using some mlx5 stats

- Bad enforcement of atomic responder resources in mlx5"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
lib/scatterlist: Fix to merge contiguous pages into the last SG properly
RDMA/mlx5: Fix validation of max_rd_atomic caps for DC
RDMA/mlx5: Fix mlx5_ib_get_hw_stats when used for device
RDMA/srp: Move large values to a new enum for gcc13

+44 -21
+3 -3
drivers/infiniband/hw/mlx5/counters.c
··· 278 278 const struct mlx5_ib_counters *cnts = get_counters(dev, port_num - 1); 279 279 struct mlx5_core_dev *mdev; 280 280 int ret, num_counters; 281 - u32 mdev_port_num; 282 281 283 282 if (!stats) 284 283 return -EINVAL; ··· 298 299 } 299 300 300 301 if (MLX5_CAP_GEN(dev->mdev, cc_query_allowed)) { 301 - mdev = mlx5_ib_get_native_port_mdev(dev, port_num, 302 - &mdev_port_num); 302 + if (!port_num) 303 + port_num = 1; 304 + mdev = mlx5_ib_get_native_port_mdev(dev, port_num, NULL); 303 305 if (!mdev) { 304 306 /* If port is not affiliated yet, its in down state 305 307 * which doesn't have any counters yet, so it would be
+35 -14
drivers/infiniband/hw/mlx5/qp.c
··· 4502 4502 return false; 4503 4503 } 4504 4504 4505 + static int validate_rd_atomic(struct mlx5_ib_dev *dev, struct ib_qp_attr *attr, 4506 + int attr_mask, enum ib_qp_type qp_type) 4507 + { 4508 + int log_max_ra_res; 4509 + int log_max_ra_req; 4510 + 4511 + if (qp_type == MLX5_IB_QPT_DCI) { 4512 + log_max_ra_res = 1 << MLX5_CAP_GEN(dev->mdev, 4513 + log_max_ra_res_dc); 4514 + log_max_ra_req = 1 << MLX5_CAP_GEN(dev->mdev, 4515 + log_max_ra_req_dc); 4516 + } else { 4517 + log_max_ra_res = 1 << MLX5_CAP_GEN(dev->mdev, 4518 + log_max_ra_res_qp); 4519 + log_max_ra_req = 1 << MLX5_CAP_GEN(dev->mdev, 4520 + log_max_ra_req_qp); 4521 + } 4522 + 4523 + if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC && 4524 + attr->max_rd_atomic > log_max_ra_res) { 4525 + mlx5_ib_dbg(dev, "invalid max_rd_atomic value %d\n", 4526 + attr->max_rd_atomic); 4527 + return false; 4528 + } 4529 + 4530 + if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC && 4531 + attr->max_dest_rd_atomic > log_max_ra_req) { 4532 + mlx5_ib_dbg(dev, "invalid max_dest_rd_atomic value %d\n", 4533 + attr->max_dest_rd_atomic); 4534 + return false; 4535 + } 4536 + return true; 4537 + } 4538 + 4505 4539 int mlx5_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, 4506 4540 int attr_mask, struct ib_udata *udata) 4507 4541 { ··· 4623 4589 goto out; 4624 4590 } 4625 4591 4626 - if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC && 4627 - attr->max_rd_atomic > 4628 - (1 << MLX5_CAP_GEN(dev->mdev, log_max_ra_res_qp))) { 4629 - mlx5_ib_dbg(dev, "invalid max_rd_atomic value %d\n", 4630 - attr->max_rd_atomic); 4592 + if (!validate_rd_atomic(dev, attr, attr_mask, qp_type)) 4631 4593 goto out; 4632 - } 4633 - 4634 - if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC && 4635 - attr->max_dest_rd_atomic > 4636 - (1 << MLX5_CAP_GEN(dev->mdev, log_max_ra_req_qp))) { 4637 - mlx5_ib_dbg(dev, "invalid max_dest_rd_atomic value %d\n", 4638 - attr->max_dest_rd_atomic); 4639 - goto out; 4640 - } 4641 4594 4642 4595 if (cur_state == new_state && cur_state == IB_QPS_RESET) { 4643 4596 err = 0;
+5 -3
drivers/infiniband/ulp/srp/ib_srp.h
··· 62 62 SRP_DEFAULT_CMD_SQ_SIZE = SRP_DEFAULT_QUEUE_SIZE - SRP_RSP_SQ_SIZE - 63 63 SRP_TSK_MGMT_SQ_SIZE, 64 64 65 - SRP_TAG_NO_REQ = ~0U, 66 - SRP_TAG_TSK_MGMT = 1U << 31, 67 - 68 65 SRP_MAX_PAGES_PER_MR = 512, 69 66 70 67 SRP_MAX_ADD_CDB_LEN = 16, ··· 74 77 SRP_IMM_DATA_OFFSET = sizeof(struct srp_cmd) + 75 78 SRP_MAX_ADD_CDB_LEN + 76 79 sizeof(struct srp_imm_buf), 80 + }; 81 + 82 + enum { 83 + SRP_TAG_NO_REQ = ~0U, 84 + SRP_TAG_TSK_MGMT = BIT(31), 77 85 }; 78 86 79 87 enum srp_target_state {
+1 -1
lib/scatterlist.c
··· 476 476 /* Merge contiguous pages into the last SG */ 477 477 prv_len = sgt_append->prv->length; 478 478 last_pg = sg_page(sgt_append->prv); 479 - while (n_pages && pages_are_mergeable(last_pg, pages[0])) { 479 + while (n_pages && pages_are_mergeable(pages[0], last_pg)) { 480 480 if (sgt_append->prv->length + PAGE_SIZE > max_segment) 481 481 break; 482 482 sgt_append->prv->length += PAGE_SIZE;