AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/07/09 20:14 flow patch-triage
2m Args:
null

Results:
{
  "EnableConfigs": [
    "RDMA_RXE",
    "NVME_RDMA",
    "NVME_TARGET_RDMA",
    "RDS_RDMA",
    "INFINIBAND_IPOIB",
    "SUNRPC_XPRT_RDMA",
    "SMB_SERVER_SMBDIRECT",
    "CIFS_SMB_DIRECT"
  ],
  "FocusSymbols": [
    "rxe_qp_chk_init",
    "rxe_qp_chk_attr",
    "rxe_srq_chk_init",
    "rxe_srq_chk_attr",
    "nvme_rdma_create_queue_ib",
    "nvmet_rdma_queue_connect",
    "rds_ib_cm_handle_connect",
    "rds_ib_cm_initiate_connect",
    "ipoib_cm_dev_init",
    "frwr_query_device",
    "smbdirect_accept_connect_request"
  ],
  "Reasoning": "The patch changes the types of several fields in `struct ib_device_attr` from `int` to `u32`, and updates the corresponding `min_t` and `max_t` calls to `min` and `max` across the RDMA subsystem. This affects signedness in comparisons and fixes potential truncation bugs (e.g. using `min3(..., ..., U8_MAX)` instead of `min_t(u8, ...)`). These changes modify core RDMA logic and drivers, making it worth fuzzing.",
  "WorthFuzzing": true
}

1/1 2026/07/09 20:14 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit 1ab57071129f6279ae31db0ce614950c45b3f511\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Thu Jul 9 20:14:57 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c\nindex 3d7b6cddd131c4..ee98188e57fb5f 100644\n--- a/drivers/infiniband/core/cq.c\n+++ b/drivers/infiniband/core/cq.c\n@@ -393,8 +393,7 @@ static int ib_alloc_cqs(struct ib_device *dev, unsigned int nr_cqes,\n \t * a reasonable batch size so that we can share CQs between\n \t * multiple users instead of allocating a larger number of CQs.\n \t */\n-\tnr_cqes = min_t(unsigned int, dev-\u003eattrs.max_cqe,\n-\t\t\tmax(nr_cqes, IB_MAX_SHARED_CQ_SZ));\n+\tnr_cqes = min(dev-\u003eattrs.max_cqe, max(nr_cqes, IB_MAX_SHARED_CQ_SZ));\n \tnr_cqs = min_t(unsigned int, dev-\u003enum_comp_vectors, num_online_cpus());\n \tfor (i = 0; i \u003c nr_cqs; i++) {\n \t\tcq = ib_alloc_cq(dev, NULL, nr_cqes, i, poll_ctx);\ndiff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c\nindex f599c24b34e81b..aae4f3f6bcba14 100644\n--- a/drivers/infiniband/core/nldev.c\n+++ b/drivers/infiniband/core/nldev.c\n@@ -454,7 +454,8 @@ static int fill_res_info(struct sk_buff *msg, struct ib_device *device,\n \t};\n \n \tstruct nlattr *table_attr;\n-\tint ret, i, curr, max;\n+\tu64 curr, max;\n+\tint ret, i;\n \n \tif (fill_nldev_handle(msg, device))\n \t\treturn -EMSGSIZE;\ndiff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c\nindex cfee2071586c16..1b2f9df49e2896 100644\n--- a/drivers/infiniband/core/restrack.c\n+++ b/drivers/infiniband/core/restrack.c\n@@ -61,7 +61,7 @@ void rdma_restrack_clean(struct ib_device *dev)\n  * @type: actual type of object to operate\n  * @show_details: count driver specific objects\n  */\n-int rdma_restrack_count(struct ib_device *dev, enum rdma_restrack_type type,\n+u32 rdma_restrack_count(struct ib_device *dev, enum rdma_restrack_type type,\n \t\t\tbool show_details)\n {\n \tstruct rdma_restrack_root *rt = \u0026dev-\u003eres[type];\ndiff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c\nindex c90a1b5c8ee7d1..d5416b16134067 100644\n--- a/drivers/infiniband/hw/qedr/verbs.c\n+++ b/drivers/infiniband/hw/qedr/verbs.c\n@@ -148,7 +148,7 @@ int qedr_query_device(struct ib_device *ibdev,\n \tattr-\u003emax_qp_init_rd_atom =\n \t    1 \u003c\u003c (fls(qattr-\u003emax_qp_req_rd_atomic_resc) - 1);\n \tattr-\u003emax_qp_rd_atom =\n-\t    min(1 \u003c\u003c (fls(qattr-\u003emax_qp_resp_rd_atomic_resc) - 1),\n+\t    min(1U \u003c\u003c (fls(qattr-\u003emax_qp_resp_rd_atomic_resc) - 1),\n \t\tattr-\u003emax_qp_init_rd_atom);\n \n \tattr-\u003emax_srq = qattr-\u003emax_srq;\ndiff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c\nindex f3dff1aea96afc..7a0529a17992c8 100644\n--- a/drivers/infiniband/sw/rxe/rxe_qp.c\n+++ b/drivers/infiniband/sw/rxe/rxe_qp.c\n@@ -67,27 +67,27 @@ static int rxe_qp_chk_cap(struct rxe_dev *rxe, struct ib_qp_cap *cap,\n \t\t\t  int has_srq)\n {\n \tif (cap-\u003emax_send_wr \u003e rxe-\u003eattr.max_qp_wr) {\n-\t\trxe_dbg_dev(rxe, \"invalid send wr = %u \u003e %d\\n\",\n-\t\t\t cap-\u003emax_send_wr, rxe-\u003eattr.max_qp_wr);\n+\t\trxe_dbg_dev(rxe, \"invalid send wr = %u \u003e %u\\n\",\n+\t\t\t    cap-\u003emax_send_wr, rxe-\u003eattr.max_qp_wr);\n \t\tgoto err1;\n \t}\n \n \tif (cap-\u003emax_send_sge \u003e rxe-\u003eattr.max_send_sge) {\n-\t\trxe_dbg_dev(rxe, \"invalid send sge = %u \u003e %d\\n\",\n-\t\t\t cap-\u003emax_send_sge, rxe-\u003eattr.max_send_sge);\n+\t\trxe_dbg_dev(rxe, \"invalid send sge = %u \u003e %u\\n\",\n+\t\t\t    cap-\u003emax_send_sge, rxe-\u003eattr.max_send_sge);\n \t\tgoto err1;\n \t}\n \n \tif (!has_srq) {\n \t\tif (cap-\u003emax_recv_wr \u003e rxe-\u003eattr.max_qp_wr) {\n-\t\t\trxe_dbg_dev(rxe, \"invalid recv wr = %u \u003e %d\\n\",\n-\t\t\t\t cap-\u003emax_recv_wr, rxe-\u003eattr.max_qp_wr);\n+\t\t\trxe_dbg_dev(rxe, \"invalid recv wr = %u \u003e %u\\n\",\n+\t\t\t\t    cap-\u003emax_recv_wr, rxe-\u003eattr.max_qp_wr);\n \t\t\tgoto err1;\n \t\t}\n \n \t\tif (cap-\u003emax_recv_sge \u003e rxe-\u003eattr.max_recv_sge) {\n-\t\t\trxe_dbg_dev(rxe, \"invalid recv sge = %u \u003e %d\\n\",\n-\t\t\t\t cap-\u003emax_recv_sge, rxe-\u003eattr.max_recv_sge);\n+\t\t\trxe_dbg_dev(rxe, \"invalid recv sge = %u \u003e %u\\n\",\n+\t\t\t\t    cap-\u003emax_recv_sge, rxe-\u003eattr.max_recv_sge);\n \t\t\tgoto err1;\n \t\t}\n \t}\n@@ -537,9 +537,9 @@ int rxe_qp_chk_attr(struct rxe_dev *rxe, struct rxe_qp *qp,\n \n \tif (mask \u0026 IB_QP_MAX_QP_RD_ATOMIC) {\n \t\tif (attr-\u003emax_rd_atomic \u003e rxe-\u003eattr.max_qp_rd_atom) {\n-\t\t\trxe_dbg_qp(qp, \"invalid max_rd_atomic %d \u003e %d\\n\",\n-\t\t\t\t attr-\u003emax_rd_atomic,\n-\t\t\t\t rxe-\u003eattr.max_qp_rd_atom);\n+\t\t\trxe_dbg_qp(qp, \"invalid max_rd_atomic %u \u003e %u\\n\",\n+\t\t\t\t   attr-\u003emax_rd_atomic,\n+\t\t\t\t   rxe-\u003eattr.max_qp_rd_atom);\n \t\t\tgoto err1;\n \t\t}\n \t}\ndiff --git a/drivers/infiniband/sw/rxe/rxe_srq.c b/drivers/infiniband/sw/rxe/rxe_srq.c\nindex c9a7cd38953d31..74904a6fdf2b21 100644\n--- a/drivers/infiniband/sw/rxe/rxe_srq.c\n+++ b/drivers/infiniband/sw/rxe/rxe_srq.c\n@@ -13,8 +13,8 @@ int rxe_srq_chk_init(struct rxe_dev *rxe, struct ib_srq_init_attr *init)\n \tstruct ib_srq_attr *attr = \u0026init-\u003eattr;\n \n \tif (attr-\u003emax_wr \u003e rxe-\u003eattr.max_srq_wr) {\n-\t\trxe_dbg_dev(rxe, \"max_wr(%d) \u003e max_srq_wr(%d)\\n\",\n-\t\t\tattr-\u003emax_wr, rxe-\u003eattr.max_srq_wr);\n+\t\trxe_dbg_dev(rxe, \"max_wr(%u) \u003e max_srq_wr(%u)\\n\",\n+\t\t\t    attr-\u003emax_wr, rxe-\u003eattr.max_srq_wr);\n \t\tgoto err1;\n \t}\n \n@@ -27,8 +27,8 @@ int rxe_srq_chk_init(struct rxe_dev *rxe, struct ib_srq_init_attr *init)\n \t\tattr-\u003emax_wr = RXE_MIN_SRQ_WR;\n \n \tif (attr-\u003emax_sge \u003e rxe-\u003eattr.max_srq_sge) {\n-\t\trxe_dbg_dev(rxe, \"max_sge(%d) \u003e max_srq_sge(%d)\\n\",\n-\t\t\tattr-\u003emax_sge, rxe-\u003eattr.max_srq_sge);\n+\t\trxe_dbg_dev(rxe, \"max_sge(%u) \u003e max_srq_sge(%u)\\n\",\n+\t\t\t    attr-\u003emax_sge, rxe-\u003eattr.max_srq_sge);\n \t\tgoto err1;\n \t}\n \n@@ -107,8 +107,8 @@ int rxe_srq_chk_attr(struct rxe_dev *rxe, struct rxe_srq *srq,\n \n \tif (mask \u0026 IB_SRQ_MAX_WR) {\n \t\tif (attr-\u003emax_wr \u003e rxe-\u003eattr.max_srq_wr) {\n-\t\t\trxe_dbg_srq(srq, \"max_wr(%d) \u003e max_srq_wr(%d)\\n\",\n-\t\t\t\tattr-\u003emax_wr, rxe-\u003eattr.max_srq_wr);\n+\t\t\trxe_dbg_srq(srq, \"max_wr(%u) \u003e max_srq_wr(%u)\\n\",\n+\t\t\t\t    attr-\u003emax_wr, rxe-\u003eattr.max_srq_wr);\n \t\t\tgoto err1;\n \t\t}\n \n@@ -129,8 +129,8 @@ int rxe_srq_chk_attr(struct rxe_dev *rxe, struct rxe_srq *srq,\n \n \tif (mask \u0026 IB_SRQ_LIMIT) {\n \t\tif (attr-\u003esrq_limit \u003e rxe-\u003eattr.max_srq_wr) {\n-\t\t\trxe_dbg_srq(srq, \"srq_limit(%d) \u003e max_srq_wr(%d)\\n\",\n-\t\t\t\tattr-\u003esrq_limit, rxe-\u003eattr.max_srq_wr);\n+\t\t\trxe_dbg_srq(srq, \"srq_limit(%u) \u003e max_srq_wr(%u)\\n\",\n+\t\t\t\t    attr-\u003esrq_limit, rxe-\u003eattr.max_srq_wr);\n \t\t\tgoto err1;\n \t\t}\n \ndiff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c\nindex 57fec88a16290a..ed0592898384d3 100644\n--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c\n+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c\n@@ -1071,8 +1071,7 @@ static struct ib_qp *ipoib_cm_create_tx_qp(struct net_device *dev, struct ipoib_\n \tstruct ib_qp *tx_qp;\n \n \tif (dev-\u003efeatures \u0026 NETIF_F_SG)\n-\t\tattr.cap.max_send_sge = min_t(u32, priv-\u003eca-\u003eattrs.max_send_sge,\n-\t\t\t\t\t      MAX_SKB_FRAGS + 1);\n+\t\tattr.cap.max_send_sge = min(priv-\u003eca-\u003eattrs.max_send_sge, MAX_SKB_FRAGS + 1);\n \n \ttx_qp = ib_create_qp(priv-\u003epd, \u0026attr);\n \ttx-\u003emax_send_sge = attr.cap.max_send_sge;\n@@ -1582,7 +1581,8 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge)\n int ipoib_cm_dev_init(struct net_device *dev)\n {\n \tstruct ipoib_dev_priv *priv = ipoib_priv(dev);\n-\tint max_srq_sge, i;\n+\tu32 max_srq_sge;\n+\tint i;\n \tu8 addr;\n \n \tINIT_LIST_HEAD(\u0026priv-\u003ecm.passive_ids);\n@@ -1600,9 +1600,9 @@ int ipoib_cm_dev_init(struct net_device *dev)\n \n \tskb_queue_head_init(\u0026priv-\u003ecm.skb_queue);\n \n-\tipoib_dbg(priv, \"max_srq_sge=%d\\n\", priv-\u003eca-\u003eattrs.max_srq_sge);\n+\tipoib_dbg(priv, \"max_srq_sge=%u\\n\", priv-\u003eca-\u003eattrs.max_srq_sge);\n \n-\tmax_srq_sge = min_t(int, IPOIB_CM_RX_SG, priv-\u003eca-\u003eattrs.max_srq_sge);\n+\tmax_srq_sge = min(priv-\u003eca-\u003eattrs.max_srq_sge, IPOIB_CM_RX_SG);\n \tipoib_cm_create_srq(dev, max_srq_sge);\n \tif (ipoib_cm_has_srq(dev)) {\n \t\tpriv-\u003ecm.max_cm_mtu = max_srq_sge * PAGE_SIZE - 0x10;\ndiff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c\nindex 3ed1ea566690dd..2490696a1aabc8 100644\n--- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c\n+++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c\n@@ -147,8 +147,7 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)\n \t\t.cap = {\n \t\t\t.max_send_wr  = ipoib_sendq_size,\n \t\t\t.max_recv_wr  = ipoib_recvq_size,\n-\t\t\t.max_send_sge = min_t(u32, priv-\u003eca-\u003eattrs.max_send_sge,\n-\t\t\t\t\t      MAX_SKB_FRAGS + 1),\n+\t\t\t.max_send_sge = min(priv-\u003eca-\u003eattrs.max_send_sge, MAX_SKB_FRAGS + 1),\n \t\t\t.max_recv_sge = IPOIB_UD_RX_SG\n \t\t},\n \t\t.sq_sig_type = IB_SIGNAL_ALL_WR,\ndiff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c\nindex f03b3bb3c0c4c1..55fe68e5b8375e 100644\n--- a/drivers/infiniband/ulp/iser/iser_verbs.c\n+++ b/drivers/infiniband/ulp/iser/iser_verbs.c\n@@ -244,8 +244,7 @@ static int iser_create_ib_conn_res(struct ib_conn *ib_conn)\n \t\tmax_send_wr = ISER_QP_SIG_MAX_REQ_DTOS + 1;\n \telse\n \t\tmax_send_wr = ISER_QP_MAX_REQ_DTOS + 1;\n-\tmax_send_wr = min_t(unsigned int, max_send_wr,\n-\t\t\t    (unsigned int)ib_dev-\u003eattrs.max_qp_wr);\n+\tmax_send_wr = min(max_send_wr, ib_dev-\u003eattrs.max_qp_wr);\n \n \tcq_size = max_send_wr + ISER_QP_MAX_RECV_DTOS;\n \tib_conn-\u003ecq = ib_cq_pool_get(ib_dev, cq_size, -1, IB_POLL_SOFTIRQ);\n@@ -589,7 +588,7 @@ static void iser_route_handler(struct rdma_cm_id *cma_id)\n \t\tgoto failure;\n \n \tmemset(\u0026conn_param, 0, sizeof conn_param);\n-\tconn_param.responder_resources = ib_dev-\u003eattrs.max_qp_rd_atom;\n+\tconn_param.responder_resources = min(ib_dev-\u003eattrs.max_qp_rd_atom, U8_MAX);\n \tconn_param.initiator_depth = 1;\n \tconn_param.retry_count = 7;\n \tconn_param.rnr_retry_count = 6;\ndiff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c\nindex 1015a51f750af4..4691845bf815f9 100644\n--- a/drivers/infiniband/ulp/isert/ib_isert.c\n+++ b/drivers/infiniband/ulp/isert/ib_isert.c\n@@ -214,9 +214,9 @@ isert_create_device_ib_res(struct isert_device *device)\n \tstruct ib_device *ib_dev = device-\u003eib_device;\n \tint ret;\n \n-\tisert_dbg(\"devattr-\u003emax_send_sge: %d devattr-\u003emax_recv_sge %d\\n\",\n+\tisert_dbg(\"devattr-\u003emax_send_sge: %u devattr-\u003emax_recv_sge %u\\n\",\n \t\t  ib_dev-\u003eattrs.max_send_sge, ib_dev-\u003eattrs.max_recv_sge);\n-\tisert_dbg(\"devattr-\u003emax_sge_rd: %d\\n\", ib_dev-\u003eattrs.max_sge_rd);\n+\tisert_dbg(\"devattr-\u003emax_sge_rd: %u\\n\", ib_dev-\u003eattrs.max_sge_rd);\n \n \tdevice-\u003epd = ib_alloc_pd(ib_dev, 0);\n \tif (IS_ERR(device-\u003epd)) {\n@@ -381,8 +381,7 @@ isert_set_nego_params(struct isert_conn *isert_conn,\n \tstruct ib_device_attr *attr = \u0026isert_conn-\u003edevice-\u003eib_device-\u003eattrs;\n \n \t/* Set max inflight RDMA READ requests */\n-\tisert_conn-\u003einitiator_depth = min_t(u8, param-\u003einitiator_depth,\n-\t\t\t\tattr-\u003emax_qp_init_rd_atom);\n+\tisert_conn-\u003einitiator_depth = min(param-\u003einitiator_depth, attr-\u003emax_qp_init_rd_atom);\n \tisert_dbg(\"Using initiator_depth: %u\\n\", isert_conn-\u003einitiator_depth);\n \n \tif (param-\u003eprivate_data) {\ndiff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c\nindex d34d7e5f34d6f9..7b2c51ae614f81 100644\n--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c\n+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c\n@@ -1675,8 +1675,7 @@ static int create_con_cq_qp(struct rtrs_clt_con *con)\n \t\t * + 2 for drain and heartbeat\n \t\t * in case qp gets into error state.\n \t\t */\n-\t\tmax_send_wr =\n-\t\t\tmin_t(int, wr_limit, SERVICE_CON_QUEUE_DEPTH * 2 + 2);\n+\t\tmax_send_wr = min(wr_limit, SERVICE_CON_QUEUE_DEPTH * 2 + 2);\n \t\tmax_recv_wr = max_send_wr;\n \t} else {\n \t\t/*\n@@ -1692,11 +1691,9 @@ static int create_con_cq_qp(struct rtrs_clt_con *con)\n \t\twr_limit = clt_path-\u003es.dev-\u003eib_dev-\u003eattrs.max_qp_wr;\n \t\t/* Shared between connections */\n \t\tclt_path-\u003es.dev_ref++;\n-\t\tmax_send_wr = min_t(int, wr_limit,\n-\t\t\t      /* QD * (REQ + RSP + FR REGS or INVS) + drain */\n-\t\t\t      clt_path-\u003equeue_depth * 4 + 1);\n-\t\tmax_recv_wr = min_t(int, wr_limit,\n-\t\t\t      clt_path-\u003equeue_depth * 3 + 1);\n+\t\t/* QD * (REQ + RSP + FR REGS or INVS) + drain */\n+\t\tmax_send_wr = min(wr_limit, clt_path-\u003equeue_depth * 4 + 1);\n+\t\tmax_recv_wr = min(wr_limit, clt_path-\u003equeue_depth * 3 + 1);\n \t\tmax_send_sge = 2;\n \t}\n \tatomic_set(\u0026con-\u003ec.sq_wr_avail, max_send_wr);\ndiff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c\nindex 7d8e4422cc5731..5314599d29fe11 100644\n--- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c\n+++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c\n@@ -1740,21 +1740,16 @@ static int create_con(struct rtrs_srv_path *srv_path,\n \t\t * All receive and all send (each requiring invalidate)\n \t\t * + 2 for drain and heartbeat\n \t\t */\n-\t\tmax_send_wr = min_t(int, wr_limit,\n-\t\t\t\t    SERVICE_CON_QUEUE_DEPTH * 2 + 2);\n+\t\tmax_send_wr = min(wr_limit, SERVICE_CON_QUEUE_DEPTH * 2 + 2);\n \t\tmax_recv_wr = max_send_wr;\n \t\ts-\u003esignal_interval = min_not_zero(srv-\u003equeue_depth,\n \t\t\t\t\t\t  (size_t)SERVICE_CON_QUEUE_DEPTH);\n \t} else {\n \t\t/* when always_invlaidate enalbed, we need linv+rinv+mr+imm */\n \t\tif (always_invalidate)\n-\t\t\tmax_send_wr =\n-\t\t\t\tmin_t(int, wr_limit,\n-\t\t\t\t      srv-\u003equeue_depth * (1 + 4) + 1);\n+\t\t\tmax_send_wr = min(wr_limit, srv-\u003equeue_depth * (1 + 4) + 1);\n \t\telse\n-\t\t\tmax_send_wr =\n-\t\t\t\tmin_t(int, wr_limit,\n-\t\t\t\t      srv-\u003equeue_depth * (1 + 2) + 1);\n+\t\t\tmax_send_wr = min(wr_limit, srv-\u003equeue_depth * (1 + 2) + 1);\n \n \t\tmax_recv_wr = srv-\u003equeue_depth + 1;\n \t}\ndiff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c\nindex acbd787de265b5..0caebbc2810ff3 100644\n--- a/drivers/infiniband/ulp/srp/ib_srp.c\n+++ b/drivers/infiniband/ulp/srp/ib_srp.c\n@@ -557,7 +557,7 @@ static int srp_create_ch_ib(struct srp_rdma_ch *ch)\n \tinit_attr-\u003ecap.max_send_wr     = m * target-\u003equeue_size;\n \tinit_attr-\u003ecap.max_recv_wr     = target-\u003equeue_size + 1;\n \tinit_attr-\u003ecap.max_recv_sge    = 1;\n-\tinit_attr-\u003ecap.max_send_sge    = min(SRP_MAX_SGE, attr-\u003emax_send_sge);\n+\tinit_attr-\u003ecap.max_send_sge    = min(attr-\u003emax_send_sge, SRP_MAX_SGE);\n \tinit_attr-\u003esq_sig_type         = IB_SIGNAL_REQ_WR;\n \tinit_attr-\u003eqp_type             = IB_QPT_RC;\n \tinit_attr-\u003esend_cq             = send_cq;\ndiff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c\nindex f66cfd70c2636a..a760b4fbee90f4 100644\n--- a/drivers/infiniband/ulp/srpt/ib_srpt.c\n+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c\n@@ -77,8 +77,8 @@ module_param(srp_max_req_size, int, 0444);\n MODULE_PARM_DESC(srp_max_req_size,\n \t\t \"Maximum size of SRP request messages in bytes.\");\n \n-static int srpt_srq_size = DEFAULT_SRPT_SRQ_SIZE;\n-module_param(srpt_srq_size, int, 0444);\n+static unsigned int srpt_srq_size = DEFAULT_SRPT_SRQ_SIZE;\n+module_param(srpt_srq_size, uint, 0444);\n MODULE_PARM_DESC(srpt_srq_size,\n \t\t \"Shared receive queue (SRQ) size.\");\n \n@@ -405,8 +405,7 @@ static void srpt_get_ioc(struct srpt_port *sport, u32 slot,\n \tif (sdev-\u003euse_srq)\n \t\tsend_queue_depth = sdev-\u003esrq_size;\n \telse\n-\t\tsend_queue_depth = min(MAX_SRPT_RQ_SIZE,\n-\t\t\t\t       sdev-\u003edevice-\u003eattrs.max_qp_wr);\n+\t\tsend_queue_depth = min(sdev-\u003edevice-\u003eattrs.max_qp_wr, MAX_SRPT_RQ_SIZE);\n \n \tmemset(iocp, 0, sizeof(*iocp));\n \tstrcpy(iocp-\u003eid_string, SRPT_ID_STRING);\n@@ -1851,7 +1850,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)\n \tstruct srpt_port *sport = ch-\u003esport;\n \tstruct srpt_device *sdev = sport-\u003esdev;\n \tconst struct ib_device_attr *attrs = \u0026sdev-\u003edevice-\u003eattrs;\n-\tint sq_size = sport-\u003eport_attrib.srp_sq_size;\n+\tu32 sq_size = sport-\u003eport_attrib.srp_sq_size;\n \tint i, ret;\n \n \tWARN_ON(ch-\u003erq_size \u003c 1);\n@@ -1912,13 +1911,13 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)\n \t\tbool retry = sq_size \u003e MIN_SRPT_SQ_SIZE;\n \n \t\tif (retry) {\n-\t\t\tpr_debug(\"failed to create queue pair with sq_size = %d (%d) - retrying\\n\",\n+\t\t\tpr_debug(\"failed to create queue pair with sq_size = %u (%d) - retrying\\n\",\n \t\t\t\t sq_size, ret);\n \t\t\tib_cq_pool_put(ch-\u003ecq, ch-\u003ecq_size);\n \t\t\tsq_size = max(sq_size / 2, MIN_SRPT_SQ_SIZE);\n \t\t\tgoto retry;\n \t\t} else {\n-\t\t\tpr_err(\"failed to create queue pair with sq_size = %d (%d)\\n\",\n+\t\t\tpr_err(\"failed to create queue pair with sq_size = %u (%d)\\n\",\n \t\t\t       sq_size, ret);\n \t\t\tgoto err_destroy_cq;\n \t\t}\n@@ -1926,7 +1925,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)\n \n \tatomic_set(\u0026ch-\u003esq_wr_avail, qp_init-\u003ecap.max_send_wr);\n \n-\tpr_debug(\"%s: max_cqe= %d max_sge= %d sq_size = %d ch= %p\\n\",\n+\tpr_debug(\"%s: max_cqe= %d max_sge= %d sq_size = %u ch= %p\\n\",\n \t\t __func__, ch-\u003ecq-\u003ecqe, qp_init-\u003ecap.max_send_sge,\n \t\t qp_init-\u003ecap.max_send_wr, ch);\n \n@@ -2299,7 +2298,7 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev,\n \t * depth to avoid that the initiator driver has to report QUEUE_FULL\n \t * to the SCSI mid-layer.\n \t */\n-\tch-\u003erq_size = min(MAX_SRPT_RQ_SIZE, sdev-\u003edevice-\u003eattrs.max_qp_wr);\n+\tch-\u003erq_size = min(sdev-\u003edevice-\u003eattrs.max_qp_wr, MAX_SRPT_RQ_SIZE);\n \tspin_lock_init(\u0026ch-\u003espinlock);\n \tch-\u003estate = CH_CONNECTING;\n \tINIT_LIST_HEAD(\u0026ch-\u003ecmd_wait_list);\n@@ -3137,7 +3136,7 @@ static int srpt_alloc_srq(struct srpt_device *sdev)\n \t\treturn PTR_ERR(srq);\n \t}\n \n-\tpr_debug(\"create SRQ #wr= %d max_allow=%d dev= %s\\n\", sdev-\u003esrq_size,\n+\tpr_debug(\"create SRQ #wr= %d max_allow=%u dev= %s\\n\", sdev-\u003esrq_size,\n \t\t sdev-\u003edevice-\u003eattrs.max_srq_wr, dev_name(\u0026device-\u003edev));\n \n \tsdev-\u003ereq_buf_cache = srpt_cache_get(srp_max_req_size);\n@@ -3952,7 +3951,7 @@ static int __init srpt_init_module(void)\n \n \tif (srpt_srq_size \u003c MIN_SRPT_SRQ_SIZE\n \t    || srpt_srq_size \u003e MAX_SRPT_SRQ_SIZE) {\n-\t\tpr_err(\"invalid value %d for kernel module parameter srpt_srq_size -- must be in the range [%d..%d].\\n\",\n+\t\tpr_err(\"invalid value %u for kernel module parameter srpt_srq_size -- must be in the range [%d..%d].\\n\",\n \t\t       srpt_srq_size, MIN_SRPT_SRQ_SIZE, MAX_SRPT_SRQ_SIZE);\n \t\tgoto out;\n \t}\ndiff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c\nindex 6909e354279427..56cd228af1d57a 100644\n--- a/drivers/nvme/host/rdma.c\n+++ b/drivers/nvme/host/rdma.c\n@@ -394,8 +394,10 @@ nvme_rdma_find_get_device(struct rdma_cm_id *cm_id)\n \t\tgoto out_free_pd;\n \t}\n \n-\tndev-\u003enum_inline_segments = min(NVME_RDMA_MAX_INLINE_SEGMENTS,\n-\t\t\t\t\tndev-\u003edev-\u003eattrs.max_send_sge - 1);\n+\tndev-\u003enum_inline_segments = ndev-\u003edev-\u003eattrs.max_send_sge;\n+\tif (ndev-\u003enum_inline_segments)\n+\t\tndev-\u003enum_inline_segments--;\n+\tndev-\u003enum_inline_segments = min(ndev-\u003enum_inline_segments, NVME_RDMA_MAX_INLINE_SEGMENTS);\n \tlist_add(\u0026ndev-\u003eentry, \u0026device_list);\n out_unlock:\n \tmutex_unlock(\u0026device_list_mutex);\n@@ -1847,7 +1849,7 @@ static int nvme_rdma_route_resolved(struct nvme_rdma_queue *queue)\n \tparam.qp_num = queue-\u003eqp-\u003eqp_num;\n \tparam.flow_control = 1;\n \n-\tparam.responder_resources = queue-\u003edevice-\u003edev-\u003eattrs.max_qp_rd_atom;\n+\tparam.responder_resources = min(queue-\u003edevice-\u003edev-\u003eattrs.max_qp_rd_atom, U8_MAX);\n \t/* maximum retry count */\n \tparam.retry_count = 7;\n \tparam.rnr_retry_count = 7;\ndiff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c\nindex ea1185b8267ef2..bdd28ce99faac8 100644\n--- a/drivers/nvme/target/rdma.c\n+++ b/drivers/nvme/target/rdma.c\n@@ -149,10 +149,10 @@ MODULE_PARM_DESC(use_srq, \"Use shared receive queue.\");\n static int srq_size_set(const char *val, const struct kernel_param *kp);\n static const struct kernel_param_ops srq_size_ops = {\n \t.set = srq_size_set,\n-\t.get = param_get_int,\n+\t.get = param_get_uint,\n };\n \n-static int nvmet_rdma_srq_size = 1024;\n+static unsigned int nvmet_rdma_srq_size = 1024;\n module_param_cb(srq_size, \u0026srq_size_ops, \u0026nvmet_rdma_srq_size, 0644);\n MODULE_PARM_DESC(srq_size, \"set Shared Receive Queue (SRQ) size, should \u003e= 256 (default: 1024)\");\n \n@@ -180,13 +180,14 @@ static const struct nvmet_fabrics_ops nvmet_rdma_ops;\n \n static int srq_size_set(const char *val, const struct kernel_param *kp)\n {\n-\tint n = 0, ret;\n+\tunsigned int n;\n+\tint ret;\n \n-\tret = kstrtoint(val, 10, \u0026n);\n+\tret = kstrtouint(val, 10, \u0026n);\n \tif (ret != 0 || n \u003c 256)\n \t\treturn -EINVAL;\n \n-\treturn param_set_int(val, kp);\n+\treturn param_set_uint(val, kp);\n }\n \n static int num_pages(int len)\n@@ -1153,8 +1154,8 @@ static int nvmet_rdma_init_srqs(struct nvmet_rdma_device *ndev)\n \n \tndev-\u003esrq_size = min(ndev-\u003edevice-\u003eattrs.max_srq_wr,\n \t\t\t     nvmet_rdma_srq_size);\n-\tndev-\u003esrq_count = min(ndev-\u003edevice-\u003enum_comp_vectors,\n-\t\t\t      ndev-\u003edevice-\u003eattrs.max_srq);\n+\tndev-\u003esrq_count = min_t(u32, ndev-\u003edevice-\u003enum_comp_vectors,\n+\t\t\t\tndev-\u003edevice-\u003eattrs.max_srq);\n \n \tndev-\u003esrqs = kzalloc_objs(*ndev-\u003esrqs, ndev-\u003esrq_count);\n \tif (!ndev-\u003esrqs)\n@@ -1199,7 +1200,7 @@ nvmet_rdma_find_get_device(struct rdma_cm_id *cm_id)\n \tstruct nvmet_port *nport = port-\u003enport;\n \tstruct nvmet_rdma_device *ndev;\n \tint inline_page_count;\n-\tint inline_sge_count;\n+\tu32 inline_sge_count;\n \tint ret;\n \n \tmutex_lock(\u0026device_list_mutex);\n@@ -1215,7 +1216,9 @@ nvmet_rdma_find_get_device(struct rdma_cm_id *cm_id)\n \n \tinline_page_count = num_pages(nport-\u003einline_data_size);\n \tinline_sge_count = max(cm_id-\u003edevice-\u003eattrs.max_sge_rd,\n-\t\t\t\tcm_id-\u003edevice-\u003eattrs.max_recv_sge) - 1;\n+\t\t\t\tcm_id-\u003edevice-\u003eattrs.max_recv_sge);\n+\tif (inline_sge_count)\n+\t\tinline_sge_count--;\n \tif (inline_page_count \u003e inline_sge_count) {\n \t\tpr_warn(\"inline_data_size %d cannot be supported by device %s. Reducing to %lu.\\n\",\n \t\t\tnport-\u003einline_data_size, cm_id-\u003edevice-\u003ename,\n@@ -1555,8 +1558,9 @@ static int nvmet_rdma_cm_accept(struct rdma_cm_id *cm_id,\n \n \tparam.rnr_retry_count = 7;\n \tparam.flow_control = 1;\n-\tparam.initiator_depth = min_t(u8, p-\u003einitiator_depth,\n-\t\tqueue-\u003edev-\u003edevice-\u003eattrs.max_qp_init_rd_atom);\n+\tparam.initiator_depth = min3(p-\u003einitiator_depth,\n+\t\t\t\t     queue-\u003edev-\u003edevice-\u003eattrs.max_qp_init_rd_atom,\n+\t\t\t\t     U8_MAX);\n \tparam.private_data = \u0026priv;\n \tparam.private_data_len = sizeof(priv);\n \tpriv.recfmt = cpu_to_le16(NVME_RDMA_CM_FMT_1_0);\ndiff --git a/fs/smb/smbdirect/accept.c b/fs/smb/smbdirect/accept.c\nindex 5297400058385e..44b681a2072536 100644\n--- a/fs/smb/smbdirect/accept.c\n+++ b/fs/smb/smbdirect/accept.c\n@@ -32,8 +32,9 @@ int smbdirect_accept_connect_request(struct smbdirect_socket *sc,\n \t/*\n \t * First set what the we as server are able to support\n \t */\n-\tsp-\u003einitiator_depth = min_t(u8, sp-\u003einitiator_depth,\n-\t\t\t\t    sc-\u003eib.dev-\u003eattrs.max_qp_rd_atom);\n+\tsp-\u003einitiator_depth = min3(sp-\u003einitiator_depth,\n+\t\t\t\t   sc-\u003eib.dev-\u003eattrs.max_qp_rd_atom,\n+\t\t\t\t   U8_MAX);\n \n \tpeer_initiator_depth = param-\u003einitiator_depth;\n \tpeer_responder_resources = param-\u003eresponder_resources;\ndiff --git a/fs/smb/smbdirect/connect.c b/fs/smb/smbdirect/connect.c\nindex cd726b399afecb..34a3e72c38fbba 100644\n--- a/fs/smb/smbdirect/connect.c\n+++ b/fs/smb/smbdirect/connect.c\n@@ -182,8 +182,9 @@ static int smbdirect_connect_rdma_connect(struct smbdirect_socket *sc)\n \tif (sc-\u003eib.dev-\u003eattrs.kernel_cap_flags \u0026 IBK_SG_GAPS_REG)\n \t\tsc-\u003emr_io.type = IB_MR_TYPE_SG_GAPS;\n \n-\tsp-\u003eresponder_resources = min_t(u8, sp-\u003eresponder_resources,\n-\t\t\t\t\tsc-\u003eib.dev-\u003eattrs.max_qp_rd_atom);\n+\tsp-\u003eresponder_resources = min3(sp-\u003eresponder_resources,\n+\t\t\t\t       sc-\u003eib.dev-\u003eattrs.max_qp_rd_atom,\n+\t\t\t\t       U8_MAX);\n \tsmbdirect_log_rdma_mr(sc, SMBDIRECT_LOG_INFO,\n \t\t\"responder_resources=%d\\n\",\n \t\tsp-\u003eresponder_resources);\ndiff --git a/fs/smb/smbdirect/connection.c b/fs/smb/smbdirect/connection.c\nindex 8adf580975344b..690acb84e1b591 100644\n--- a/fs/smb/smbdirect/connection.c\n+++ b/fs/smb/smbdirect/connection.c\n@@ -287,7 +287,7 @@ int smbdirect_connection_create_qp(struct smbdirect_socket *sc)\n \t    qp_cap.max_send_wr \u003e sc-\u003eib.dev-\u003eattrs.max_qp_wr) {\n \t\tpr_err(\"Possible CQE overrun: max_send_wr %d\\n\",\n \t\t       qp_cap.max_send_wr);\n-\t\tpr_err(\"device %.*s reporting max_cqe %d max_qp_wr %d\\n\",\n+\t\tpr_err(\"device %.*s reporting max_cqe %u max_qp_wr %u\\n\",\n \t\t       IB_DEVICE_NAME_MAX,\n \t\t       sc-\u003eib.dev-\u003ename,\n \t\t       sc-\u003eib.dev-\u003eattrs.max_cqe,\n@@ -302,7 +302,7 @@ int smbdirect_connection_create_qp(struct smbdirect_socket *sc)\n \t     max_send_wr \u003e= sc-\u003eib.dev-\u003eattrs.max_qp_wr)) {\n \t\tpr_err(\"Possible CQE overrun: rdma_send_wr %d + max_send_wr %d = %d\\n\",\n \t\t       rdma_send_wr, qp_cap.max_send_wr, max_send_wr);\n-\t\tpr_err(\"device %.*s reporting max_cqe %d max_qp_wr %d\\n\",\n+\t\tpr_err(\"device %.*s reporting max_cqe %u max_qp_wr %u\\n\",\n \t\t       IB_DEVICE_NAME_MAX,\n \t\t       sc-\u003eib.dev-\u003ename,\n \t\t       sc-\u003eib.dev-\u003eattrs.max_cqe,\n@@ -316,7 +316,7 @@ int smbdirect_connection_create_qp(struct smbdirect_socket *sc)\n \t    qp_cap.max_recv_wr \u003e sc-\u003eib.dev-\u003eattrs.max_qp_wr) {\n \t\tpr_err(\"Possible CQE overrun: max_recv_wr %d\\n\",\n \t\t       qp_cap.max_recv_wr);\n-\t\tpr_err(\"device %.*s reporting max_cqe %d max_qp_wr %d\\n\",\n+\t\tpr_err(\"device %.*s reporting max_cqe %u max_qp_wr %u\\n\",\n \t\t       IB_DEVICE_NAME_MAX,\n \t\t       sc-\u003eib.dev-\u003ename,\n \t\t       sc-\u003eib.dev-\u003eattrs.max_cqe,\n@@ -328,7 +328,7 @@ int smbdirect_connection_create_qp(struct smbdirect_socket *sc)\n \n \tif (qp_cap.max_send_sge \u003e sc-\u003eib.dev-\u003eattrs.max_send_sge ||\n \t    qp_cap.max_recv_sge \u003e sc-\u003eib.dev-\u003eattrs.max_recv_sge) {\n-\t\tpr_err(\"device %.*s max_send_sge/max_recv_sge = %d/%d too small\\n\",\n+\t\tpr_err(\"device %.*s max_send_sge/max_recv_sge = %u/%u too small\\n\",\n \t\t       IB_DEVICE_NAME_MAX,\n \t\t       sc-\u003eib.dev-\u003ename,\n \t\t       sc-\u003eib.dev-\u003eattrs.max_send_sge,\ndiff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h\nindex 5aadb47b3b0e9a..76aa5ec4ab402d 100644\n--- a/include/linux/sunrpc/svc_rdma.h\n+++ b/include/linux/sunrpc/svc_rdma.h\n@@ -77,8 +77,8 @@ struct svcxprt_rdma {\n \tstruct rdma_cm_id    *sc_cm_id;\t\t/* RDMA connection id */\n \tstruct list_head     sc_accept_q;\t/* Conn. waiting accept */\n \tstruct rpcrdma_notification sc_rn;\t/* removal notification */\n-\tint\t\t     sc_ord;\t\t/* RDMA read limit */\n-\tint                  sc_max_send_sges;\n+\tu32\t\t     sc_ord;\t\t/* RDMA read limit */\n+\tunsigned int         sc_max_send_sges;\n \tbool\t\t     sc_snd_w_inv;\t/* OK to use Send With Invalidate */\n \n \tatomic_t             sc_sq_avail;\t/* SQEs ready to be consumed */\ndiff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h\nindex 794746de8db0ba..8d82d303b723a6 100644\n--- a/include/rdma/ib_verbs.h\n+++ b/include/rdma/ib_verbs.h\n@@ -407,36 +407,36 @@ struct ib_device_attr {\n \tu32\t\t\tvendor_id;\n \tu32\t\t\tvendor_part_id;\n \tu32\t\t\thw_ver;\n-\tint\t\t\tmax_qp;\n-\tint\t\t\tmax_qp_wr;\n+\tu32\t\t\tmax_qp;\n+\tu32\t\t\tmax_qp_wr;\n \tu64\t\t\tdevice_cap_flags;\n \tu64\t\t\tkernel_cap_flags;\n-\tint\t\t\tmax_send_sge;\n-\tint\t\t\tmax_recv_sge;\n-\tint\t\t\tmax_sge_rd;\n-\tint\t\t\tmax_cq;\n-\tint\t\t\tmax_cqe;\n-\tint\t\t\tmax_mr;\n-\tint\t\t\tmax_pd;\n-\tint\t\t\tmax_qp_rd_atom;\n-\tint\t\t\tmax_ee_rd_atom;\n-\tint\t\t\tmax_res_rd_atom;\n-\tint\t\t\tmax_qp_init_rd_atom;\n-\tint\t\t\tmax_ee_init_rd_atom;\n+\tu32\t\t\tmax_send_sge;\n+\tu32\t\t\tmax_recv_sge;\n+\tu32\t\t\tmax_sge_rd;\n+\tu32\t\t\tmax_cq;\n+\tu32\t\t\tmax_cqe;\n+\tu32\t\t\tmax_mr;\n+\tu32\t\t\tmax_pd;\n+\tu32\t\t\tmax_qp_rd_atom;\n+\tu32\t\t\tmax_ee_rd_atom;\n+\tu32\t\t\tmax_res_rd_atom;\n+\tu32\t\t\tmax_qp_init_rd_atom;\n+\tu32\t\t\tmax_ee_init_rd_atom;\n \tenum ib_atomic_cap\tatomic_cap;\n \tenum ib_atomic_cap\tmasked_atomic_cap;\n-\tint\t\t\tmax_ee;\n-\tint\t\t\tmax_rdd;\n-\tint\t\t\tmax_mw;\n-\tint\t\t\tmax_raw_ipv6_qp;\n-\tint\t\t\tmax_raw_ethy_qp;\n-\tint\t\t\tmax_mcast_grp;\n-\tint\t\t\tmax_mcast_qp_attach;\n-\tint\t\t\tmax_total_mcast_qp_attach;\n-\tint\t\t\tmax_ah;\n-\tint\t\t\tmax_srq;\n-\tint\t\t\tmax_srq_wr;\n-\tint\t\t\tmax_srq_sge;\n+\tu32\t\t\tmax_ee;\n+\tu32\t\t\tmax_rdd;\n+\tu32\t\t\tmax_mw;\n+\tu32\t\t\tmax_raw_ipv6_qp;\n+\tu32\t\t\tmax_raw_ethy_qp;\n+\tu32\t\t\tmax_mcast_grp;\n+\tu32\t\t\tmax_mcast_qp_attach;\n+\tu32\t\t\tmax_total_mcast_qp_attach;\n+\tu32\t\t\tmax_ah;\n+\tu32\t\t\tmax_srq;\n+\tu32\t\t\tmax_srq_wr;\n+\tu32\t\t\tmax_srq_sge;\n \tunsigned int\t\tmax_fast_reg_page_list_len;\n \tunsigned int\t\tmax_pi_fast_reg_page_list_len;\n \tu16\t\t\tmax_pkeys;\ndiff --git a/include/rdma/restrack.h b/include/rdma/restrack.h\nindex 451f99e3717d80..c081384740ce9e 100644\n--- a/include/rdma/restrack.h\n+++ b/include/rdma/restrack.h\n@@ -123,7 +123,7 @@ struct rdma_restrack_entry {\n \tu32 id;\n };\n \n-int rdma_restrack_count(struct ib_device *dev, enum rdma_restrack_type type,\n+u32 rdma_restrack_count(struct ib_device *dev, enum rdma_restrack_type type,\n \t\t\tbool show_details);\n /**\n  * rdma_is_kernel_res() - check the owner of resource\ndiff --git a/net/rds/ib.c b/net/rds/ib.c\nindex 39f87272e071bf..c62684d4259c4f 100644\n--- a/net/rds/ib.c\n+++ b/net/rds/ib.c\n@@ -162,12 +162,12 @@ static int rds_ib_add_one(struct ib_device *device)\n \t\t   IB_ODP_SUPPORT_READ);\n \n \trds_ibdev-\u003emax_1m_mrs = device-\u003eattrs.max_mr ?\n-\t\tmin_t(unsigned int, (device-\u003eattrs.max_mr / 2),\n-\t\t      rds_ib_mr_1m_pool_size) : rds_ib_mr_1m_pool_size;\n+\t\tmin(device-\u003eattrs.max_mr / 2,\n+\t\t    rds_ib_mr_1m_pool_size) : rds_ib_mr_1m_pool_size;\n \n \trds_ibdev-\u003emax_8k_mrs = device-\u003eattrs.max_mr ?\n-\t\tmin_t(unsigned int, ((device-\u003eattrs.max_mr / 2) * RDS_MR_8K_SCALE),\n-\t\t      rds_ib_mr_8k_pool_size) : rds_ib_mr_8k_pool_size;\n+\t\tmin((device-\u003eattrs.max_mr / 2) * RDS_MR_8K_SCALE,\n+\t\t    rds_ib_mr_8k_pool_size) : rds_ib_mr_8k_pool_size;\n \n \trds_ibdev-\u003emax_initiator_depth = device-\u003eattrs.max_qp_init_rd_atom;\n \trds_ibdev-\u003emax_responder_resources = device-\u003eattrs.max_qp_rd_atom;\n@@ -204,7 +204,7 @@ static int rds_ib_add_one(struct ib_device *device)\n \t\tgoto put_dev;\n \t}\n \n-\trdsdebug(\"RDS/IB: max_mr = %d, max_wrs = %d, max_sge = %d, max_1m_mrs = %d, max_8k_mrs = %d\\n\",\n+\trdsdebug(\"RDS/IB: max_mr = %u, max_wrs = %d, max_sge = %d, max_1m_mrs = %d, max_8k_mrs = %d\\n\",\n \t\t device-\u003eattrs.max_mr, rds_ibdev-\u003emax_wrs, rds_ibdev-\u003emax_sge,\n \t\t rds_ibdev-\u003emax_1m_mrs, rds_ibdev-\u003emax_8k_mrs);\n \ndiff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c\nindex 5667f0173b47f2..17e587c3007663 100644\n--- a/net/rds/ib_cm.c\n+++ b/net/rds/ib_cm.c\n@@ -173,11 +173,11 @@ static void rds_ib_cm_fill_conn_param(struct rds_connection *conn,\n \n \tmemset(conn_param, 0, sizeof(struct rdma_conn_param));\n \n-\tconn_param-\u003eresponder_resources =\n-\t\tmin_t(u32, rds_ibdev-\u003emax_responder_resources, max_responder_resources);\n-\tconn_param-\u003einitiator_depth =\n-\t\tmin_t(u32, rds_ibdev-\u003emax_initiator_depth, max_initiator_depth);\n-\tconn_param-\u003eretry_count = min_t(unsigned int, rds_ib_retry_count, 7);\n+\tconn_param-\u003eresponder_resources = min3(rds_ibdev-\u003emax_responder_resources,\n+\t\t\t\t\t       max_responder_resources, U8_MAX);\n+\tconn_param-\u003einitiator_depth = min3(rds_ibdev-\u003emax_initiator_depth,\n+\t\t\t\t\t   max_initiator_depth, U8_MAX);\n+\tconn_param-\u003eretry_count = min(rds_ib_retry_count, 7U);\n \tconn_param-\u003ernr_retry_count = 7;\n \n \tif (dp) {\ndiff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c\nindex e5c71cf705a33a..e83cef19e6569a 100644\n--- a/net/sunrpc/xprtrdma/frwr_ops.c\n+++ b/net/sunrpc/xprtrdma/frwr_ops.c\n@@ -172,8 +172,9 @@ int frwr_mr_init(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr *mr)\n int frwr_query_device(struct rpcrdma_ep *ep, const struct ib_device *device)\n {\n \tconst struct ib_device_attr *attrs = \u0026device-\u003eattrs;\n-\tint max_qp_wr, depth, delta;\n \tunsigned int max_sge;\n+\tu32 max_qp_wr;\n+\tint depth, delta;\n \n \tif (!(attrs-\u003edevice_cap_flags \u0026 IB_DEVICE_MEM_MGT_EXTENSIONS) ||\n \t    attrs-\u003emax_fast_reg_page_list_len == 0) {\n@@ -229,10 +230,10 @@ int frwr_query_device(struct rpcrdma_ep *ep, const struct ib_device *device)\n \t}\n \n \tmax_qp_wr = attrs-\u003emax_qp_wr;\n+\tif (max_qp_wr \u003c RPCRDMA_BACKWARD_WRS + 1 + RPCRDMA_MIN_SLOT_TABLE)\n+\t\treturn -ENOMEM;\n \tmax_qp_wr -= RPCRDMA_BACKWARD_WRS;\n \tmax_qp_wr -= 1;\n-\tif (max_qp_wr \u003c RPCRDMA_MIN_SLOT_TABLE)\n-\t\treturn -ENOMEM;\n \tif (ep-\u003ere_max_requests \u003e max_qp_wr)\n \t\tep-\u003ere_max_requests = max_qp_wr;\n \tep-\u003ere_attr.cap.max_send_wr = ep-\u003ere_max_requests * depth;\ndiff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c\nindex 7ca71741106b18..e0289adce7f5eb 100644\n--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c\n+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c\n@@ -562,8 +562,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)\n \tset_bit(RDMAXPRT_CONN_PENDING, \u0026newxprt-\u003esc_flags);\n \tmemset(\u0026conn_param, 0, sizeof conn_param);\n \tconn_param.responder_resources = 0;\n-\tconn_param.initiator_depth = min_t(int, newxprt-\u003esc_ord,\n-\t\t\t\t\t   dev-\u003eattrs.max_qp_init_rd_atom);\n+\tconn_param.initiator_depth = min(newxprt-\u003esc_ord, dev-\u003eattrs.max_qp_init_rd_atom);\n \tif (!conn_param.initiator_depth) {\n \t\tret = -EINVAL;\n \t\ttrace_svcrdma_initdepth_err(newxprt, ret);\n@@ -588,7 +587,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)\n \t\tdprintk(\"    local address   : %pIS:%u\\n\", sap, rpc_get_port(sap));\n \t\tsap = (struct sockaddr *)\u0026newxprt-\u003esc_cm_id-\u003eroute.addr.dst_addr;\n \t\tdprintk(\"    remote address  : %pIS:%u\\n\", sap, rpc_get_port(sap));\n-\t\tdprintk(\"    max_sge         : %d\\n\", newxprt-\u003esc_max_send_sges);\n+\t\tdprintk(\"    max_sge         : %u\\n\", newxprt-\u003esc_max_send_sges);\n \t\tdprintk(\"    sq_depth        : %d\\n\", newxprt-\u003esc_sq_depth);\n \t\tdprintk(\"    rdma_rw_ctxs    : %d\\n\", ctxts);\n \t\tdprintk(\"    max_requests    : %d\\n\", newxprt-\u003esc_max_requests);\ndiff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c\nindex 04b286223b24c2..be335eed329d1e 100644\n--- a/net/sunrpc/xprtrdma/verbs.c\n+++ b/net/sunrpc/xprtrdma/verbs.c\n@@ -465,7 +465,7 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt)\n \t/* Client offers RDMA Read but does not initiate */\n \tep-\u003ere_remote_cma.initiator_depth = 0;\n \tep-\u003ere_remote_cma.responder_resources =\n-\t\tmin_t(int, U8_MAX, device-\u003eattrs.max_qp_rd_atom);\n+\t\tmin(device-\u003eattrs.max_qp_rd_atom, U8_MAX);\n \n \t/* Limit transport retries so client can detect server\n \t * GID changes quickly. RPC layer handles re-establishing\n"
}

2/1 2026/07/09 20:15 agent patch-evaluator
2m Model:
gemini-3.1-pro-preview

Args:
null

Results:
{
  "EnableConfigs": [
    "RDMA_RXE",
    "NVME_RDMA",
    "NVME_TARGET_RDMA",
    "RDS_RDMA",
    "INFINIBAND_IPOIB",
    "SUNRPC_XPRT_RDMA",
    "SMB_SERVER_SMBDIRECT",
    "CIFS_SMB_DIRECT"
  ],
  "FocusSymbols": [
    "rxe_qp_chk_init",
    "rxe_qp_chk_attr",
    "rxe_srq_chk_init",
    "rxe_srq_chk_attr",
    "nvme_rdma_create_queue_ib",
    "nvmet_rdma_queue_connect",
    "rds_ib_cm_handle_connect",
    "rds_ib_cm_initiate_connect",
    "ipoib_cm_dev_init",
    "frwr_query_device",
    "smbdirect_accept_connect_request"
  ],
  "Reasoning": "The patch changes the types of several fields in `struct ib_device_attr` from `int` to `u32`, and updates the corresponding `min_t` and `max_t` calls to `min` and `max` across the RDMA subsystem. This affects signedness in comparisons and fixes potential truncation bugs (e.g. using `min3(..., ..., U8_MAX)` instead of `min_t(u8, ...)`). These changes modify core RDMA logic and drivers, making it worth fuzzing.",
  "WorthFuzzing": true
}

Instruction:
You are an expert Linux kernel maintainer.
Your job is to review a provided patch series and determine
if it makes functional changes to the kernel that should be fuzzed.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively
use your code access tools to examine the actual source code and confirm any assumptions.

Return WorthFuzzing=false if the patch only contains:
- Modifications to Documentation/, Kconfig files, or code comments.
- Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints.
- Changes to numeric constants or macros that do not functionally alter execution flow.
- Code paths that are impossible to reach in virtualized environments like GCE or QEMU,
even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim).

If it modifies reachable core kernel logic, drivers, or architectures, use your code search
tools to verify the code can be executed, then return WorthFuzzing=true.

When returning WorthFuzzing=true, you MUST ALSO:
1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols.
   Avoid listing generic hot-path functions to prevent skewed test distributions.
2. Identify any specific CONFIG_ options required to properly test this new/modified feature.
   Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions.
   Do not list too generic configs (we already have them enabled). Only list those that
   specifically cover the modified code. List them in the EnableConfigs output array,
   and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
For your convenience, here is the diff of the changes:
commit 1ab57071129f6279ae31db0ce614950c45b3f511
Author: syz-cluster <triage@syzkaller.com>
Date:   Thu Jul 9 20:14:57 2026 +0000

    syz-cluster: applied patch under review

diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c
index 3d7b6cddd131c4..ee98188e57fb5f 100644
--- a/drivers/infiniband/core/cq.c
+++ b/drivers/infiniband/core/cq.c
@@ -393,8 +393,7 @@ static int ib_alloc_cqs(struct ib_device *dev, unsigned int nr_cqes,
 	 * a reasonable batch size so that we can share CQs between
 	 * multiple users instead of allocating a larger number of CQs.
 	 */
-	nr_cqes = min_t(unsigned int, dev->attrs.max_cqe,
-			max(nr_cqes, IB_MAX_SHARED_CQ_SZ));
+	nr_cqes = min(dev->attrs.max_cqe, max(nr_cqes, IB_MAX_SHARED_CQ_SZ));
 	nr_cqs = min_t(unsigned int, dev->num_comp_vectors, num_online_cpus());
 	for (i = 0; i < nr_cqs; i++) {
 		cq = ib_alloc_cq(dev, NULL, nr_cqes, i, poll_ctx);
diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index f599c24b34e81b..aae4f3f6bcba14 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -454,7 +454,8 @@ static int fill_res_info(struct sk_buff *msg, struct ib_device *device,
 	};
 
 	struct nlattr *table_attr;
-	int ret, i, curr, max;
+	u64 curr, max;
+	int ret, i;
 
 	if (fill_nldev_handle(msg, device))
 		return -EMSGSIZE;
diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c
index cfee2071586c16..1b2f9df49e2896 100644
--- a/drivers/infiniband/core/restrack.c
+++ b/drivers/infiniband/core/restrack.c
@@ -61,7 +61,7 @@ void rdma_restrack_clean(struct ib_device *dev)
  * @type: actual type of object to operate
  * @show_details: count driver specific objects
  */
-int rdma_restrack_count(struct ib_device *dev, enum rdma_restrack_type type,
+u32 rdma_restrack_count(struct ib_device *dev, enum rdma_restrack_type type,
 			bool show_details)
 {
 	struct rdma_restrack_root *rt = &dev->res[type];
diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c
index c90a1b5c8ee7d1..d5416b16134067 100644
--- a/drivers/infiniband/hw/qedr/verbs.c
+++ b/drivers/infiniband/hw/qedr/verbs.c
@@ -148,7 +148,7 @@ int qedr_query_device(struct ib_device *ibdev,
 	attr->max_qp_init_rd_atom =
 	    1 << (fls(qattr->max_qp_req_rd_atomic_resc) - 1);
 	attr->max_qp_rd_atom =
-	    min(1 << (fls(qattr->max_qp_resp_rd_atomic_resc) - 1),
+	    min(1U << (fls(qattr->max_qp_resp_rd_atomic_resc) - 1),
 		attr->max_qp_init_rd_atom);
 
 	attr->max_srq = qattr->max_srq;
diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
index f3dff1aea96afc..7a0529a17992c8 100644
--- a/drivers/infiniband/sw/rxe/rxe_qp.c
+++ b/drivers/infiniband/sw/rxe/rxe_qp.c
@@ -67,27 +67,27 @@ static int rxe_qp_chk_cap(struct rxe_dev *rxe, struct ib_qp_cap *cap,
 			  int has_srq)
 {
 	if (cap->max_send_wr > rxe->attr.max_qp_wr) {
-		rxe_dbg_dev(rxe, "invalid send wr = %u > %d\n",
-			 cap->max_send_wr, rxe->attr.max_qp_wr);
+		rxe_dbg_dev(rxe, "invalid send wr = %u > %u\n",
+			    cap->max_send_wr, rxe->attr.max_qp_wr);
 		goto err1;
 	}
 
 	if (cap->max_send_sge > rxe->attr.max_send_sge) {
-		rxe_dbg_dev(rxe, "invalid send sge = %u > %d\n",
-			 cap->max_send_sge, rxe->attr.max_send_sge);
+		rxe_dbg_dev(rxe, "invalid send sge = %u > %u\n",
+			    cap->max_send_sge, rxe->attr.max_send_sge);
 		goto err1;
 	}
 
 	if (!has_srq) {
 		if (cap->max_recv_wr > rxe->attr.max_qp_wr) {
-			rxe_dbg_dev(rxe, "invalid recv wr = %u > %d\n",
-				 cap->max_recv_wr, rxe->attr.max_qp_wr);
+			rxe_dbg_dev(rxe, "invalid recv wr = %u > %u\n",
+				    cap->max_recv_wr, rxe->attr.max_qp_wr);
 			goto err1;
 		}
 
 		if (cap->max_recv_sge > rxe->attr.max_recv_sge) {
-			rxe_dbg_dev(rxe, "invalid recv sge = %u > %d\n",
-				 cap->max_recv_sge, rxe->attr.max_recv_sge);
+			rxe_dbg_dev(rxe, "invalid recv sge = %u > %u\n",
+				    cap->max_recv_sge, rxe->attr.max_recv_sge);
 			goto err1;
 		}
 	}
@@ -537,9 +537,9 @@ int rxe_qp_chk_attr(struct rxe_dev *rxe, struct rxe_qp *qp,
 
 	if (mask & IB_QP_MAX_QP_RD_ATOMIC) {
 		if (attr->max_rd_atomic > rxe->attr.max_qp_rd_atom) {
-			rxe_dbg_qp(qp, "invalid max_rd_atomic %d > %d\n",
-				 attr->max_rd_atomic,
-				 rxe->attr.max_qp_rd_atom);
+			rxe_dbg_qp(qp, "invalid max_rd_atomic %u > %u\n",
+				   attr->max_rd_atomic,
+				   rxe->attr.max_qp_rd_atom);
 			goto err1;
 		}
 	}
diff --git a/drivers/infiniband/sw/rxe/rxe_srq.c b/drivers/infiniband/sw/rxe/rxe_srq.c
index c9a7cd38953d31..74904a6fdf2b21 100644
--- a/drivers/infiniband/sw/rxe/rxe_srq.c
+++ b/drivers/infiniband/sw/rxe/rxe_srq.c
@@ -13,8 +13,8 @@ int rxe_srq_chk_init(struct rxe_dev *rxe, struct ib_srq_init_attr *init)
 	struct ib_srq_attr *attr = &init->attr;
 
 	if (attr->max_wr > rxe->attr.max_srq_wr) {
-		rxe_dbg_dev(rxe, "max_wr(%d) > max_srq_wr(%d)\n",
-			attr->max_wr, rxe->attr.max_srq_wr);
+		rxe_dbg_dev(rxe, "max_wr(%u) > max_srq_wr(%u)\n",
+			    attr->max_wr, rxe->attr.max_srq_wr);
 		goto err1;
 	}
 
@@ -27,8 +27,8 @@ int rxe_srq_chk_init(struct rxe_dev *rxe, struct ib_srq_init_attr *init)
 		attr->max_wr = RXE_MIN_SRQ_WR;
 
 	if (attr->max_sge > rxe->attr.max_srq_sge) {
-		rxe_dbg_dev(rxe, "max_sge(%d) > max_srq_sge(%d)\n",
-			attr->max_sge, rxe->attr.max_srq_sge);
+		rxe_dbg_dev(rxe, "max_sge(%u) > max_srq_sge(%u)\n",
+			    attr->max_sge, rxe->attr.max_srq_sge);
 		goto err1;
 	}
 
@@ -107,8 +107,8 @@ int rxe_srq_chk_attr(struct rxe_dev *rxe, struct rxe_srq *srq,
 
 	if (mask & IB_SRQ_MAX_WR) {
 		if (attr->max_wr > rxe->attr.max_srq_wr) {
-			rxe_dbg_srq(srq, "max_wr(%d) > max_srq_wr(%d)\n",
-				attr->max_wr, rxe->attr.max_srq_wr);
+			rxe_dbg_srq(srq, "max_wr(%u) > max_srq_wr(%u)\n",
+				    attr->max_wr, rxe->attr.max_srq_wr);
 			goto err1;
 		}
 
@@ -129,8 +129,8 @@ int rxe_srq_chk_attr(struct rxe_dev *rxe, struct rxe_srq *srq,
 
 	if (mask & IB_SRQ_LIMIT) {
 		if (attr->srq_limit > rxe->attr.max_srq_wr) {
-			rxe_dbg_srq(srq, "srq_limit(%d) > max_srq_wr(%d)\n",
-				attr->srq_limit, rxe->attr.max_srq_wr);
+			rxe_dbg_srq(srq, "srq_limit(%u) > max_srq_wr(%u)\n",
+				    attr->srq_limit, rxe->attr.max_srq_wr);
 			goto err1;
 		}
 
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 57fec88a16290a..ed0592898384d3 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1071,8 +1071,7 @@ static struct ib_qp *ipoib_cm_create_tx_qp(struct net_device *dev, struct ipoib_
 	struct ib_qp *tx_qp;
 
 	if (dev->features & NETIF_F_SG)
-		attr.cap.max_send_sge = min_t(u32, priv->ca->attrs.max_send_sge,
-					      MAX_SKB_FRAGS + 1);
+		attr.cap.max_send_sge = min(priv->ca->attrs.max_send_sge, MAX_SKB_FRAGS + 1);
 
 	tx_qp = ib_create_qp(priv->pd, &attr);
 	tx->max_send_sge = attr.cap.max_send_sge;
@@ -1582,7 +1581,8 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge)
 int ipoib_cm_dev_init(struct net_device *dev)
 {
 	struct ipoib_dev_priv *priv = ipoib_priv(dev);
-	int max_srq_sge, i;
+	u32 max_srq_sge;
+	int i;
 	u8 addr;
 
 	INIT_LIST_HEAD(&priv->cm.passive_ids);
@@ -1600,9 +1600,9 @@ int ipoib_cm_dev_init(struct net_device *dev)
 
 	skb_queue_head_init(&priv->cm.skb_queue);
 
-	ipoib_dbg(priv, "max_srq_sge=%d\n", priv->ca->attrs.max_srq_sge);
+	ipoib_dbg(priv, "max_srq_sge=%u\n", priv->ca->attrs.max_srq_sge);
 
-	max_srq_sge = min_t(int, IPOIB_CM_RX_SG, priv->ca->attrs.max_srq_sge);
+	max_srq_sge = min(priv->ca->attrs.max_srq_sge, IPOIB_CM_RX_SG);
 	ipoib_cm_create_srq(dev, max_srq_sge);
 	if (ipoib_cm_has_srq(dev)) {
 		priv->cm.max_cm_mtu = max_srq_sge * PAGE_SIZE - 0x10;
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
index 3ed1ea566690dd..2490696a1aabc8 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
@@ -147,8 +147,7 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)
 		.cap = {
 			.max_send_wr  = ipoib_sendq_size,
 			.max_recv_wr  = ipoib_recvq_size,
-			.max_send_sge = min_t(u32, priv->ca->attrs.max_send_sge,
-					      MAX_SKB_FRAGS + 1),
+			.max_send_sge = min(priv->ca->attrs.max_send_sge, MAX_SKB_FRAGS + 1),
 			.max_recv_sge = IPOIB_UD_RX_SG
 		},
 		.sq_sig_type = IB_SIGNAL_ALL_WR,
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index f03b3bb3c0c4c1..55fe68e5b8375e 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -244,8 +244,7 @@ static int iser_create_ib_conn_res(struct ib_conn *ib_conn)
 		max_send_wr = ISER_QP_SIG_MAX_REQ_DTOS + 1;
 	else
 		max_send_wr = ISER_QP_MAX_REQ_DTOS + 1;
-	max_send_wr = min_t(unsigned int, max_send_wr,
-			    (unsigned int)ib_dev->attrs.max_qp_wr);
+	max_send_wr = min(max_send_wr, ib_dev->attrs.max_qp_wr);
 
 	cq_size = max_send_wr + ISER_QP_MAX_RECV_DTOS;
 	ib_conn->cq = ib_cq_pool_get(ib_dev, cq_size, -1, IB_POLL_SOFTIRQ);
@@ -589,7 +588,7 @@ static void iser_route_handler(struct rdma_cm_id *cma_id)
 		goto failure;
 
 	memset(&conn_param, 0, sizeof conn_param);
-	conn_param.responder_resources = ib_dev->attrs.max_qp_rd_atom;
+	conn_param.responder_resources = min(ib_dev->attrs.max_qp_rd_atom, U8_MAX);
 	conn_param.initiator_depth = 1;
 	conn_param.retry_count = 7;
 	conn_param.rnr_retry_count = 6;
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 1015a51f750af4..4691845bf815f9 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -214,9 +214,9 @@ isert_create_device_ib_res(struct isert_device *device)
 	struct ib_device *ib_dev = device->ib_device;
 	int ret;
 
-	isert_dbg("devattr->max_send_sge: %d devattr->max_recv_sge %d\n",
+	isert_dbg("devattr->max_send_sge: %u devattr->max_recv_sge %u\n",
 		  ib_dev->attrs.max_send_sge, ib_dev->attrs.max_recv_sge);
-	isert_dbg("devattr->max_sge_rd: %d\n", ib_dev->attrs.max_sge_rd);
+	isert_dbg("devattr->max_sge_rd: %u\n", ib_dev->attrs.max_sge_rd);
 
 	device->pd = ib_alloc_pd(ib_dev, 0);
 	if (IS_ERR(device->pd)) {
@@ -381,8 +381,7 @@ isert_set_nego_params(struct isert_conn *isert_conn,
 	struct ib_device_attr *attr = &isert_conn->device->ib_device->attrs;
 
 	/* Set max inflight RDMA READ requests */
-	isert_conn->initiator_depth = min_t(u8, param->initiator_depth,
-				attr->max_qp_init_rd_atom);
+	isert_conn->initiator_depth = min(param->initiator_depth, attr->max_qp_init_rd_atom);
 	isert_dbg("Using initiator_depth: %u\n", isert_conn->initiator_depth);
 
 	if (param->private_data) {
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
index d34d7e5f34d6f9..7b2c51ae614f81 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
@@ -1675,8 +1675,7 @@ static int create_con_cq_qp(struct rtrs_clt_con *con)
 		 * + 2 for drain and heartbeat
 		 * in case qp gets into error state.
 		 */
-		max_send_wr =
-			min_t(int, wr_limit, SERVICE_CON_QUEUE_DEPTH * 2 + 2);
+		max_send_wr = min(wr_limit, SERVICE_CON_QUEUE_DEPTH * 2 + 2);
 		max_recv_wr = max_send_wr;
 	} else {
 		/*
@@ -1692,11 +1691,9 @@ static int create_con_cq_qp(struct rtrs_clt_con *con)
 		wr_limit = clt_path->s.dev->ib_dev->attrs.max_qp_wr;
 		/* Shared between connections */
 		clt_path->s.dev_ref++;
-		max_send_wr = min_t(int, wr_limit,
-			      /* QD * (REQ + RSP + FR REGS or INVS) + drain */
-			      clt_path->queue_depth * 4 + 1);
-		max_recv_wr = min_t(int, wr_limit,
-			      clt_path->queue_depth * 3 + 1);
+		/* QD * (REQ + RSP + FR REGS or INVS) + drain */
+		max_send_wr = min(wr_limit, clt_path->queue_depth * 4 + 1);
+		max_recv_wr = min(wr_limit, clt_path->queue_depth * 3 + 1);
 		max_send_sge = 2;
 	}
 	atomic_set(&con->c.sq_wr_avail, max_send_wr);
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
index 7d8e4422cc5731..5314599d29fe11 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
@@ -1740,21 +1740,16 @@ static int create_con(struct rtrs_srv_path *srv_path,
 		 * All receive and all send (each requiring invalidate)
 		 * + 2 for drain and heartbeat
 		 */
-		max_send_wr = min_t(int, wr_limit,
-				    SERVICE_CON_QUEUE_DEPTH * 2 + 2);
+		max_send_wr = min(wr_limit, SERVICE_CON_QUEUE_DEPTH * 2 + 2);
 		max_recv_wr = max_send_wr;
 		s->signal_interval = min_not_zero(srv->queue_depth,
 						  (size_t)SERVICE_CON_QUEUE_DEPTH);
 	} else {
 		/* when always_invlaidate enalbed, we need linv+rinv+mr+imm */
 		if (always_invalidate)
-			max_send_wr =
-				min_t(int, wr_limit,
-				      srv->queue_depth * (1 + 4) + 1);
+			max_send_wr = min(wr_limit, srv->queue_depth * (1 + 4) + 1);
 		else
-			max_send_wr =
-				min_t(int, wr_limit,
-				      srv->queue_depth * (1 + 2) + 1);
+			max_send_wr = min(wr_limit, srv->queue_depth * (1 + 2) + 1);
 
 		max_recv_wr = srv->queue_depth + 1;
 	}
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index acbd787de265b5..0caebbc2810ff3 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -557,7 +557,7 @@ static int srp_create_ch_ib(struct srp_rdma_ch *ch)
 	init_attr->cap.max_send_wr     = m * target->queue_size;
 	init_attr->cap.max_recv_wr     = target->queue_size + 1;
 	init_attr->cap.max_recv_sge    = 1;
-	init_attr->cap.max_send_sge    = min(SRP_MAX_SGE, attr->max_send_sge);
+	init_attr->cap.max_send_sge    = min(attr->max_send_sge, SRP_MAX_SGE);
 	init_attr->sq_sig_type         = IB_SIGNAL_REQ_WR;
 	init_attr->qp_type             = IB_QPT_RC;
 	init_attr->send_cq             = send_cq;
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index f66cfd70c2636a..a760b4fbee90f4 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -77,8 +77,8 @@ module_param(srp_max_req_size, int, 0444);
 MODULE_PARM_DESC(srp_max_req_size,
 		 "Maximum size of SRP request messages in bytes.");
 
-static int srpt_srq_size = DEFAULT_SRPT_SRQ_SIZE;
-module_param(srpt_srq_size, int, 0444);
+static unsigned int srpt_srq_size = DEFAULT_SRPT_SRQ_SIZE;
+module_param(srpt_srq_size, uint, 0444);
 MODULE_PARM_DESC(srpt_srq_size,
 		 "Shared receive queue (SRQ) size.");
 
@@ -405,8 +405,7 @@ static void srpt_get_ioc(struct srpt_port *sport, u32 slot,
 	if (sdev->use_srq)
 		send_queue_depth = sdev->srq_size;
 	else
-		send_queue_depth = min(MAX_SRPT_RQ_SIZE,
-				       sdev->device->attrs.max_qp_wr);
+		send_queue_depth = min(sdev->device->attrs.max_qp_wr, MAX_SRPT_RQ_SIZE);
 
 	memset(iocp, 0, sizeof(*iocp));
 	strcpy(iocp->id_string, SRPT_ID_STRING);
@@ -1851,7 +1850,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
 	struct srpt_port *sport = ch->sport;
 	struct srpt_device *sdev = sport->sdev;
 	const struct ib_device_attr *attrs = &sdev->device->attrs;
-	int sq_size = sport->port_attrib.srp_sq_size;
+	u32 sq_size = sport->port_attrib.srp_sq_size;
 	int i, ret;
 
 	WARN_ON(ch->rq_size < 1);
@@ -1912,13 +1911,13 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
 		bool retry = sq_size > MIN_SRPT_SQ_SIZE;
 
 		if (retry) {
-			pr_debug("failed to create queue pair with sq_size = %d (%d) - retrying\n",
+			pr_debug("failed to create queue pair with sq_size = %u (%d) - retrying\n",
 				 sq_size, ret);
 			ib_cq_pool_put(ch->cq, ch->cq_size);
 			sq_size = max(sq_size / 2, MIN_SRPT_SQ_SIZE);
 			goto retry;
 		} else {
-			pr_err("failed to create queue pair with sq_size = %d (%d)\n",
+			pr_err("failed to create queue pair with sq_size = %u (%d)\n",
 			       sq_size, ret);
 			goto err_destroy_cq;
 		}
@@ -1926,7 +1925,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
 
 	atomic_set(&ch->sq_wr_avail, qp_init->cap.max_send_wr);
 
-	pr_debug("%s: max_cqe= %d max_sge= %d sq_size = %d ch= %p\n",
+	pr_debug("%s: max_cqe= %d max_sge= %d sq_size = %u ch= %p\n",
 		 __func__, ch->cq->cqe, qp_init->cap.max_send_sge,
 		 qp_init->cap.max_send_wr, ch);
 
@@ -2299,7 +2298,7 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev,
 	 * depth to avoid that the initiator driver has to report QUEUE_FULL
 	 * to the SCSI mid-layer.
 	 */
-	ch->rq_size = min(MAX_SRPT_RQ_SIZE, sdev->device->attrs.max_qp_wr);
+	ch->rq_size = min(sdev->device->attrs.max_qp_wr, MAX_SRPT_RQ_SIZE);
 	spin_lock_init(&ch->spinlock);
 	ch->state = CH_CONNECTING;
 	INIT_LIST_HEAD(&ch->cmd_wait_list);
@@ -3137,7 +3136,7 @@ static int srpt_alloc_srq(struct srpt_device *sdev)
 		return PTR_ERR(srq);
 	}
 
-	pr_debug("create SRQ #wr= %d max_allow=%d dev= %s\n", sdev->srq_size,
+	pr_debug("create SRQ #wr= %d max_allow=%u dev= %s\n", sdev->srq_size,
 		 sdev->device->attrs.max_srq_wr, dev_name(&device->dev));
 
 	sdev->req_buf_cache = srpt_cache_get(srp_max_req_size);
@@ -3952,7 +3951,7 @@ static int __init srpt_init_module(void)
 
 	if (srpt_srq_size < MIN_SRPT_SRQ_SIZE
 	    || srpt_srq_size > MAX_SRPT_SRQ_SIZE) {
-		pr_err("invalid value %d for kernel module parameter srpt_srq_size -- must be in the range [%d..%d].\n",
+		pr_err("invalid value %u for kernel module parameter srpt_srq_size -- must be in the range [%d..%d].\n",
 		       srpt_srq_size, MIN_SRPT_SRQ_SIZE, MAX_SRPT_SRQ_SIZE);
 		goto out;
 	}
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 6909e354279427..56cd228af1d57a 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -394,8 +394,10 @@ nvme_rdma_find_get_device(struct rdma_cm_id *cm_id)
 		goto out_free_pd;
 	}
 
-	ndev->num_inline_segments = min(NVME_RDMA_MAX_INLINE_SEGMENTS,
-					ndev->dev->attrs.max_send_sge - 1);
+	ndev->num_inline_segments = ndev->dev->attrs.max_send_sge;
+	if (ndev->num_inline_segments)
+		ndev->num_inline_segments--;
+	ndev->num_inline_segments = min(ndev->num_inline_segments, NVME_RDMA_MAX_INLINE_SEGMENTS);
 	list_add(&ndev->entry, &device_list);
 out_unlock:
 	mutex_unlock(&device_list_mutex);
@@ -1847,7 +1849,7 @@ static int nvme_rdma_route_resolved(struct nvme_rdma_queue *queue)
 	param.qp_num = queue->qp->qp_num;
 	param.flow_control = 1;
 
-	param.responder_resources = queue->device->dev->attrs.max_qp_rd_atom;
+	param.responder_resources = min(queue->device->dev->attrs.max_qp_rd_atom, U8_MAX);
 	/* maximum retry count */
 	param.retry_count = 7;
 	param.rnr_retry_count = 7;
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index ea1185b8267ef2..bdd28ce99faac8 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -149,10 +149,10 @@ MODULE_PARM_DESC(use_srq, "Use shared receive queue.");
 static int srq_size_set(const char *val, const struct kernel_param *kp);
 static const struct kernel_param_ops srq_size_ops = {
 	.set = srq_size_set,
-	.get = param_get_int,
+	.get = param_get_uint,
 };
 
-static int nvmet_rdma_srq_size = 1024;
+static unsigned int nvmet_rdma_srq_size = 1024;
 module_param_cb(srq_size, &srq_size_ops, &nvmet_rdma_srq_size, 0644);
 MODULE_PARM_DESC(srq_size, "set Shared Receive Queue (SRQ) size, should >= 256 (default: 1024)");
 
@@ -180,13 +180,14 @@ static const struct nvmet_fabrics_ops nvmet_rdma_ops;
 
 static int srq_size_set(const char *val, const struct kernel_param *kp)
 {
-	int n = 0, ret;
+	unsigned int n;
+	int ret;
 
-	ret = kstrtoint(val, 10, &n);
+	ret = kstrtouint(val, 10, &n);
 	if (ret != 0 || n < 256)
 		return -EINVAL;
 
-	return param_set_int(val, kp);
+	return param_set_uint(val, kp);
 }
 
 static int num_pages(int len)
@@ -1153,8 +1154,8 @@ static int nvmet_rdma_init_srqs(struct nvmet_rdma_device *ndev)
 
 	ndev->srq_size = min(ndev->device->attrs.max_srq_wr,
 			     nvmet_rdma_srq_size);
-	ndev->srq_count = min(ndev->device->num_comp_vectors,
-			      ndev->device->attrs.max_srq);
+	ndev->srq_count = min_t(u32, ndev->device->num_comp_vectors,
+				ndev->device->attrs.max_srq);
 
 	ndev->srqs = kzalloc_objs(*ndev->srqs, ndev->srq_count);
 	if (!ndev->srqs)
@@ -1199,7 +1200,7 @@ nvmet_rdma_find_get_device(struct rdma_cm_id *cm_id)
 	struct nvmet_port *nport = port->nport;
 	struct nvmet_rdma_device *ndev;
 	int inline_page_count;
-	int inline_sge_count;
+	u32 inline_sge_count;
 	int ret;
 
 	mutex_lock(&device_list_mutex);
@@ -1215,7 +1216,9 @@ nvmet_rdma_find_get_device(struct rdma_cm_id *cm_id)
 
 	inline_page_count = num_pages(nport->inline_data_size);
 	inline_sge_count = max(cm_id->device->attrs.max_sge_rd,
-				cm_id->device->attrs.max_recv_sge) - 1;
+				cm_id->device->attrs.max_recv_sge);
+	if (inline_sge_count)
+		inline_sge_count--;
 	if (inline_page_count > inline_sge_count) {
 		pr_warn("inline_data_size %d cannot be supported by device %s. Reducing to %lu.\n",
 			nport->inline_data_size, cm_id->device->name,
@@ -1555,8 +1558,9 @@ static int nvmet_rdma_cm_accept(struct rdma_cm_id *cm_id,
 
 	param.rnr_retry_count = 7;
 	param.flow_control = 1;
-	param.initiator_depth = min_t(u8, p->initiator_depth,
-		queue->dev->device->attrs.max_qp_init_rd_atom);
+	param.initiator_depth = min3(p->initiator_depth,
+				     queue->dev->device->attrs.max_qp_init_rd_atom,
+				     U8_MAX);
 	param.private_data = &priv;
 	param.private_data_len = sizeof(priv);
 	priv.recfmt = cpu_to_le16(NVME_RDMA_CM_FMT_1_0);
diff --git a/fs/smb/smbdirect/accept.c b/fs/smb/smbdirect/accept.c
index 5297400058385e..44b681a2072536 100644
--- a/fs/smb/smbdirect/accept.c
+++ b/fs/smb/smbdirect/accept.c
@@ -32,8 +32,9 @@ int smbdirect_accept_connect_request(struct smbdirect_socket *sc,
 	/*
 	 * First set what the we as server are able to support
 	 */
-	sp->initiator_depth = min_t(u8, sp->initiator_depth,
-				    sc->ib.dev->attrs.max_qp_rd_atom);
+	sp->initiator_depth = min3(sp->initiator_depth,
+				   sc->ib.dev->attrs.max_qp_rd_atom,
+				   U8_MAX);
 
 	peer_initiator_depth = param->initiator_depth;
 	peer_responder_resources = param->responder_resources;
diff --git a/fs/smb/smbdirect/connect.c b/fs/smb/smbdirect/connect.c
index cd726b399afecb..34a3e72c38fbba 100644
--- a/fs/smb/smbdirect/connect.c
+++ b/fs/smb/smbdirect/connect.c
@@ -182,8 +182,9 @@ static int smbdirect_connect_rdma_connect(struct smbdirect_socket *sc)
 	if (sc->ib.dev->attrs.kernel_cap_flags & IBK_SG_GAPS_REG)
 		sc->mr_io.type = IB_MR_TYPE_SG_GAPS;
 
-	sp->responder_resources = min_t(u8, sp->responder_resources,
-					sc->ib.dev->attrs.max_qp_rd_atom);
+	sp->responder_resources = min3(sp->responder_resources,
+				       sc->ib.dev->attrs.max_qp_rd_atom,
+				       U8_MAX);
 	smbdirect_log_rdma_mr(sc, SMBDIRECT_LOG_INFO,
 		"responder_resources=%d\n",
 		sp->responder_resources);
diff --git a/fs/smb/smbdirect/connection.c b/fs/smb/smbdirect/connection.c
index 8adf580975344b..690acb84e1b591 100644
--- a/fs/smb/smbdirect/connection.c
+++ b/fs/smb/smbdirect/connection.c
@@ -287,7 +287,7 @@ int smbdirect_connection_create_qp(struct smbdirect_socket *sc)
 	    qp_cap.max_send_wr > sc->ib.dev->attrs.max_qp_wr) {
 		pr_err("Possible CQE overrun: max_send_wr %d\n",
 		       qp_cap.max_send_wr);
-		pr_err("device %.*s reporting max_cqe %d max_qp_wr %d\n",
+		pr_err("device %.*s reporting max_cqe %u max_qp_wr %u\n",
 		       IB_DEVICE_NAME_MAX,
 		       sc->ib.dev->name,
 		       sc->ib.dev->attrs.max_cqe,
@@ -302,7 +302,7 @@ int smbdirect_connection_create_qp(struct smbdirect_socket *sc)
 	     max_send_wr >= sc->ib.dev->attrs.max_qp_wr)) {
 		pr_err("Possible CQE overrun: rdma_send_wr %d + max_send_wr %d = %d\n",
 		       rdma_send_wr, qp_cap.max_send_wr, max_send_wr);
-		pr_err("device %.*s reporting max_cqe %d max_qp_wr %d\n",
+		pr_err("device %.*s reporting max_cqe %u max_qp_wr %u\n",
 		       IB_DEVICE_NAME_MAX,
 		       sc->ib.dev->name,
 		       sc->ib.dev->attrs.max_cqe,
@@ -316,7 +316,7 @@ int smbdirect_connection_create_qp(struct smbdirect_socket *sc)
 	    qp_cap.max_recv_wr > sc->ib.dev->attrs.max_qp_wr) {
 		pr_err("Possible CQE overrun: max_recv_wr %d\n",
 		       qp_cap.max_recv_wr);
-		pr_err("device %.*s reporting max_cqe %d max_qp_wr %d\n",
+		pr_err("device %.*s reporting max_cqe %u max_qp_wr %u\n",
 		       IB_DEVICE_NAME_MAX,
 		       sc->ib.dev->name,
 		       sc->ib.dev->attrs.max_cqe,
@@ -328,7 +328,7 @@ int smbdirect_connection_create_qp(struct smbdirect_socket *sc)
 
 	if (qp_cap.max_send_sge > sc->ib.dev->attrs.max_send_sge ||
 	    qp_cap.max_recv_sge > sc->ib.dev->attrs.max_recv_sge) {
-		pr_err("device %.*s max_send_sge/max_recv_sge = %d/%d too small\n",
+		pr_err("device %.*s max_send_sge/max_recv_sge = %u/%u too small\n",
 		       IB_DEVICE_NAME_MAX,
 		       sc->ib.dev->name,
 		       sc->ib.dev->attrs.max_send_sge,
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index 5aadb47b3b0e9a..76aa5ec4ab402d 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -77,8 +77,8 @@ struct svcxprt_rdma {
 	struct rdma_cm_id    *sc_cm_id;		/* RDMA connection id */
 	struct list_head     sc_accept_q;	/* Conn. waiting accept */
 	struct rpcrdma_notification sc_rn;	/* removal notification */
-	int		     sc_ord;		/* RDMA read limit */
-	int                  sc_max_send_sges;
+	u32		     sc_ord;		/* RDMA read limit */
+	unsigned int         sc_max_send_sges;
 	bool		     sc_snd_w_inv;	/* OK to use Send With Invalidate */
 
 	atomic_t             sc_sq_avail;	/* SQEs ready to be consumed */
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 794746de8db0ba..8d82d303b723a6 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -407,36 +407,36 @@ struct ib_device_attr {
 	u32			vendor_id;
 	u32			vendor_part_id;
 	u32			hw_ver;
-	int			max_qp;
-	int			max_qp_wr;
+	u32			max_qp;
+	u32			max_qp_wr;
 	u64			device_cap_flags;
 	u64			kernel_cap_flags;
-	int			max_send_sge;
-	int			max_recv_sge;
-	int			max_sge_rd;
-	int			max_cq;
-	int			max_cqe;
-	int			max_mr;
-	int			max_pd;
-	int			max_qp_rd_atom;
-	int			max_ee_rd_atom;
-	int			max_res_rd_atom;
-	int			max_qp_init_rd_atom;
-	int			max_ee_init_rd_atom;
+	u32			max_send_sge;
+	u32			max_recv_sge;
+	u32			max_sge_rd;
+	u32			max_cq;
+	u32			max_cqe;
+	u32			max_mr;
+	u32			max_pd;
+	u32			max_qp_rd_atom;
+	u32			max_ee_rd_atom;
+	u32			max_res_rd_atom;
+	u32			max_qp_init_rd_atom;
+	u32			max_ee_init_rd_atom;
 	enum ib_atomic_cap	atomic_cap;
 	enum ib_atomic_cap	masked_atomic_cap;
-	int			max_ee;
-	int			max_rdd;
-	int			max_mw;
-	int			max_raw_ipv6_qp;
-	int			max_raw_ethy_qp;
-	int			max_mcast_grp;
-	int			max_mcast_qp_attach;
-	int			max_total_mcast_qp_attach;
-	int			max_ah;
-	int			max_srq;
-	int			max_srq_wr;
-	int			max_srq_sge;
+	u32			max_ee;
+	u32			max_rdd;
+	u32			max_mw;
+	u32			max_raw_ipv6_qp;
+	u32			max_raw_ethy_qp;
+	u32			max_mcast_grp;
+	u32			max_mcast_qp_attach;
+	u32			max_total_mcast_qp_attach;
+	u32			max_ah;
+	u32			max_srq;
+	u32			max_srq_wr;
+	u32			max_srq_sge;
 	unsigned int		max_fast_reg_page_list_len;
 	unsigned int		max_pi_fast_reg_page_list_len;
 	u16			max_pkeys;
diff --git a/include/rdma/restrack.h b/include/rdma/restrack.h
index 451f99e3717d80..c081384740ce9e 100644
--- a/include/rdma/restrack.h
+++ b/include/rdma/restrack.h
@@ -123,7 +123,7 @@ struct rdma_restrack_entry {
 	u32 id;
 };
 
-int rdma_restrack_count(struct ib_device *dev, enum rdma_restrack_type type,
+u32 rdma_restrack_count(struct ib_device *dev, enum rdma_restrack_type type,
 			bool show_details);
 /**
  * rdma_is_kernel_res() - check the owner of resource
diff --git a/net/rds/ib.c b/net/rds/ib.c
index 39f87272e071bf..c62684d4259c4f 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -162,12 +162,12 @@ static int rds_ib_add_one(struct ib_device *device)
 		   IB_ODP_SUPPORT_READ);
 
 	rds_ibdev->max_1m_mrs = device->attrs.max_mr ?
-		min_t(unsigned int, (device->attrs.max_mr / 2),
-		      rds_ib_mr_1m_pool_size) : rds_ib_mr_1m_pool_size;
+		min(device->attrs.max_mr / 2,
+		    rds_ib_mr_1m_pool_size) : rds_ib_mr_1m_pool_size;
 
 	rds_ibdev->max_8k_mrs = device->attrs.max_mr ?
-		min_t(unsigned int, ((device->attrs.max_mr / 2) * RDS_MR_8K_SCALE),
-		      rds_ib_mr_8k_pool_size) : rds_ib_mr_8k_pool_size;
+		min((device->attrs.max_mr / 2) * RDS_MR_8K_SCALE,
+		    rds_ib_mr_8k_pool_size) : rds_ib_mr_8k_pool_size;
 
 	rds_ibdev->max_initiator_depth = device->attrs.max_qp_init_rd_atom;
 	rds_ibdev->max_responder_resources = device->attrs.max_qp_rd_atom;
@@ -204,7 +204,7 @@ static int rds_ib_add_one(struct ib_device *device)
 		goto put_dev;
 	}
 
-	rdsdebug("RDS/IB: max_mr = %d, max_wrs = %d, max_sge = %d, max_1m_mrs = %d, max_8k_mrs = %d\n",
+	rdsdebug("RDS/IB: max_mr = %u, max_wrs = %d, max_sge = %d, max_1m_mrs = %d, max_8k_mrs = %d\n",
 		 device->attrs.max_mr, rds_ibdev->max_wrs, rds_ibdev->max_sge,
 		 rds_ibdev->max_1m_mrs, rds_ibdev->max_8k_mrs);
 
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index 5667f0173b47f2..17e587c3007663 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -173,11 +173,11 @@ static void rds_ib_cm_fill_conn_param(struct rds_connection *conn,
 
 	memset(conn_param, 0, sizeof(struct rdma_conn_param));
 
-	conn_param->responder_resources =
-		min_t(u32, rds_ibdev->max_responder_resources, max_responder_resources);
-	conn_param->initiator_depth =
-		min_t(u32, rds_ibdev->max_initiator_depth, max_initiator_depth);
-	conn_param->retry_count = min_t(unsigned int, rds_ib_retry_count, 7);
+	conn_param->responder_resources = min3(rds_ibdev->max_responder_resources,
+					       max_responder_resources, U8_MAX);
+	conn_param->initiator_depth = min3(rds_ibdev->max_initiator_depth,
+					   max_initiator_depth, U8_MAX);
+	conn_param->retry_count = min(rds_ib_retry_count, 7U);
 	conn_param->rnr_retry_count = 7;
 
 	if (dp) {
diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c
index e5c71cf705a33a..e83cef19e6569a 100644
--- a/net/sunrpc/xprtrdma/frwr_ops.c
+++ b/net/sunrpc/xprtrdma/frwr_ops.c
@@ -172,8 +172,9 @@ int frwr_mr_init(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr *mr)
 int frwr_query_device(struct rpcrdma_ep *ep, const struct ib_device *device)
 {
 	const struct ib_device_attr *attrs = &device->attrs;
-	int max_qp_wr, depth, delta;
 	unsigned int max_sge;
+	u32 max_qp_wr;
+	int depth, delta;
 
 	if (!(attrs->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) ||
 	    attrs->max_fast_reg_page_list_len == 0) {
@@ -229,10 +230,10 @@ int frwr_query_device(struct rpcrdma_ep *ep, const struct ib_device *device)
 	}
 
 	max_qp_wr = attrs->max_qp_wr;
+	if (max_qp_wr < RPCRDMA_BACKWARD_WRS + 1 + RPCRDMA_MIN_SLOT_TABLE)
+		return -ENOMEM;
 	max_qp_wr -= RPCRDMA_BACKWARD_WRS;
 	max_qp_wr -= 1;
-	if (max_qp_wr < RPCRDMA_MIN_SLOT_TABLE)
-		return -ENOMEM;
 	if (ep->re_max_requests > max_qp_wr)
 		ep->re_max_requests = max_qp_wr;
 	ep->re_attr.cap.max_send_wr = ep->re_max_requests * depth;
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index 7ca71741106b18..e0289adce7f5eb 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -562,8 +562,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
 	set_bit(RDMAXPRT_CONN_PENDING, &newxprt->sc_flags);
 	memset(&conn_param, 0, sizeof conn_param);
 	conn_param.responder_resources = 0;
-	conn_param.initiator_depth = min_t(int, newxprt->sc_ord,
-					   dev->attrs.max_qp_init_rd_atom);
+	conn_param.initiator_depth = min(newxprt->sc_ord, dev->attrs.max_qp_init_rd_atom);
 	if (!conn_param.initiator_depth) {
 		ret = -EINVAL;
 		trace_svcrdma_initdepth_err(newxprt, ret);
@@ -588,7 +587,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
 		dprintk("    local address   : %pIS:%u\n", sap, rpc_get_port(sap));
 		sap = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.dst_addr;
 		dprintk("    remote address  : %pIS:%u\n", sap, rpc_get_port(sap));
-		dprintk("    max_sge         : %d\n", newxprt->sc_max_send_sges);
+		dprintk("    max_sge         : %u\n", newxprt->sc_max_send_sges);
 		dprintk("    sq_depth        : %d\n", newxprt->sc_sq_depth);
 		dprintk("    rdma_rw_ctxs    : %d\n", ctxts);
 		dprintk("    max_requests    : %d\n", newxprt->sc_max_requests);
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 04b286223b24c2..be335eed329d1e 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -465,7 +465,7 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt)
 	/* Client offers RDMA Read but does not initiate */
 	ep->re_remote_cma.initiator_depth = 0;
 	ep->re_remote_cma.responder_resources =
-		min_t(int, U8_MAX, device->attrs.max_qp_rd_atom);
+		min(device->attrs.max_qp_rd_atom, U8_MAX);
 
 	/* Limit transport retries so client can detect server
 	 * GID changes quickly. RPC layer handles re-establishing

3/2 2026/07/09 20:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 17286
							output: 40
							thoughts: 1561
						

Thoughts:
**RDMA Patch Analysis: Refactoring and Fuzzing Strategy**

Okay, so I'm looking at this patch. It's touching a *lot* of RDMA code – drivers, core, and headers. The main thing seems to be a refactoring, replacing instances of `min_t(int, ...)` with `min(...)` or `min3(...)`. It also changes quite a few fields in `struct ib_device_attr` from `int` to `u32`.

Initially, I was a little concerned because changing signed integers to unsigned could be a source of problems, especially related to comparisons and limit checks. However, after looking deeper, it seems this is primarily about fixing potential signedness issues and providing more clarity. Using `min()` instead of `min_t()` is a good cleanup, too. This simplifies the code and is likely a good thing. More specifically, it looks like there were cases where a `min_t(u8, ...)` was being used, which could truncate larger values. The updated code replaces this with `min3(..., ..., U8_MAX)` or `min(..., U8_MAX)`.

So, the question is, is this fuzzable? Absolutely. It modifies core kernel logic and drivers across the RDMA subsystem, so there's a good chance to expose bugs. The type changes and the new `min` usage could expose subtle issues.

I've scoped out a list of functions that have been changed in the patch, let's see which are most valuable to target. I've got a list of some of the functions: `ib_alloc_cqs`, `fill_res_info`, `rdma_restrack_count`, `qedr_query_device`, `rxe_qp_chk_cap`, `rxe_qp_chk_attr`, `rxe_srq_chk_init`, `rxe_srq_chk_attr`, `ipoib_cm_create_tx_qp`, `ipoib_cm_dev_init`, `ipoib_transport_dev_init`, `iser_create_ib_conn_res`, `iser_route_handler`, `isert_create_device_ib_res`, `isert_set_nego_params`, `create_con_cq_qp`, `create_con`, `srp_create_ch_ib`, `srpt_get_ioc`, `srpt_create_ch_ib`, `srpt_cm_req_recv`, `srpt_alloc_srq`, `nvme_rdma_find_get_device`, `nvme_rdma_route_resolved`, `nvmet_rdma_init_srqs`, `nvmet_rdma_find_get_device`, `nvmet_rdma_cm_accept`, `smbdirect_accept_connect_request`, `smbdirect_connect_rdma_connect`, `smbdirect_connection_create_qp`, `rds_ib_add_one`, `rds_ib_cm_fill_conn_param`, `frwr_query_device`, `svc_rdma_accept`, and `rpcrdma_ep_create`.

Because this is a subsystem-wide change, I think it's smarter to focus on a few key functions that are more easily reached. RXE is software RDMA and should be easily fuzzed, so I'll target `rxe_qp_chk_cap`, `rxe_qp_chk_attr`, `rxe_srq_chk_init`, and `rxe_srq_chk_attr`. The `nvme_rdma_find_get_device` and `nvmet_rdma_find_get_device` functions also look like promising targets for fuzzing.

I've checked the config options for a few functions and it looks like `rxe_qp_chk_cap` requires `CONFIG_RDMA_RXE` to be enabled, `nvme_rdma_find_get_device` requires `CONFIG_NVME_RDMA`, and `nvmet_rdma_find_get_device` requires `CONFIG_NVME_TARGET_RDMA`. I need to ensure those are enabled in my fuzzing environment.

Now, let's dive into the code for a closer look. I'll need to check the exact usage of `min()` and the `u32` changes to figure out the right fuzzing strategies.



4/2 2026/07/09 20:15 tool grepper
0m Args:
{
  "Expression": "config RDMA_RXE",
  "PathPrefix": "drivers/infiniband/sw/rxe/Kconfig"
}

Results:
{
  "Output": "drivers/infiniband/sw/rxe/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\ndrivers/infiniband/sw/rxe/Kconfig:2:config RDMA_RXE\ndrivers/infiniband/sw/rxe/Kconfig-3-\ttristate \"Software RDMA over Ethernet (RoCE) driver\"\n"
}

5/2 2026/07/09 20:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 19951
							output: 35
							thoughts: 21
						

Thoughts:
Here's my take on those thoughts:

**NVMe RDMA Deep Dive**

Okay, time to zero in on these RDMA-related NVMe aspects. I need to make sure I'm clear on the differences and interactions between `NVME_RDMA` and `NVME_TARGET_RDMA`. I know the basics, but this area can get intricate fast. I'm thinking about the protocol interactions, the specific hardware implications, and the potential performance advantages and bottlenecks for each configuration. It's crucial to understand how the host interacts with the NVMe device using RDMA and what nuances come into play depending on whether we're talking about a typical NVMe initiator leveraging RDMA to access an NVMe target, or if the target itself is actively participating in RDMA operations. This could involve differences in the necessary device firmware, host drivers, and the potential impact on data path optimizations. I'll need to remember all of the associated standards. Ultimately, my goal is a really solid understanding of the implications of both settings in a real-world deployment.



6/2 2026/07/09 20:15 tool grepper
0m Args:
{
  "Expression": "config NVME_RDMA",
  "PathPrefix": "drivers/nvme/host/Kconfig"
}

Results:
{
  "Output": "drivers/nvme/host/Kconfig=47=config NVME_FABRICS\n--\ndrivers/nvme/host/Kconfig-51-\ndrivers/nvme/host/Kconfig:52:config NVME_RDMA\ndrivers/nvme/host/Kconfig-53-\ttristate \"NVM Express over Fabrics RDMA host driver\"\n"
}

7/2 2026/07/09 20:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 20326
							output: 37
							thoughts: 0
						

8/2 2026/07/09 20:15 tool grepper
0m Args:
{
  "Expression": "config NVME_TARGET_RDMA",
  "PathPrefix": "drivers/nvme/target/Kconfig"
}

Results:
{
  "Output": "drivers/nvme/target/Kconfig=41=config NVME_TARGET_LOOP\n--\ndrivers/nvme/target/Kconfig-51-\ndrivers/nvme/target/Kconfig:52:config NVME_TARGET_RDMA\ndrivers/nvme/target/Kconfig-53-\ttristate \"NVMe over Fabrics RDMA target support\"\n"
}

9/2 2026/07/09 20:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 20462
							output: 41
							thoughts: 12
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Investigating the `INFINIBAND_IPOIB` Variable**

Right, let's dive into this `INFINIBAND_IPOIB` thing. My initial thought is to immediately consider its context. We're obviously dealing with InfiniBand, and the presence of "IPOIB" suggests we're talking about IP over IB. This is usually the area of potential performance tuning/configuration, or debugging for IB fabric behavior. My mind immediately flashes to scenarios like: is this setting a driver flag, an environmental variable, or a kernel parameter? What level of the stack is it impacting? And from there, what might be its effects on, say, throughput, latency, or even overall system stability? I'm already anticipating questions about network interface configuration and potential conflicts with other network setups, perhaps even with things like `rdma_cm`. I need to assess what it does to the default behavior. Is this setting being used to enable, disable, or modify some aspect of IPOIB? Is it a general setting, or specific to a certain vendor's implementation, or possibly the linux kernel? I need to figure out what it's *doing* before I can understand its impact.



10/2 2026/07/09 20:15 tool grepper
0m Args:
{
  "Expression": "config INFINIBAND_IPOIB",
  "PathPrefix": "drivers/infiniband/ulp/ipoib/Kconfig"
}

Results:
{
  "Output": "drivers/infiniband/ulp/ipoib/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\ndrivers/infiniband/ulp/ipoib/Kconfig:2:config INFINIBAND_IPOIB\ndrivers/infiniband/ulp/ipoib/Kconfig-3-\ttristate \"IP-over-InfiniBand\"\n--\ndrivers/infiniband/ulp/ipoib/Kconfig-11-\ndrivers/infiniband/ulp/ipoib/Kconfig:12:config INFINIBAND_IPOIB_CM\ndrivers/infiniband/ulp/ipoib/Kconfig-13-\tbool \"IP-over-InfiniBand Connected Mode support\"\n--\ndrivers/infiniband/ulp/ipoib/Kconfig-26-\ndrivers/infiniband/ulp/ipoib/Kconfig:27:config INFINIBAND_IPOIB_DEBUG\ndrivers/infiniband/ulp/ipoib/Kconfig-28-\tbool \"IP-over-InfiniBand debugging\" if EXPERT\n--\ndrivers/infiniband/ulp/ipoib/Kconfig-41-\ndrivers/infiniband/ulp/ipoib/Kconfig:42:config INFINIBAND_IPOIB_DEBUG_DATA\ndrivers/infiniband/ulp/ipoib/Kconfig-43-\tbool \"IP-over-InfiniBand data path debugging\"\n"
}

11/2 2026/07/09 20:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 21128
							output: 36
							thoughts: 287
						

Thoughts:
**Analyzing the Impact of `ib_device_attr` Type Changes**

Okay, so this patch is switching a bunch of `ib_device_attr` fields from `int` to `u32`. That's a definite functional change, right? It messes with the comparisons – suddenly, signed versus unsigned matters. I need to keep that in mind when I dig into this. And it looks like it's also taking care of some potential truncation issues, specifically with things like `min_t(u8, ..., attr->max_qp_rd_atom)` by using `min3`. Smart move.

Now, where to start... let me see. I'm going to focus on these symbols: `rxe_qp_chk_cap`, `rxe_qp_chk_attr`, `rxe_srq_chk_init`, `rxe_srq_chk_attr`, `nvme_rdma_find_get_device`, `nvmet_rdma_find_get_device`, and `ipoib_cm_dev_init`. The relevant configs are `RDMA_RXE`, `NVME_RDMA`, `NVME_TARGET_RDMA`, and `INFINIBAND_IPOIB`. Those should give me a good handle on how these changes affect different RDMA implementations.

Ah, yes, `rxe_qp_chk_cap` is a great first choice. Let's start there and see what kind of impact this has.

Hold on a second, before I dive too deep. Let me quickly scan for any other functions that might be interesting in this context. Okay, I've got `smbdirect_accept_connect_request`, `smbdirect_connect_rdma_connect`, and `smbdirect_connection_create_qp` which are relevant to `CIFS_SMB_DIRECT`. Okay, that's useful context. Alright, now I'm ready to dig in.



12/2 2026/07/09 20:15 tool grepper
0m Args:
{
  "Expression": "config CIFS_SMB_DIRECT",
  "PathPrefix": "fs/smb/client/Kconfig"
}

Results:
{
  "Output": "fs/smb/client/Kconfig=179=if CIFS\nfs/smb/client/Kconfig-180-\nfs/smb/client/Kconfig:181:config CIFS_SMB_DIRECT\nfs/smb/client/Kconfig-182-\tbool \"SMB Direct support\"\n"
}

13/2 2026/07/09 20:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 21957
							output: 36
							thoughts: 49
						

Thoughts:
**Navigating the SMB Direct Codebase**

Okay, so I'm here, I need to understand this `fs/smb/smbdirect/accept.c` file. Right, let's see, where do I start? It's related to SMB Direct, which immediately suggests I should check the configuration files. My gut tells me either `fs/smb/smbdirect/Kconfig` or, perhaps, if it's more general SMB server configuration, `fs/smb/server/Kconfig`. That's the logical path, because Kconfig files are the place to look for compilation options, dependencies, and all the stuff that influences the build process, and, thus, how this accept function is used and linked into the whole SMB Direct stack. I need to understand what's enabled, disabled, and how this particular piece of code gets incorporated, and the Kconfig files are the keys to that information.



14/2 2026/07/09 20:15 tool grepper
0m Args:
{
  "Expression": "config SMB_SERVER_SMBDIRECT",
  "PathPrefix": "fs/smb/server/Kconfig"
}

Results:
{
  "Output": "fs/smb/server/Kconfig=46=if SMB_SERVER\nfs/smb/server/Kconfig-47-\nfs/smb/server/Kconfig:48:config SMB_SERVER_SMBDIRECT\nfs/smb/server/Kconfig-49-\tbool \"Support for SMB Direct protocol\"\n"
}

15/2 2026/07/09 20:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 22327
							output: 31
							thoughts: 41
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**Initial Investigation into SMB Direct Server/Client Location**

Right, so I'm looking at `fs/smb/smbdirect/accept.c`. Immediately, my mental gears start turning. Based on the file name, the `accept` function probably relates to connection establishment within the SMB Direct subsystem, which strongly suggests we're dealing with either the server side, the client side, or potentially even some shared component. My initial hunch leans towards the server, handling incoming connections. But, since I'm working with a distributed system, or more likely a protocol specification implementation, it's best to quickly confirm the role of this module to be certain.

Let's quickly check the `Makefile` in the same directory, `fs/smb/smbdirect/Makefile`. That should quickly reveal how `accept.c` is compiled and linked. That should either confirm my server-side intuition, or indicate that this file is linked into a more generic, client-agnostic component. It could also reveal that it is part of both! Depending on the build configuration, this tells me if the file is used for the client side, the server side, or both.



16/2 2026/07/09 20:15 tool grepper
0m Args:
{
  "Expression": ".*",
  "PathPrefix": "fs/smb/smbdirect/Makefile"
}

Results:
{
  "Output": "fs/smb/smbdirect/Makefile:1:# SPDX-License-Identifier: GPL-2.0-or-later\nfs/smb/smbdirect/Makefile:2:#\nfs/smb/smbdirect/Makefile:3:# Makefile for smbdirect support\nfs/smb/smbdirect/Makefile:4:#\nfs/smb/smbdirect/Makefile:5:\nfs/smb/smbdirect/Makefile:6:obj-$(CONFIG_SMBDIRECT) += smbdirect.o\nfs/smb/smbdirect/Makefile:7:\nfs/smb/smbdirect/Makefile:8:smbdirect-y := \\\nfs/smb/smbdirect/Makefile:9:\tsocket.o\t\\\nfs/smb/smbdirect/Makefile:10:\tconnection.o\t\\\nfs/smb/smbdirect/Makefile:11:\tmr.o\t\t\\\nfs/smb/smbdirect/Makefile:12:\trw.o\t\t\\\nfs/smb/smbdirect/Makefile:13:\tdebug.o\t\t\\\nfs/smb/smbdirect/Makefile:14:\tconnect.o\t\\\nfs/smb/smbdirect/Makefile:15:\tlisten.o\t\\\nfs/smb/smbdirect/Makefile:16:\taccept.o\t\\\nfs/smb/smbdirect/Makefile:17:\tdevices.o\t\\\nfs/smb/smbdirect/Makefile:18:\tmain.o\n"
}

17/2 2026/07/09 20:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 23042
							output: 30
							thoughts: 10
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm an expert in this field:

**Checking `CONFIG_SMBDIRECT`**

Alright, let's dive into this. When I see this thought, my immediate mental check is for the `CONFIG_SMBDIRECT` configuration option. It's a key setting, so this is where I'd start. It's likely that I'm either reviewing some configuration, debugging a networking issue related to SMB, or setting up a new system. `SMBDirect` itself implies a focus on RDMA-based SMB (Server Message Block) for high-performance file sharing, often in a cluster or high-throughput environment. So, figuring out whether it's enabled, disabled, or set incorrectly will give me an immediate direction. I'll need to know whether it's enabled in the kernel config. I'll probably recall the relevant kernel config option, and quickly navigate to it in my mind. The implications of this setting are significant, affecting performance, dependencies on RDMA hardware, and compatibility with other network components. It's foundational to understanding how SMB is *intended* to work on this system.



18/2 2026/07/09 20:15 tool grepper
0m Error:
no matches

Args:
{
  "Expression": "config SMBDIRECT",
  "PathPrefix": "fs/smb/Kconfig"
}

Results:
{
  "error": "no matches"
}

19/2 2026/07/09 20:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 23341
							output: 23
							thoughts: 14
						

Thoughts:
Okay, let's dive into this. Here's my thought process on this:

**Locating the Definition of CONFIG_SMBDIRECT**

Alright, the task at hand is to pinpoint the definition of `CONFIG_SMBDIRECT`. This likely means I need to start tracing through the configuration files for the system I'm working with. Given my expertise, I'm already anticipating this could be in a `.config` file, or perhaps a Kconfig file, or maybe even deeper within a makefile structure that conditionally includes different configurations. The context is key here – is this a kernel configuration, a user-space library configuration, something else entirely? I need to gather more context. But the immediate next step is to initiate a search. I'll need to figure out the fastest way to grep through the relevant directories. I’ll start with a broad search, and then refine my search, perhaps using `grep` or `find` along with `grep` to narrow things down. Once I find it, I'll need to understand where it's defined and what the surrounding context reveals about its purpose and dependencies.



20/2 2026/07/09 20:15 tool grepper
0m Args:
{
  "Expression": "config SMBDIRECT",
  "PathPrefix": ""
}

Results:
{
  "Output": "fs/smb/smbdirect/Kconfig-4-\nfs/smb/smbdirect/Kconfig:5:config SMBDIRECT\nfs/smb/smbdirect/Kconfig-6-\tdef_tristate n\n"
}

21/2 2026/07/09 20:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 23677
							output: 37
							thoughts: 47
						

Thoughts:
Okay, here's my take on those config options.

**RDMA & SMBDirect Deep Dive**

Alright, so I'm digging into these configuration options, and my immediate hunch is that `SMBDIRECT` is a hidden configuration value, likely selected based on the states of `CIFS_SMB_DIRECT` and `SMB_SERVER_SMBDIRECT`. That seems like the most logical way to structure it: a high-level switch controlling the overall support, and then more granular options enabled when the high-level switch is on.

Now, my next move is to check how `SUNRPC_XPRT_RDMA` relates to all of this. Is it a dependency? A related, but independent, functionality? Or is there some overlap in the low-level RDMA transport layer? My experience suggests there's potentially a subtle interaction to be understood here, and I need to see if the RPC layer is playing nice with what the SMBDirect setup might enable. Time to dive into the code and dependencies.



22/2 2026/07/09 20:15 tool grepper
0m Args:
{
  "Expression": "config SUNRPC_XPRT_RDMA",
  "PathPrefix": "net/sunrpc/Kconfig"
}

Results:
{
  "Output": "net/sunrpc/Kconfig=50=config SUNRPC_DEBUG_TRACE\n--\nnet/sunrpc/Kconfig-63-\nnet/sunrpc/Kconfig:64:config SUNRPC_XPRT_RDMA\nnet/sunrpc/Kconfig-65-\ttristate \"RPC-over-RDMA transport\"\n"
}

23/2 2026/07/09 20:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 24065
							output: 31
							thoughts: 10
						

Thoughts:
Okay, here's my interpretation of that thought process, assuming I'm the expert:

**Investigating RDMA within RDS**

Alright, the mental gears are starting to turn. "RDS_RDMA"... that's the trigger. My first instinct is to zero in on this. I need to refresh my understanding of how RDMA interacts within the context of Remote Direct Memory Access (RDMA) and Relational Database Service (RDS). I need to check the current status, and start my investigation from there. Let's see what we can find.



24/2 2026/07/09 20:15 tool grepper
0m Args:
{
  "Expression": "config RDS_RDMA",
  "PathPrefix": "net/rds/Kconfig"
}

Results:
{
  "Output": "net/rds/Kconfig=3=config RDS\n--\nnet/rds/Kconfig-9-\nnet/rds/Kconfig:10:config RDS_RDMA\nnet/rds/Kconfig-11-\ttristate \"RDS over Infiniband\"\n"
}

25/2 2026/07/09 20:15 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 24297
							output: 40
							thoughts: 11
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**Initial Assessment of Infiniband_SRP**

Alright, time to dig in. The immediate need here is to assess `INFINIBAND_SRP`. I'm starting from the assumption that the context likely involves storage or high-performance computing, given the association with InfiniBand. "SRP," likely refers to the Serialized Remote Procedure Call protocol, which makes me think of accessing storage devices. I need to quickly recall my knowledge of InfiniBand SRP implementations, potential bottlenecks, and common configuration pitfalls. This triggers a mental checklist: What are we trying to accomplish in regard to `INFINIBAND_SRP`?

Let's see where to begin with my analysis...



26/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "config INFINIBAND_SRP",
  "PathPrefix": "drivers/infiniband/ulp/srp/Kconfig"
}

Results:
{
  "Output": "drivers/infiniband/ulp/srp/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\ndrivers/infiniband/ulp/srp/Kconfig:2:config INFINIBAND_SRP\ndrivers/infiniband/ulp/srp/Kconfig-3-\ttristate \"InfiniBand SCSI RDMA Protocol\"\n"
}

27/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 24612
							output: 41
							thoughts: 12
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**INFINIBAND_SRPT Check: Initial Assessment**

Right, let's dive straight in. The mention of `INFINIBAND_SRPT` immediately flags a specific area of concern and optimization. My initial thought process is likely focused on a number of things: performance characteristics, potential issues, configuration, and how it is being used in the current system. I'm probably mentally running through the typical gotchas associated with this feature. Are there any known errata with the driver version? Are the firmware versions on the HCA's compatible? Are all the necessary kernel modules loaded? And, fundamentally, are we even *using* SRPT correctly in our workload? This could indicate a deeper investigation into network latency, congestion, or potential bottlenecks. I'll need to remember the typical command-line tools to check things like the HCA's status, link speed and errors, and routing configuration. I should also check the fabric status itself and whether it is being used with other fabric management features.



28/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "config INFINIBAND_SRPT",
  "PathPrefix": "drivers/infiniband/ulp/srpt/Kconfig"
}

Results:
{
  "Output": "drivers/infiniband/ulp/srpt/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\ndrivers/infiniband/ulp/srpt/Kconfig:2:config INFINIBAND_SRPT\ndrivers/infiniband/ulp/srpt/Kconfig-3-\ttristate \"InfiniBand SCSI RDMA Protocol target support\"\n"
}

29/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 25000
							output: 39
							thoughts: 11
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience, presented in the first person:

**Deep Dive on `INFINIBAND_ISER`**

Right, let's see... my immediate instinct is to revisit that `INFINIBAND_ISER` parameter. Given my experience, I'm thinking this is the key starting point. I know from past investigations that the interplay between InfiniBand and iSER is often a source of subtle performance bottlenecks or configuration conflicts. It's almost certain that digging into the settings related to this variable will tell me something interesting. Considering my existing knowledge of RDMA and network storage, it could give me a very quick indication of why performance isn't as expected, or why the system is behaving as it is. It's often the simplest things that get overlooked, and `INFINIBAND_ISER` covers a critical area. I'll need to know whether it's enabled correctly, what values it's set to, and how those values align with the underlying hardware and software configuration. That's my initial hypothesis, and I'm ready to dive into the details.



30/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "config INFINIBAND_ISER",
  "PathPrefix": "drivers/infiniband/ulp/iser/Kconfig"
}

Results:
{
  "Output": "drivers/infiniband/ulp/iser/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\ndrivers/infiniband/ulp/iser/Kconfig:2:config INFINIBAND_ISER\ndrivers/infiniband/ulp/iser/Kconfig-3-\ttristate \"iSCSI Extensions for RDMA (iSER)\"\n"
}

31/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 25385
							output: 40
							thoughts: 12
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**Quick Check: Infiniband iSER Support**

Right, let's just make absolutely sure we're handling the `INFINIBAND_ISERT` flag correctly. It's a critical component. We're obviously at a point where a quick sanity check here will prevent a major headache down the line. We need to confirm the assumptions. This isn't necessarily a deep dive, but a pivotal moment to avoid overlooking a foundational component that could impact performance.



32/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "config INFINIBAND_ISERT",
  "PathPrefix": "drivers/infiniband/ulp/isert/Kconfig"
}

Results:
{
  "Output": "drivers/infiniband/ulp/isert/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\ndrivers/infiniband/ulp/isert/Kconfig:2:config INFINIBAND_ISERT\ndrivers/infiniband/ulp/isert/Kconfig-3-\ttristate \"iSCSI Extensions for RDMA (iSER) target support\"\n"
}

33/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 25663
							output: 41
							thoughts: 25
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Examining Infiniband Router Client and Server Configuration**

Alright, let's dive right in and dissect what's going on with the `INFINIBAND_RTRS_CLIENT` and `INFINIBAND_RTRS_SERVER` settings. My initial thought process is to quickly confirm the state of these variables. Depending on their configuration, we can begin to troubleshoot issues with Infiniband routing. They are fundamental in determining the functional relationship between the connected devices. Essentially, are they active, inactive, what are the current values? Are they correctly configured relative to each other? The relationship between client and server will become critical if there is any traffic flow problems. Knowing the values gives a solid foundation. These variables, in the context of routing, immediately trigger questions around whether they are properly defined, if there are any conflicts, and if they align with the expected communication model. I'll need to know the context of the larger setup to understand any specific issues, but these variables are a great starting point for analyzing routing configuration.



34/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "config INFINIBAND_RTRS",
  "PathPrefix": "drivers/infiniband/ulp/rtrs/Kconfig"
}

Results:
{
  "Output": "drivers/infiniband/ulp/rtrs/Kconfig-2-\ndrivers/infiniband/ulp/rtrs/Kconfig:3:config INFINIBAND_RTRS\ndrivers/infiniband/ulp/rtrs/Kconfig-4-\ttristate\n--\ndrivers/infiniband/ulp/rtrs/Kconfig-6-\ndrivers/infiniband/ulp/rtrs/Kconfig:7:config INFINIBAND_RTRS_CLIENT\ndrivers/infiniband/ulp/rtrs/Kconfig-8-\ttristate \"RTRS client module\"\n--\ndrivers/infiniband/ulp/rtrs/Kconfig-17-\ndrivers/infiniband/ulp/rtrs/Kconfig:18:config INFINIBAND_RTRS_SERVER\ndrivers/infiniband/ulp/rtrs/Kconfig-19-\ttristate \"RTRS server module\"\n"
}

35/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 26189
							output: 46
							thoughts: 534
						

Thoughts:
**Fuzzing Strategy for RDMA Subsystem Patch**

Okay, so I'm looking at this patch and immediately see a good candidate for fuzzing. We've got a bunch of RDMA-related configurations in play, like `RDMA_RXE`, `NVME_RDMA`, and several INFINIBAND options. The patch itself is making changes to `struct ib_device_attr`, specifically changing integer fields from `int` to `u32`. This is a clear indicator that signedness is becoming relevant in comparisons, opening up the possibility of truncation bugs. The fact that the changes ripple through core RDMA logic and drivers is a big plus – makes it worth the effort.

My main focus is to zero in on the key symbols affected. I have a list: `rxe_qp_chk_cap`, `rxe_qp_chk_attr`, `rxe_srq_chk_init`, `rxe_srq_chk_attr`, `nvme_rdma_find_get_device`, `nvmet_rdma_find_get_device`, `ipoib_cm_dev_init`, `rds_ib_add_one`, `frwr_query_device`, and `smbdirect_accept_connect_request`. I'll want to refine this list to the most representative functions to make the fuzzing run more efficiently. I will then immediately check to see if `rxe_qp_chk_cap` is static - I need to know the scope of this function.



36/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "rxe_qp_chk_cap",
  "PathPrefix": "drivers/infiniband/sw/rxe/rxe_qp.c"
}

Results:
{
  "Output": "drivers/infiniband/sw/rxe/rxe_qp.c=37=static inline void rxe_reclassify_send_socket(struct socket *sock)\n--\ndrivers/infiniband/sw/rxe/rxe_qp.c-65-\ndrivers/infiniband/sw/rxe/rxe_qp.c:66:static int rxe_qp_chk_cap(struct rxe_dev *rxe, struct ib_qp_cap *cap,\ndrivers/infiniband/sw/rxe/rxe_qp.c-67-\t\t\t  int has_srq)\n--\ndrivers/infiniband/sw/rxe/rxe_qp.c=107=int rxe_qp_chk_init(struct rxe_dev *rxe, struct ib_qp_init_attr *init)\n--\ndrivers/infiniband/sw/rxe/rxe_qp.c-127-\ndrivers/infiniband/sw/rxe/rxe_qp.c:128:\tif (rxe_qp_chk_cap(rxe, cap, !!init-\u003esrq))\ndrivers/infiniband/sw/rxe/rxe_qp.c-129-\t\tgoto err1;\n--\ndrivers/infiniband/sw/rxe/rxe_qp.c=487=int rxe_qp_chk_attr(struct rxe_dev *rxe, struct rxe_qp *qp,\n--\ndrivers/infiniband/sw/rxe/rxe_qp.c-496-\ndrivers/infiniband/sw/rxe/rxe_qp.c:497:\tif (mask \u0026 IB_QP_CAP \u0026\u0026 rxe_qp_chk_cap(rxe, \u0026attr-\u003ecap, !!qp-\u003esrq))\ndrivers/infiniband/sw/rxe/rxe_qp.c-498-\t\tgoto err1;\n"
}

37/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 27579
							output: 42
							thoughts: 83
						

Thoughts:
Okay, here's my interpretation of these code observations, presented as my own thought process:

**Reflecting on Static vs. Non-Static Functions in the RDMA Context**

Right, let me see... I'm noticing a pattern here in how these functions are declared. `rxe_qp_chk_cap` is marked as `static`. Interesting. That means it's likely scoped internally within its module and not directly accessible from outside. I'll need to remember that. It seems, based on this, that I'm meant to be working with `rxe_qp_chk_init` and `rxe_qp_chk_attr` instead, presumably for initialization and attribute checks related to queue pairs.

Now, it's immediately apparent that the `rxe_srq_chk_init` and `rxe_srq_chk_attr` functions aren't `static`, which implies a different design intent for those, probably allowing for external access or use within other modules. So, I need to keep that distinction in mind when I'm assessing how these different components are designed to work together.

Finally, I see that `nvme_rdma_find_get_device` is also `static`. I suppose that function is intended to be for internal device lookup only. That's good to know for later on.



38/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "nvme_rdma_find_get_device",
  "PathPrefix": "drivers/nvme/host/rdma.c"
}

Results:
{
  "Output": "drivers/nvme/host/rdma.c=366=static struct nvme_rdma_device *\ndrivers/nvme/host/rdma.c:367:nvme_rdma_find_get_device(struct rdma_cm_id *cm_id)\ndrivers/nvme/host/rdma.c-368-{\n--\ndrivers/nvme/host/rdma.c=491=static int nvme_rdma_create_queue_ib(struct nvme_rdma_queue *queue)\n--\ndrivers/nvme/host/rdma.c-497-\ndrivers/nvme/host/rdma.c:498:\tqueue-\u003edevice = nvme_rdma_find_get_device(queue-\u003ecm_id);\ndrivers/nvme/host/rdma.c-499-\tif (!queue-\u003edevice) {\n"
}

39/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 28215
							output: 42
							thoughts: 37
						

Thoughts:
Okay, here's my interpretation of those thoughts, tailored for an expert audience, and delivered as a first-person summary:

**Queue Creation and Device Lookup - RDMA Style**

Alright, I'm thinking I'll steer clear of whatever alternative I was initially considering. My focus is going to be on `nvme_rdma_create_queue_ib` now. It's the logical choice here for queue creation, especially given the RDMA context we're dealing with.

Before I go any further though, I need to verify a specific detail, and that's the device. My next step involves verifying `nvmet_rdma_find_get_device`. I want to make sure I have a solid handle on the target device before diving into queue management. No point in spinning my wheels with the queue before making sure I'm talking to the right NVMe subsystem over RDMA. Let's see what that function turns up and if it's got what I need.



40/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "nvmet_rdma_find_get_device",
  "PathPrefix": "drivers/nvme/target/rdma.c"
}

Results:
{
  "Output": "drivers/nvme/target/rdma.c=1196=static struct nvmet_rdma_device *\ndrivers/nvme/target/rdma.c:1197:nvmet_rdma_find_get_device(struct rdma_cm_id *cm_id)\ndrivers/nvme/target/rdma.c-1198-{\n--\ndrivers/nvme/target/rdma.c=1576=static int nvmet_rdma_queue_connect(struct rdma_cm_id *cm_id,\n--\ndrivers/nvme/target/rdma.c-1582-\ndrivers/nvme/target/rdma.c:1583:\tndev = nvmet_rdma_find_get_device(cm_id);\ndrivers/nvme/target/rdma.c-1584-\tif (!ndev) {\n"
}

41/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 28731
							output: 34
							thoughts: 29
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Investigating RDMA Connection Establishment**

Alright, so I'm diving into this NVMe-oF RDMA connection process. My immediate inclination is to leverage `nvmet_rdma_queue_connect`. That feels like the logical entry point, the function that's going to handle the initial setup.

Now, before I get too deep into that, I should probably understand the low-level RDMA underpinnings. The RDMA transport layer is crucial, and `rds_ib_add_one` seems like it's likely involved at that layer. It probably handles the registration of the IB devices and their specific features. I'll need to confirm if it's responsible for the core RDMA connection setup with the host, or if it handles something a bit lower. I need to be sure before I dig further. So, I need to check how it all ties together.



42/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "rds_ib_add_one",
  "PathPrefix": "net/rds/ib.c"
}

Results:
{
  "Output": "net/rds/ib.c=121=void rds_ib_dev_put(struct rds_ib_device *rds_ibdev)\n--\nnet/rds/ib.c-127-\nnet/rds/ib.c:128:static int rds_ib_add_one(struct ib_device *device)\nnet/rds/ib.c-129-{\n--\nnet/rds/ib.c=286=struct ib_client rds_ib_client = {\nnet/rds/ib.c-287-\t.name   = \"rds_ib\",\nnet/rds/ib.c:288:\t.add    = rds_ib_add_one,\nnet/rds/ib.c-289-\t.remove = rds_ib_remove_one\n"
}

43/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 29211
							output: 40
							thoughts: 36
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Analyzing Connection Parameter Implementation**

Alright, this code's looking a bit rigid. The current connection parameter setup appears static, which raises a red flag for me. I need to ensure flexibility, especially when dealing with this level of interconnect. So, my initial thought is to pivot away from whatever this static implementation is. My immediate instinct is to leverage `rds_ib_cm_fill_conn_param`. However, before I commit to that, I need to verify that `rds_ib_cm_fill_conn_param` itself isn't implemented in a similarly inflexible way. I'll need to double-check its internal structure and any dependencies it might have to ensure it provides the necessary dynamic behavior I'm after. I need to confirm that this change doesn't introduce another static dependency I need to refactor.



44/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "rds_ib_cm_fill_conn_param",
  "PathPrefix": "net/rds/ib_cm.c"
}

Results:
{
  "Output": "net/rds/ib_cm.c=74=void rds_ib_cm_connect_complete(struct rds_connection *conn, struct rdma_cm_event *event)\n--\nnet/rds/ib_cm.c-162-\nnet/rds/ib_cm.c:163:static void rds_ib_cm_fill_conn_param(struct rds_connection *conn,\nnet/rds/ib_cm.c-164-\t\t\t\t      struct rdma_conn_param *conn_param,\n--\nnet/rds/ib_cm.c=783=int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,\n--\nnet/rds/ib_cm.c-912-\nnet/rds/ib_cm.c:913:\trds_ib_cm_fill_conn_param(conn, \u0026conn_param, \u0026dp_rep, version,\nnet/rds/ib_cm.c-914-\t\t\t\t  event-\u003eparam.conn.responder_resources,\n--\nnet/rds/ib_cm.c=932=int rds_ib_cm_initiate_connect(struct rdma_cm_id *cm_id, bool isv6)\n--\nnet/rds/ib_cm.c-950-\nnet/rds/ib_cm.c:951:\trds_ib_cm_fill_conn_param(conn, \u0026conn_param, \u0026dp,\nnet/rds/ib_cm.c-952-\t\t\t\t  conn-\u003ec_proposed_version,\n"
}

45/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 29871
							output: 46
							thoughts: 43
						

Thoughts:
Okay, here's my interpretation of those thoughts, framed as my own mental process, given my expertise:

**Examining the RDMA Connection Establishment**

Alright, so I'm thinking about the low-level RDMA connection process. To handle the initial connection, my instinct is to reach for `rds_ib_cm_handle_connect` and `rds_ib_cm_initiate_connect`. These functions are foundational to managing the connection manager aspect within the RDS over InfiniBand architecture. They're my go-to tools for this.

Now, I also need to ensure the InfiniBand interfaces are properly initialized. Therefore, before I proceed too far with the connection attempt, I need to double-check the `ipoib_cm_dev_init` function. I will need to verify that the IP over InfiniBand CM device is initialized appropriately for proper connect requests. This ensures that the underlying InfiniBand fabric is ready and waiting. I need to make sure the network is ready before I try and connect.



46/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "ipoib_cm_dev_init",
  "PathPrefix": "drivers/infiniband/ulp/ipoib/ipoib_cm.c"
}

Results:
{
  "Output": "drivers/infiniband/ulp/ipoib/ipoib_cm.c=1551=static void ipoib_cm_create_srq(struct net_device *dev, int max_sge)\n--\ndrivers/infiniband/ulp/ipoib/ipoib_cm.c-1580-\ndrivers/infiniband/ulp/ipoib/ipoib_cm.c:1581:int ipoib_cm_dev_init(struct net_device *dev)\ndrivers/infiniband/ulp/ipoib/ipoib_cm.c-1582-{\n"
}

47/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 30334
							output: 43
							thoughts: 19
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Evolving Situation Awareness**

Alright, so it's not a fixed state. The situation, the data, the whole picture – it's dynamic. I need to treat it as such. I can't just assume anything is constant; I have to keep re-evaluating.

My immediate thought is to check `frwr_query_device`. That's where I need to start. Whatever is going on now, that function should give me a snapshot of the current state of whatever `device` this query references. Knowing that, I can make assumptions regarding the data I have. From there I can move forward, assuming what is contained within.



48/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "frwr_query_device",
  "PathPrefix": "net/sunrpc/xprtrdma/frwr_ops.c"
}

Results:
{
  "Output": "net/sunrpc/xprtrdma/frwr_ops.c=122=int frwr_mr_init(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr *mr)\n--\nnet/sunrpc/xprtrdma/frwr_ops.c-155-/**\nnet/sunrpc/xprtrdma/frwr_ops.c:156: * frwr_query_device - Prepare a transport for use with FRWR\nnet/sunrpc/xprtrdma/frwr_ops.c-157- * @ep: endpoint to fill in\n--\nnet/sunrpc/xprtrdma/frwr_ops.c-171- */\nnet/sunrpc/xprtrdma/frwr_ops.c:172:int frwr_query_device(struct rpcrdma_ep *ep, const struct ib_device *device)\nnet/sunrpc/xprtrdma/frwr_ops.c-173-{\n"
}

49/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 30814
							output: 41
							thoughts: 22
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Analyzing Dynamic Behavior in `smbdirect_accept_connect_request`**

Okay, this isn't a simple, unchanging situation. We're dealing with something dynamic, which means a lot more digging is probably necessary. First, let's take a look at `smbdirect_accept_connect_request`. I need to understand how connections are being accepted within that function. I'm going to focus on how the connections are handled, what states are involved, and where it may be failing or behaving in an unexpected manner. It is definitely not static, and I need to identify the variables involved and ensure that there are no issues.



50/2 2026/07/09 20:16 tool grepper
0m Args:
{
  "Expression": "smbdirect_accept_connect_request",
  "PathPrefix": "fs/smb/smbdirect/accept.c"
}

Results:
{
  "Output": "fs/smb/smbdirect/accept.c=16=static void smbdirect_accept_negotiate_send_done(struct ib_cq *cq, struct ib_wc *wc);\nfs/smb/smbdirect/accept.c-17-\nfs/smb/smbdirect/accept.c:18:int smbdirect_accept_connect_request(struct smbdirect_socket *sc,\nfs/smb/smbdirect/accept.c-19-\t\t\t\t     const struct rdma_conn_param *param)\n"
}

51/2 2026/07/09 20:16 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 31172
							output: 344
							thoughts: 613
						

Thoughts:
**My Assessment of the RDMA Subsystem for Fuzzing**

Okay, so I'm looking at this from a fuzzing perspective, and the key thing I see is that this isn't a static situation – things are in flux. My focus needs to be dynamic. The symbols to zero in on are: `rxe_qp_chk_init`, `rxe_qp_chk_attr`, `rxe_srq_chk_init`, `rxe_srq_chk_attr`, `nvme_rdma_create_queue_ib`, `nvmet_rdma_queue_connect`, `rds_ib_cm_handle_connect`, `rds_ib_cm_initiate_connect`, `ipoib_cm_dev_init`, `frwr_query_device`, and `smbdirect_accept_connect_request`. I need to ensure these are exercised appropriately during any fuzzing runs.

Now, let's look at the configuration options that are relevant. I see `RDMA_RXE`, `NVME_RDMA`, `NVME_TARGET_RDMA`, `RDS_RDMA`, `INFINIBAND_IPOIB`, `SUNRPC_XPRT_RDMA`, `SMB_SERVER_SMBDIRECT`, and `CIFS_SMB_DIRECT`. I'm going to quickly double-check the placement of `SMB_SERVER_SMBDIRECT` and `CIFS_SMB_DIRECT` in the kernel configs, just to be sure. Yep, `CIFS_SMB_DIRECT` is in `fs/smb/client/Kconfig`, and `SMB_SERVER_SMBDIRECT` is in `fs/smb/server/Kconfig`. And both correctly select `SMBDIRECT`. Good.

I'll quickly confirm `SUNRPC_XPRT_RDMA` is where it should be, which is in `net/sunrpc/Kconfig`. `INFINIBAND_IPOIB` is in `drivers/infiniband/ulp/ipoib/Kconfig`, that's correct. `RDS_RDMA` is in `net/rds/Kconfig`, and finally, `NVME_RDMA` and `NVME_TARGET_RDMA` are in `drivers/nvme/host/Kconfig` and `drivers/nvme/target/Kconfig` respectively, as expected. And, I see `RDMA_RXE` is in `drivers/infiniband/sw/rxe/Kconfig`.

Okay, that all looks solid. A comprehensive list of relevant configuration options.

Now, let's step back and re-evaluate the core reasoning behind this entire investigation. The patch specifically alters the types of certain fields within `struct ib_device_attr` from `int` to `u32`, and the associated `min_t` and `max_t` calls are being updated to `min` and `max` across the RDMA subsystem. This change directly impacts signedness comparisons and, crucially, corrects potential truncation errors, for instance when using `min3(..., ..., U8_MAX)` instead of `min_t(u8, ...)`. These are fundamental changes to the core RDMA logic and the underlying drivers, so this makes the RDMA subsystem a prime target for fuzzing. It's definitely something worth exploring in depth.

Alright, I think I'm ready to call `set-results`. I have a solid grasp of the relevant areas.



52/2 2026/07/09 20:17 tool set-results
0m Args:
{
  "EnableConfigs": [
    "RDMA_RXE",
    "NVME_RDMA",
    "NVME_TARGET_RDMA",
    "RDS_RDMA",
    "INFINIBAND_IPOIB",
    "SUNRPC_XPRT_RDMA",
    "SMB_SERVER_SMBDIRECT",
    "CIFS_SMB_DIRECT"
  ],
  "FocusSymbols": [
    "rxe_qp_chk_init",
    "rxe_qp_chk_attr",
    "rxe_srq_chk_init",
    "rxe_srq_chk_attr",
    "nvme_rdma_create_queue_ib",
    "nvmet_rdma_queue_connect",
    "rds_ib_cm_handle_connect",
    "rds_ib_cm_initiate_connect",
    "ipoib_cm_dev_init",
    "frwr_query_device",
    "smbdirect_accept_connect_request"
  ],
  "Reasoning": "The patch changes the types of several fields in `struct ib_device_attr` from `int` to `u32`, and updates the corresponding `min_t` and `max_t` calls to `min` and `max` across the RDMA subsystem. This affects signedness in comparisons and fixes potential truncation bugs (e.g. using `min3(..., ..., U8_MAX)` instead of `min_t(u8, ...)`). These changes modify core RDMA logic and drivers, making it worth fuzzing.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "RDMA_RXE",
    "NVME_RDMA",
    "NVME_TARGET_RDMA",
    "RDS_RDMA",
    "INFINIBAND_IPOIB",
    "SUNRPC_XPRT_RDMA",
    "SMB_SERVER_SMBDIRECT",
    "CIFS_SMB_DIRECT"
  ],
  "FocusSymbols": [
    "rxe_qp_chk_init",
    "rxe_qp_chk_attr",
    "rxe_srq_chk_init",
    "rxe_srq_chk_attr",
    "nvme_rdma_create_queue_ib",
    "nvmet_rdma_queue_connect",
    "rds_ib_cm_handle_connect",
    "rds_ib_cm_initiate_connect",
    "ipoib_cm_dev_init",
    "frwr_query_device",
    "smbdirect_accept_connect_request"
  ],
  "Reasoning": "The patch changes the types of several fields in `struct ib_device_attr` from `int` to `u32`, and updates the corresponding `min_t` and `max_t` calls to `min` and `max` across the RDMA subsystem. This affects signedness in comparisons and fixes potential truncation bugs (e.g. using `min3(..., ..., U8_MAX)` instead of `min_t(u8, ...)`). These changes modify core RDMA logic and drivers, making it worth fuzzing.",
  "WorthFuzzing": true
}

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)