RDMA: Change capability fields in ib_device_attr from int to u32
Subsystems (19)
PATCH v7 1/1 RDMA: Change capability fields in ib_device_attr from int to u32
The capability counter fields in struct ib_device_attr are declared as signed int, but these values are inherently non-negative. Drivers maintain their cached caps as u32 and assign them directly into these int fields; if a cap exceeds INT_MAX the implicit narrowing yields a negative value visible to the IB core.
Change the signed int capability fields to u32 to match the underlying nature of the data. Also update consumers across the IB core, ULPs, NVMe-oF target, RDS, and NFS/RDMA so the new u32 values are not forced back through signed int or u8 via min()/min_t() or narrowing local variables.
---
Changes in v7:
* Drop min_t() in all sites where a plain min() (or min3()) works cleanly
* Guard nvme/host/rdma.c num_inline_segments computation against a device reporting max_send_sge == 0, so the u32 subtract cannot wrap to UINT_MAX.
* Use %u when printing the newly-u32 capability fields
in diagnostic messages.
Changes in v6:
* Fix subject prefix: net-next -> rdma-next.
Changes in v5:
* Add U8_MAX clamps in iser_verbs, nvme/host, nvme/target, isert,
* rds/ib_cm,
smbdirect/connect and smbdirect/accept where u32 capability fields
were
directly narrowed into u8 rdma_conn_param fields without clamping
* Guard the inline_sge_count calculation in nvmet_rdma_find_get_device()
* to
prevent u32 underflow when both max_sge_rd and max_recv_sge are zero
* Expand type migration to 9 additional fields (max_mw, max_raw_ethy_qp, max_mcast_grp, max_mcast_qp_attach, max_total_mcast_qp_attach, max_ah, max_srq, max_srq_wr, max_srq_sge)
* Fix min_t(int,...) in svc_rdma_transport; min_t(u32,...) in ipoib,
* srpt,
nvme/target, rds/ib, rtrs-clt, rtrs-srv, xprtrdma/verbs
* Fix frwr_ops.c u32 underflow guard (reorder check before subtraction)
* Change sc_max_send_sges to unsigned int, inline_sge_count to u32
* Fix %d -> %u in rxe_qp, rxe_srq, ipoib_cm, ib_isert,
* svc_rdma_transport
* Update commit message.
Changes in v4:
* Drop clamping the values in mana_ib_query_device, instead update the props values from int to u32.
Changes in v3:
* Drop clamping from mana_ib_gd_query_adapter_caps(). The internal u32 caps cache does not need to be clamped.
* Move all clamping exclusively to mana_ib_query_device(), which is the only place the cached u32 values are narrowed into the signed int fields of struct ib_device_attr.
* Reframe commit message: this is a u32-to-int type boundary fix, not a CVM/untrusted-hardware hardening patch.
Changes in v2:
* Update patch title.
--- drivers/infiniband/hw/qedr/verbs.c | 2 +- drivers/infiniband/sw/rxe/rxe_qp.c | 16 ++++----- drivers/infiniband/sw/rxe/rxe_srq.c | 16 ++++----- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 7 ++-- drivers/infiniband/ulp/iser/iser_verbs.c | 2 +- drivers/infiniband/ulp/isert/ib_isert.c | 8 ++--- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 12 +++---- drivers/infiniband/ulp/rtrs/rtrs-srv.c | 8 ++--- drivers/infiniband/ulp/srp/ib_srp.c | 2 +- drivers/infiniband/ulp/srpt/ib_srpt.c | 18 +++++----- drivers/nvme/host/rdma.c | 8 +++-- drivers/nvme/target/rdma.c | 18 +++++----- fs/smb/smbdirect/accept.c | 5 +-- fs/smb/smbdirect/connect.c | 5 +-- fs/smb/smbdirect/connection.c | 8 ++--- include/linux/sunrpc/svc_rdma.h | 4 +-- include/rdma/ib_verbs.h | 42 ++++++++++++------------ net/rds/ib.c | 2 +- net/rds/ib_cm.c | 6 ++-- net/sunrpc/xprtrdma/frwr_ops.c | 7 ++-- net/sunrpc/xprtrdma/svc_rdma_transport.c | 6 ++-- net/sunrpc/xprtrdma/verbs.c | 2 +- 22 files changed, 107 insertions(+), 97 deletions(-)
drivers/infiniband/hw/qedr/verbs.c +1 -1
@@ -151,7 +151,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;
drivers/infiniband/sw/rxe/rxe_qp.c +8 -8
@@ -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; } }
drivers/infiniband/sw/rxe/rxe_srq.c +8 -8
@@ -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; }
drivers/infiniband/ulp/ipoib/ipoib_cm.c +4 -3
@@ -1582,7 +1582,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; +int i; +u32 max_srq_sge;u8 addr;INIT_LIST_HEAD (&priv->cm.passive_ids);
@@ -1600,9 +1601,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 ;
drivers/infiniband/ulp/iser/iser_verbs.c +1 -1
@@ -589,7 +589,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 ;
drivers/infiniband/ulp/isert/ib_isert.c +4 -4
@@ -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,8 @@ 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) {
drivers/infiniband/ulp/rtrs/rtrs-clt.c +6 -6
@@ -1682,7 +1682,7 @@ static int create_con_cq_qp(struct rtrs_clt_con *con)* in case qp gets into error state. */ max_send_wr = -min_t (int, wr_limit,SERVICE_CON_QUEUE_DEPTH *2 +2 ); +min (wr_limit,SERVICE_CON_QUEUE_DEPTH *2 +2 ); max_recv_wr = max_send_wr; }else {/*
@@ -1698,11 +1698,11 @@ 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 ); + max_send_wr =min_t (u32, wr_limit, +/* QD * (REQ + RSP + FR REGS or INVS) + drain */ + clt_path->queue_depth *4 +1 ); + max_recv_wr =min_t (u32, wr_limit, + clt_path->queue_depth *3 +1 ); max_send_sge =2 ; }atomic_set (&con->c.sq_wr_avail, max_send_wr);
drivers/infiniband/ulp/rtrs/rtrs-srv.c +4 -4
@@ -1731,8 +1731,8 @@ 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 );
@@ -1740,11 +1740,11 @@ static int create_con(struct rtrs_srv_path *srv_path,/* when always_invlaidate enalbed, we need linv+rinv+mr+imm */ if (always_invalidate) max_send_wr = -min_t (int, wr_limit, +min_t (u32, wr_limit, srv->queue_depth * (1 +4 ) +1 );else max_send_wr = -min_t (int, wr_limit, +min_t (u32, wr_limit, srv->queue_depth * (1 +2 ) +1 ); max_recv_wr = srv->queue_depth +1 ;
drivers/infiniband/ulp/srp/ib_srp.c +1 -1
@@ -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;
drivers/infiniband/ulp/srpt/ib_srpt.c +9 -9
@@ -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." );
@@ -1850,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 );
@@ -1911,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; }
@@ -1925,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);
@@ -2298,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);
@@ -3136,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);
@@ -3951,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; }
drivers/nvme/host/rdma.c +5 -3
@@ -394,8 +394,9 @@ 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 =min (ndev->dev->attrs.max_send_sge ? + ndev->dev->attrs.max_send_sge -1 :0 , +NVME_RDMA_MAX_INLINE_SEGMENTS );list_add (&ndev->entry, &device_list); out_unlock:mutex_unlock (&device_list_mutex);
@@ -1845,7 +1846,8 @@ 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 ;
drivers/nvme/target/rdma.c +10 -8
@@ -1149,10 +1149,10 @@ static int nvmet_rdma_init_srqs(struct nvmet_rdma_device *ndev)return 0 ; } - 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_size =min_t (u32, ndev->device->attrs.max_srq_wr, + nvmet_rdma_srq_size); + 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)
@@ -1197,7 +1197,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);
@@ -1213,7 +1213,8 @@ 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); + inline_sge_count = inline_sge_count ? inline_sge_count -1 :0 ;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,
@@ -1553,8 +1554,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 );
fs/smb/smbdirect/accept.c +3 -2
@@ -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;
fs/smb/smbdirect/connect.c +3 -2
@@ -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);
fs/smb/smbdirect/connection.c +4 -4
@@ -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,
include/linux/sunrpc/svc_rdma.h +2 -2
@@ -78,8 +78,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 */
include/rdma/ib_verbs.h +21 -21
57 lines not on this page · raw message
net/rds/ib.c +1 -1
@@ -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);
net/rds/ib_cm.c +4 -2
@@ -174,9 +174,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); +min3 (rds_ibdev->max_responder_resources, + max_responder_resources,U8_MAX ); conn_param->initiator_depth = -min_t (u32, rds_ibdev->max_initiator_depth, max_initiator_depth); +min3 (rds_ibdev->max_initiator_depth, + max_initiator_depth,U8_MAX ); conn_param->retry_count = min_t(unsigned int, rds_ib_retry_count, 7); conn_param->rnr_retry_count =7 ;
net/sunrpc/xprtrdma/frwr_ops.c +4 -3
@@ -172,7 +172,8 @@ 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; +u32 max_qp_wr; +int depth, delta;unsigned int max_sge; if (!(attrs->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) ||
@@ -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;
net/sunrpc/xprtrdma/svc_rdma_transport.c +3 -3
@@ -544,8 +544,8 @@ 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);
@@ -570,7 +570,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);
net/sunrpc/xprtrdma/verbs.c +1 -1
@@ -453,7 +453,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
Signature · 1 line
2.34.1
Quoted 11 lines · Erni Sri Satya Vennela
The capability counter fields in struct
ib_device_attrare declared as signed int, but these values are inherently non-negative. Drivers maintain their cached caps as u32 and assign them directly into these int fields; if a cap exceedsINT_MAXthe implicit narrowing yields a negative value visible to the IB core.Change the signed int capability fields to u32 to match the underlying nature of the data. Also update consumers across the IB core, ULPs, NVMe-oF target, RDS, and NFS/RDMA so the new u32 values are not forced back through signed int or u8 via min()/min_t() or narrowing local variables.
...
drivers/infiniband/hw/qedr/verbs.c int qedr_query_device(struct ib_device *ibdev, · line 152
Quoted 2 lines
drivers/infiniband/hw/qedr/verbs.c +0
-0attr->max_qp_init_rd_atom =1 << (fls (qattr->max_qp_req_rd_atomic_resc) -1 );
FWIW, this one and below looks like reinvention of rounddown_pow_of_two().
Quoted 4 lines
drivers/infiniband/hw/qedr/verbs.c +1
-1attr->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);
...
drivers/infiniband/ulp/ipoib/ipoib_cm.c static void ipoib_cm_create_srq(struct net_device *dev, int max_sge) · line 1587
Quoted 7 lines
int
ipoib_cm_dev_init(struct net_device *dev)
{drivers/infiniband/ulp/ipoib/ipoib_cm.c +2
-1struct ipoib_dev_priv *priv =ipoib_priv (dev); -int max_srq_sge, i; +int i; +u32 max_srq_sge;u8 addr;
It seems the order is reversed xmas tree, why not preserving it?
...
drivers/infiniband/ulp/rtrs/rtrs-clt.c static int create_con_cq_qp(struct rtrs_clt_con *con) · line 1685
Quoted 6 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c +1
-1max_send_wr = -min_t (int, wr_limit,SERVICE_CON_QUEUE_DEPTH *2 +2 ); +min (wr_limit,SERVICE_CON_QUEUE_DEPTH *2 +2 );
Now perfectly a single line
max_send_wr = min(wr_limit, SERVICE_CON_QUEUE_DEPTH * 2 + 2);
Quoted 1 line
max_recv_wr=max_send_wr;
...
drivers/infiniband/ulp/rtrs/rtrs-clt.c static int create_con_cq_qp(struct rtrs_clt_con *con) · line 1705
Quoted 10 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c +5
-5- 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 ); + max_send_wr =min_t (u32, wr_limit, +/* QD * (REQ + RSP + FR REGS or INVS) + drain */ + clt_path->queue_depth *4 +1 ); + max_recv_wr =min_t (u32, wr_limit, + clt_path->queue_depth *3 +1 );
Can we rather update the type of one of them and use min() instead?
...
drivers/infiniband/ulp/rtrs/rtrs-srv.c
Quoted 2 lines
drivers/infiniband/ulp/rtrs/rtrs-srv.c +0
-0
Ditto.
...
drivers/infiniband/ulp/rtrs/rtrs-srv.c
Quoted 4 lines
drivers/infiniband/ulp/rtrs/rtrs-srv.c +2
-2-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 );
Theoretically this might break ABI (if somebody uses negative values for anything. I don't think it's the case, but just be informed.
Quoted 2 lines
MODULE_PARM_DESC(srpt_srq_size,
"Shared receive queue (SRQ) size.");
...
drivers/nvme/target/rdma.c static int nvmet_rdma_init_srqs(struct nvmet_rdma_device *ndev) · line 1155
Quoted 11 lines
drivers/nvme/target/rdma.c +4
-4- 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_size =min_t (u32, ndev->device->attrs.max_srq_wr, + nvmet_rdma_srq_size); + ndev->srq_count =min_t (u32, ndev->device->num_comp_vectors, + ndev->device->attrs.max_srq);
Same question, can we change type type of variables instead?
Quoted 1 line
mutex_lock(&device_list_mutex);
...
drivers/nvme/target/rdma.c nvmet_rdma_find_get_device(struct rdma_cm_id *cm_id) · line 1217
Quoted 5 lines
drivers/nvme/target/rdma.c +2
-1inline_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); + inline_sge_count = inline_sge_count ? inline_sge_count -1 :0 ;
Simple conditional might be better
if (inline_sge_count) inline_sge_count--; OR inline_sge_count -= 1;
...
drivers/nvme/target/rdma.c
Quoted 6 lines
+++
b/include/rdma/ib_verbs.hdrivers/nvme/target/rdma.c +2
-2-int max_qp; -int max_qp_wr; +u32 max_qp; +u32 max_qp_wr;
Nice, but please check that none of these (and beyond) were not used in signed multiplication or (which is more disasterous) division. Otherwise it might be subtle issues that will be hard to debug.
...
drivers/nvme/target/rdma.c
Quoted 8 lines
drivers/nvme/target/rdma.c +4
-2conn_param->responder_resources = -min_t (u32, rds_ibdev->max_responder_resources, max_responder_resources); +min3 (rds_ibdev->max_responder_resources, + max_responder_resources,U8_MAX ); conn_param->initiator_depth = -min_t (u32, rds_ibdev->max_initiator_depth, max_initiator_depth); +min3 (rds_ibdev->max_initiator_depth, + max_initiator_depth,U8_MAX );
I believe we can go a few characters over and leave them to be single lines.
Quoted 1 line
conn_param->retry_count=min_t(unsigned int, rds_ib_retry_count, 7);
What about this one?
Quoted 1 line
conn_param->rnr_retry_count= 7;
...
drivers/nvme/target/rdma.c
Quoted 7 lines
int
frwr_query_device(struct rpcrdma_ep *ep, const struct ib_device *device){drivers/nvme/target/rdma.c +2
-1const struct ib_device_attr *attrs = &device->attrs; -int max_qp_wr, depth, delta; +u32 max_qp_wr; +int depth, delta;unsigned int max_sge;
Reversed xmas tree order.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Am 06.06.26 um 09:07 schrieb Erni Sri Satya Vennela:
Quoted 64 lines
fs/smb/smbdirect/accept.c +3
-2@@ -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;fs/smb/smbdirect/connect.c +3
-2@@ -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);fs/smb/smbdirect/connection.c +3
-3@@ -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,
fs/smb/smbdirect/connection.c int smbdirect_connection_create_qp(struct smbdirect_socket *sc) · line 334
Quoted 8 lines
fs/smb/smbdirect/connection.c +1
-1@@ -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,
Thanks!
metze
Hi Andy,
Sorry for delayed response.
Quoted 4 lines
drivers/infiniband/hw/qedr/verbs.c int qedr_query_device(struct ib_device *ibdev, · line 152
Quoted 2 lines
drivers/infiniband/hw/qedr/verbs.c +0
-0attr->max_qp_init_rd_atom =1 << (fls (qattr->max_qp_req_rd_atomic_resc) -1 );FWIW, this one and below looks like reinvention of
rounddown_pow_of_two().
Acked.
Quoted 8 lines
Quoted 5 lines
drivers/infiniband/hw/qedr/verbs.c +1
-1attr->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);...
Quoted 10 lines
drivers/infiniband/ulp/ipoib/ipoib_cm.c static void ipoib_cm_create_srq(struct net_device *dev, int max_sge) · line 1587
Quoted 7 lines
int
ipoib_cm_dev_init(struct net_device *dev)
{drivers/infiniband/ulp/ipoib/ipoib_cm.c +2
-1struct ipoib_dev_priv *priv =ipoib_priv (dev); -int max_srq_sge, i; +int i; +u32 max_srq_sge;u8 addr;It seems the order is reversed xmas tree, why not preserving it?
Right. I'll fix it in the next version.
Quoted 17 lines
...
drivers/infiniband/ulp/rtrs/rtrs-clt.c static int create_con_cq_qp(struct rtrs_clt_con *con) · line 1685
Quoted 6 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c +1
-1max_send_wr = -min_t (int, wr_limit,SERVICE_CON_QUEUE_DEPTH *2 +2 ); +min (wr_limit,SERVICE_CON_QUEUE_DEPTH *2 +2 );Now perfectly a single line
max_send_wr = min(wr_limit, SERVICE_CON_QUEUE_DEPTH * 2 + 2);Quoted 1 line
max_recv_wr=max_send_wr;...
Quoted 13 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c static int create_con_cq_qp(struct rtrs_clt_con *con) · line 1705
Quoted 10 lines
drivers/infiniband/ulp/rtrs/rtrs-clt.c +5
-5- 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 ); + max_send_wr =min_t (u32, wr_limit, +/* QD * (REQ + RSP + FR REGS or INVS) + drain */ + clt_path->queue_depth *4 +1 ); + max_recv_wr =min_t (u32, wr_limit, + clt_path->queue_depth *3 +1 );Can we rather update the type of one of them and use
min()instead?
I'll remove all the min_t usages in the next version.
Quoted 9 lines
...
drivers/infiniband/ulp/rtrs/rtrs-srv.c
Quoted 2 lines
drivers/infiniband/ulp/rtrs/rtrs-srv.c +0
-0Ditto.
...
Quoted 8 lines
drivers/infiniband/ulp/rtrs/rtrs-srv.c
Quoted 4 lines
drivers/infiniband/ulp/rtrs/rtrs-srv.c +2
-2-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 );Theoretically this might break ABI (if somebody uses negative values for anything. I don't think it's the case, but just be informed.
Okay. Thankyou for the information.
Quoted 8 lines
Quoted 2 lines
MODULE_PARM_DESC(srpt_srq_size,
"Shared receive queue (SRQ) size.");...
Quoted 2 lines
drivers/nvme/target/rdma.c +0
-0
Quoted 11 lines
drivers/nvme/target/rdma.c static int nvmet_rdma_init_srqs(struct nvmet_rdma_device *ndev) · line 1155
Quoted 8 lines
drivers/nvme/target/rdma.c +4
-4- 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_size =min_t (u32, ndev->device->attrs.max_srq_wr, + nvmet_rdma_srq_size); + ndev->srq_count =min_t (u32, ndev->device->num_comp_vectors, + ndev->device->attrs.max_srq);Same question, can we change type type of variables instead?
Yes. I'll be doing it in the next version.
Quoted 12 lines
Quoted 1 line
mutex_lock(&device_list_mutex);...
drivers/nvme/target/rdma.c nvmet_rdma_find_get_device(struct rdma_cm_id *cm_id) · line 1217
Quoted 5 lines
drivers/nvme/target/rdma.c +2
-1inline_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); + inline_sge_count = inline_sge_count ? inline_sge_count -1 :0 ;Simple conditional might be better
Quoted 4 lines
if (inline_sge_count) inline_sge_count--; OR inline_sge_count -= 1;
Okay. I'll update all such instances.
Quoted 5 lines
...
Quoted 1 line
+++
b/include/rdma/ib_verbs.h
Quoted 8 lines
drivers/nvme/target/rdma.c
Quoted 4 lines
drivers/nvme/target/rdma.c +2
-2-int max_qp; -int max_qp_wr; +u32 max_qp; +u32 max_qp_wr;Nice, but please check that none of these (and beyond) were not used in signed multiplication or (which is more disasterous) division. Otherwise it might be subtle issues that will be hard to debug.
Yes I have checked that for all the variables I updated.
Quoted 14 lines
...
drivers/nvme/target/rdma.c
Quoted 8 lines
drivers/nvme/target/rdma.c +4
-2conn_param->responder_resources = -min_t (u32, rds_ibdev->max_responder_resources, max_responder_resources); +min3 (rds_ibdev->max_responder_resources, + max_responder_resources,U8_MAX ); conn_param->initiator_depth = -min_t (u32, rds_ibdev->max_initiator_depth, max_initiator_depth); +min3 (rds_ibdev->max_initiator_depth, + max_initiator_depth,U8_MAX );I believe we can go a few characters over and leave them to be single lines.
Okay.
Quoted 3 lines
Quoted 1 line
conn_param->retry_count=min_t(unsigned int, rds_ib_retry_count, 7);What about this one?
Sorry. I missed this one, I'll update it.
Quoted 5 lines
Quoted 2 lines
conn_param->rnr_retry_count= 7;...
Quoted 9 lines
drivers/nvme/target/rdma.c
Quoted 7 lines
int
frwr_query_device(struct rpcrdma_ep *ep, const struct ib_device *device){drivers/nvme/target/rdma.c +2
-1const struct ib_device_attr *attrs = &device->attrs; -int max_qp_wr, depth, delta; +u32 max_qp_wr; +int depth, delta;unsigned int max_sge;Reversed xmas tree order.
Okay
Thankyou for all your suggestions.
The next version will be incorporated with all these changes.
- Vennela
Quoted 5 lines
Signature · 3 lines
-- With Best Regards, Andy Shevchenko