Address issues detected by static analysis tools
Subsystems (15)
cover Address issues detected by static analysis tools
Hello Doug,
As we all know there are several static analysis tools available for the Linux kernel and these tools are valuable. I'm referring to increasing the gcc warning level (W=1), sparse and smatch. It is helpful to analyze new code with these tools before submitting a patch. These tools are most useful if existing code is clean. Hence this patch series that significantly reduces the number of complaints reported by static analysis tools. Please consider this patch series for kernel v4.15.
Thanks,
Bart.
Bart Van Assche (47):
IB/core: Fix endianness annotation in rdma_is_multicast_addr() IB/cm: Suppress gcc 7 fall-through complaints
RDMA/cma: Avoid triggering undefined behavior RDMA/iwcm: Remove a set-but-not-used variable RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing RDMA/isert: Suppress gcc 7 fall-through complaints RDMA/bnxt_re: Suppress gcc 7 fall-through complaints RDMA/bnxt_re: Remove set-but-not-used variables RDMA/cxgb3: Annotate locking assumptions
RDMA/cxgb3: Annotate an RCU pointer
RDMA/cxgb3: Remove a set-but-not-used variable RDMA/cxgb4: Fix indentation
RDMA/cxgb4: Declare a local variable 'static' RDMA/cxgb4: Suppress gcc 7 fall-through complaints RDMA/cxgb4: Remove a set-but-not-used variable
IB/hfi1: Suppress gcc 7 fall-through complaints IB/hfi1: Remove set-but-not-used variables
IB/hfi1: Define hfi1_handle_cnp_tbl[] once
IB/hns: Annotate iomem pointers correctly
IB/hns: Declare local functions 'static'
RDMA/i40iw: Fix a race condition
RDMA/i40iw: Suppress gcc 7 fall-through complaints RDMA/i40iw: Remove a set-but-not-used variable IB/mthca: Fix indentation
IB/mlx4: Suppress gcc 7 fall-through complaints IB/mlx5: Suppress gcc 7 fall-through complaints IB/mlx5: Remove a set-but-not-used variable
IB/nes: Fix indentation
IB/nes: Suppress gcc 7 fall-through complaints
IB/nes: Remove set-but-not-used variables
IB/nes: Fix a race condition in nes_inetaddr_event() RDMA/ocrdma: Use NULL instead of 0 to represent a pointer RDMA/ocrdma: Suppress gcc 7 fall-through complaints RDMA/ocrdma: Remove set-but-not-used variables
IB/opa: Fix endianness annotation of opa_is_extended_lid() RDMA/qedr: Use NULL instead of 0 to represent a pointer RDMA/qedr: Declare local functions static
RDMA/qedr: Annotate iomem pointers correctly
RDMA/qedr: Remove set-but-not-used variables
IB/qib: Make qib_inc_eeprom_err() macro more safe to use IB/qib: Suppress gcc 7 fall-through complaints
IB/qib: Remove set-but-not-used variables
RDMA/rdmavt: Suppress gcc 7 fall-through complaints RDMA/rxe: Suppress gcc 7 fall-through complaints RDMA/usnic: Make the compiler check declaration consistency during
compilation
RDMA/usnic: Remove a set-but-not-used variable RDMA/usnic: Instantiate data structures once
drivers/infiniband/core/cm.c | 1 + drivers/infiniband/core/cma.c | 11 ++-- drivers/infiniband/core/iwcm.c | 3 -- drivers/infiniband/core/uverbs_ioctl.c | 20 ++++---- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 12 ++--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 7 +-- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 4 -- drivers/infiniband/hw/bnxt_re/qplib_sp.c | 5 +- drivers/infiniband/hw/cxgb3/iwch_cm.c | 6 +-- drivers/infiniband/hw/cxgb3/iwch_qp.c | 3 ++ drivers/infiniband/hw/cxgb4/cm.c | 14 +++-- drivers/infiniband/hw/cxgb4/device.c | 4 +- drivers/infiniband/hw/hfi1/driver.c | 6 +++ drivers/infiniband/hw/hfi1/file_ops.c | 4 +- drivers/infiniband/hw/hfi1/hfi.h | 5 -- drivers/infiniband/hw/hfi1/mad.c | 3 +- drivers/infiniband/hw/hfi1/rc.c | 2 +- drivers/infiniband/hw/hfi1/ruc.c | 9 ---- drivers/infiniband/hw/hfi1/sdma.c | 5 +- drivers/infiniband/hw/hfi1/ud.c | 2 - drivers/infiniband/hw/hfi1/verbs.c | 10 ---- drivers/infiniband/hw/hns/hns_roce_eq.c | 6 +-- drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 73 +++++++++++++++------------ drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 3 +- drivers/infiniband/hw/i40iw/i40iw_cm.c | 3 +- drivers/infiniband/hw/i40iw/i40iw_hw.c | 1 + drivers/infiniband/hw/i40iw/i40iw_puda.c | 1 + drivers/infiniband/hw/i40iw/i40iw_utils.c | 13 +++-- drivers/infiniband/hw/mlx4/cq.c | 2 + drivers/infiniband/hw/mlx4/mcg.c | 1 + drivers/infiniband/hw/mlx5/cq.c | 2 + drivers/infiniband/hw/mlx5/qp.c | 3 +- drivers/infiniband/hw/mthca/mthca_main.c | 10 ++-- drivers/infiniband/hw/nes/nes.c | 33 +++++++----- drivers/infiniband/hw/nes/nes_cm.c | 9 +--- drivers/infiniband/hw/nes/nes_hw.c | 6 +-- drivers/infiniband/hw/nes/nes_nic.c | 10 ++-- drivers/infiniband/hw/nes/nes_utils.c | 13 +++-- drivers/infiniband/hw/nes/nes_verbs.c | 12 ++--- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 6 +-- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 4 +- drivers/infiniband/hw/qedr/main.c | 24 ++++----- drivers/infiniband/hw/qedr/qedr_iw_cm.c | 14 ++--- drivers/infiniband/hw/qedr/qedr_roce_cm.c | 29 +++++------ drivers/infiniband/hw/qedr/verbs.c | 9 +--- drivers/infiniband/hw/qib/qib.h | 2 +- drivers/infiniband/hw/qib/qib_diag.c | 6 --- drivers/infiniband/hw/qib/qib_file_ops.c | 9 ---- drivers/infiniband/hw/qib/qib_iba6120.c | 2 - drivers/infiniband/hw/qib/qib_iba7220.c | 3 -- drivers/infiniband/hw/qib/qib_iba7322.c | 15 ++---- drivers/infiniband/hw/qib/qib_mad.c | 4 +- drivers/infiniband/hw/qib/qib_pcie.c | 3 +- drivers/infiniband/hw/qib/qib_rc.c | 2 +- drivers/infiniband/hw/qib/qib_sd7220.c | 2 - drivers/infiniband/hw/qib/qib_sdma.c | 2 +- drivers/infiniband/hw/qib/qib_tx.c | 4 -- drivers/infiniband/hw/qib/qib_verbs.c | 3 +- drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 2 - drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h | 25 +-------- drivers/infiniband/hw/usnic/usnic_ib_sysfs.c | 1 + drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 25 +++++++++ drivers/infiniband/sw/rdmavt/qp.c | 1 + drivers/infiniband/sw/rxe/rxe_comp.c | 4 +- drivers/infiniband/sw/rxe/rxe_task.c | 2 +- drivers/infiniband/sw/rxe/rxe_verbs.c | 1 + drivers/infiniband/ulp/isert/ib_isert.c | 14 ++--- drivers/net/ethernet/chelsio/cxgb3/t3cdev.h | 2 +- include/rdma/ib_addr.h | 4 +- include/rdma/opa_addr.h | 2 +- 70 files changed, 252 insertions(+), 311 deletions(-)
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/47 IB/core: Fix endianness annotation in rdma_is_multicast_addr()
In reply to a message not in the archiveSince ipv4_addr is a big endian 32-bit number, annotate it as such.
--- include/rdma/ib_addr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/rdma/ib_addr.h +2 -2
@@ -305,12 +305,12 @@ static inline void rdma_get_ll_mac(struct in6_addr *addr, u8 *mac)static inline int rdma_is_multicast_addr (struct in6_addr *addr) { -u32 ipv4_addr; +__be32 ipv4_addr;if (addr->s6_addr[0 ] ==0xff )return 1 ; -memcpy (&ipv4_addr, addr->s6_addr +12 ,4 ); + ipv4_addr = addr->s6_addr32[3 ];return (ipv6_addr_v4mapped (addr) &&ipv4_is_multicast (ipv4_addr)); }
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/47 IB/cm: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/core/cm.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/core/cm.c +1 -0
@@ -2808,6 +2808,7 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id, msg_response =CM_MSG_RESPONSE_OTHER ;break ; } +/* fall through */ default : ret = -EINVAL ; goto error1;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/47 RDMA/cma: Avoid triggering undefined behavior
In reply to a message not in the archiveAccording to the C standard the behavior of computations with integer operands is as follows:
* A computation involving unsigned operands can never overflow, because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting type.
* The behavior for signed integer underflow and overflow is undefined.
Hence only use unsigned integers when checking for integer overflow.
This patch is what I came up with after having analyzed the following smatch warnings:
drivers/infiniband/core/cma.c:3448: cma_resolve_ib_udp() warn: signed overflow undefined. 'offset + conn_param->private_data_len < conn_param->private_data_len' drivers/infiniband/core/cma.c:3505: cma_connect_ib() warn: signed overflow undefined. 'offset + conn_param->private_data_len < conn_param->private_data_len'
--- drivers/infiniband/core/cma.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/infiniband/core/cma.c +7 -4
@@ -1540,7 +1540,7 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id,return id_priv; } -static inline int cma_user_data_offset (struct rdma_id_private *id_priv) +static inline u8 cma_user_data_offset (struct rdma_id_private *id_priv) {return cma_family (id_priv) ==AF_IB ?0 :sizeof (struct cma_hdr ); }
@@ -1942,7 +1942,8 @@ static int cma_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)struct rdma_id_private *listen_id, *conn_id =NULL ;struct rdma_cm_event event;struct net_device *net_dev; -int offset, ret; +u8 offset; +int ret; listen_id =cma_id_from_event (cm_id, ib_event, &net_dev);if (IS_ERR (listen_id))
@@ -3440,7 +3441,8 @@ static int cma_resolve_ib_udp(struct rdma_id_private *id_priv,struct ib_cm_sidr_req_param req;struct ib_cm_id *id;void *private_data; -int offset, ret; +u8 offset; +int ret;memset (&req,0 ,sizeof req); offset =cma_user_data_offset (id_priv);
@@ -3497,7 +3499,8 @@ static int cma_connect_ib(struct rdma_id_private *id_priv,struct rdma_route *route;void *private_data;struct ib_cm_id *id; -int offset, ret; +u8 offset; +int ret;memset (&req,0 ,sizeof req); offset =cma_user_data_offset (id_priv);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/47 RDMA/iwcm: Remove a set-but-not-used variable
In reply to a message not in the archive--- drivers/infiniband/core/iwcm.c | 3 --- 1 file changed, 3 deletions(-)
drivers/infiniband/core/iwcm.c +0 -3
@@ -447,9 +447,6 @@ static void destroy_cm_id(struct iw_cm_id *cm_id)*/ void iw_destroy_cm_id (struct iw_cm_id *cm_id) { -struct iwcm_id_private *cm_id_priv; - - cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);destroy_cm_id (cm_id); }EXPORT_SYMBOL (iw_destroy_cm_id);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 5/47 RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
In reply to a message not in the archiveThis patch reduces the number of #ifdefs and also avoids that smatch reports the following:
drivers/infiniband/core/uverbs_ioctl.c:276: ib_uverbs_cmd_verbs() warn: if statement not indented drivers/infiniband/core/uverbs_ioctl.c:280: ib_uverbs_cmd_verbs() warn: possible memory leak of 'ctx' drivers/infiniband/core/uverbs_ioctl.c:315: ib_uverbs_cmd_verbs() warn: if statement not indented
References: commit fac9658cabb9 ("IB/core: Add new ioctl interface")
--- drivers/infiniband/core/uverbs_ioctl.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/infiniband/core/uverbs_ioctl.c +9 -11
@@ -234,7 +234,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,const struct uverbs_method_spec *method_spec;long err =0 ;unsigned int i; -struct { +struct attr_and_bundle {struct ib_uverbs_attr *uattrs;struct uverbs_attr_bundle *uverbs_attr_bundle; } *ctx =NULL ;
@@ -242,7 +242,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,unsigned long *curr_bitmap;size_t ctx_size;#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ -uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ /sizeof (uintptr_t )]; +uintptr_t __data[UVERBS_OPTIMIZE_USING_STACK_SZ /sizeof (uintptr_t )]; +struct attr_and_bundle *const data = (void *)__data; +#else +struct attr_and_bundle *const data =NULL ;#endif if (hdr->reserved)
@@ -269,13 +272,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, (method_spec->num_child_attrs /BITS_PER_LONG + method_spec->num_buckets); -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ if (ctx_size <=UVERBS_OPTIMIZE_USING_STACK_SZ ) - ctx = (void *)data; - + ctx = data;if (!ctx) -#endif - ctx =kmalloc (ctx_size,GFP_KERNEL ); + ctx =kmalloc (ctx_size,GFP_KERNEL );if (!ctx)return -ENOMEM ;
@@ -311,10 +311,8 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, err =uverbs_handle_method (buf, ctx->uattrs, hdr->num_attrs, ib_dev, file, method_spec, ctx->uverbs_attr_bundle); out: -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ - if (ctx_size > UVERBS_OPTIMIZE_USING_STACK_SZ) -#endif -kfree (ctx); +if (ctx != data) +kfree (ctx);return err; }
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 6/47 RDMA/isert: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/ulp/isert/ib_isert.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/infiniband/ulp/isert/ib_isert.c +7 -7
@@ -788,10 +788,11 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)* the rdma cm id */ return 1 ; -case RDMA_CM_EVENT_REJECTED :/* FALLTHRU */ +case RDMA_CM_EVENT_REJECTED :isert_info ("Connection rejected: %s\n" ,rdma_reject_msg (cma_id, event->status)); -case RDMA_CM_EVENT_UNREACHABLE :/* FALLTHRU */ +/* fall through */ +case RDMA_CM_EVENT_UNREACHABLE :case RDMA_CM_EVENT_CONNECT_ERROR : ret =isert_connect_error (cma_id);break ;
@@ -1569,9 +1570,7 @@ isert_put_cmd(struct isert_cmd *isert_cmd, bool comp_err)transport_generic_free_cmd (&cmd->se_cmd,0 );break ; } -/* -* Fall-through -*/ +/* fall through */ default :iscsit_release_cmd (cmd);break ;
@@ -1749,8 +1748,9 @@ isert_do_control_comp(struct work_struct *work)switch (cmd->i_state) {case ISTATE_SEND_TASKMGTRSP :iscsit_tmr_post_handler (cmd, cmd->conn); -case ISTATE_SEND_REJECT :/* FALLTHRU */ -case ISTATE_SEND_TEXTRSP :/* FALLTHRU */ +/* fall through */ +case ISTATE_SEND_REJECT : +case ISTATE_SEND_TEXTRSP : cmd->i_state =ISTATE_SENT_STATUS ;isert_completion_put (&isert_cmd->tx_desc, isert_cmd, ib_dev, false);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 7/47 RDMA/bnxt_re: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +1 -1
@@ -1360,7 +1360,7 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp,break ; } -/* else, just fall thru */ +/* fall thru */ case BNXT_QPLIB_SWQE_TYPE_SEND_WITH_IMM :case BNXT_QPLIB_SWQE_TYPE_SEND_WITH_INV : {
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 8/47 RDMA/bnxt_re: Remove set-but-not-used variables
In reply to a message not in the archive--- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 12 +++++------- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 5 ----- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 4 ---- drivers/infiniband/hw/bnxt_re/qplib_sp.c | 5 ++--- 4 files changed, 7 insertions(+), 19 deletions(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +5 -7
@@ -1643,7 +1643,7 @@ static int bnxt_re_build_qp1_send_v2(struct bnxt_re_qp *qp,u8 ip_version =0 ;u16 vlan_id =0xFFFF ;void *buf; -int i, rc =0 , size; +int i, rc =0 ;memset (&qp->qp1_hdr,0 ,sizeof (qp->qp1_hdr));
@@ -1760,7 +1760,7 @@ static int bnxt_re_build_qp1_send_v2(struct bnxt_re_qp *qp,/* Pack the QP1 to the transmit buffer */ buf =bnxt_qplib_get_qp1_sq_buf (&qp->qplib_qp, &sge);if (buf) { - size =ib_ud_header_pack (&qp->qp1_hdr, buf); +ib_ud_header_pack (&qp->qp1_hdr, buf);for (i = wqe->num_sge; i; i--) { wqe->sg_list[i].addr = wqe->sg_list[i -1 ].addr; wqe->sg_list[i].lkey = wqe->sg_list[i -1 ].lkey;
@@ -2216,7 +2216,7 @@ static int bnxt_re_post_recv_shadow_qp(struct bnxt_re_dev *rdev, struct ib_recv_wr *wr) {struct bnxt_qplib_swqe wqe; -int rc =0 , payload_sz =0 ; +int rc =0 ;memset (&wqe,0 ,sizeof (wqe));while (wr) {
@@ -2231,8 +2231,7 @@ static int bnxt_re_post_recv_shadow_qp(struct bnxt_re_dev *rdev, rc = -EINVAL ;break ; } - payload_sz =bnxt_re_build_sgl (wr->sg_list, wqe.sg_list, - wr->num_sge); +bnxt_re_build_sgl (wr->sg_list, wqe.sg_list, wr->num_sge); wqe.wr_id = wr->wr_id; wqe.type =BNXT_QPLIB_SWQE_TYPE_RECV ;
@@ -2569,7 +2568,7 @@ static void bnxt_re_process_req_wc(struct ib_wc *wc, struct bnxt_qplib_cqe *cqe)static int bnxt_re_check_packet_type (u16 raweth_qp1_flags,u16 raweth_qp1_flags2) { -bool is_udp = false, is_ipv6 = false, is_ipv4 = false; +bool is_ipv6 = false, is_ipv4 = false;/* raweth_qp1_flags Bit 9-6 indicates itype */ if ((raweth_qp1_flags & CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ROCE)
@@ -2580,7 +2579,6 @@ static int bnxt_re_check_packet_type(u16 raweth_qp1_flags,CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_CS_CALC && raweth_qp1_flags2 & CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_L4_CS_CALC) { - is_udp = true;/* raweth_qp1_flags2 Bit 8 indicates ip_type. 0-v4 1 - v6 */ (raweth_qp1_flags2 & CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_TYPE) ?
drivers/infiniband/hw/bnxt_re/qplib_fp.c +0 -5
@@ -160,11 +160,6 @@ void bnxt_qplib_add_flush_qp(struct bnxt_qplib_qp *qp)static void __bnxt_qplib_del_flush_qp (struct bnxt_qplib_qp *qp) { -struct bnxt_qplib_cq *scq, *rcq; - - scq = qp->scq; - rcq = qp->rcq; -if (qp->sq.flushed) { qp->sq.flushed = false;list_del (&qp->sq_flush);
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +0 -4
@@ -88,7 +88,6 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, struct cmdq_base *req,unsigned long flags;u32 size, opcode;u16 cookie, cbit; -int pg, idx;u8 *preq; opcode = req->opcode;
@@ -149,9 +148,6 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, struct cmdq_base *req, preq = (u8 *)req; size = req->cmd_size *BNXT_QPLIB_CMDQE_UNITS ; do { - pg = 0; - idx = 0; - /* Locate the next cmdq slot */ sw_prod = HWQ_CMP(cmdq->prod, cmdq); cmdqe = &cmdq_ptr[get_cmdq_pg(sw_prod)][get_cmdq_idx(sw_prod)];
drivers/infiniband/hw/bnxt_re/qplib_sp.c +2 -3
@@ -720,13 +720,12 @@ int bnxt_qplib_map_tc2cos(struct bnxt_qplib_res *res, u16 *cids)struct cmdq_map_tc_to_cos req;struct creq_map_tc_to_cos_resp resp;u16 cmd_flags =0 ; -int rc =0 ;RCFW_CMD_PREP (req,MAP_TC_TO_COS , cmd_flags); req.cos0 =cpu_to_le16 (cids[0 ]); req.cos1 =cpu_to_le16 (cids[1 ]); - rc =bnxt_qplib_rcfw_send_message (rcfw, (void *)&req, - (void *)&resp,NULL ,0 ); +bnxt_qplib_rcfw_send_message (rcfw, (void *)&req, (void *)&resp,NULL , +0 );return 0 ; }
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 9/47 RDMA/cxgb3: Annotate locking assumptions
In reply to a message not in the archiveTell sparse what the locking assumptions are for __flush_qp() such that it does not complain about the locking operations inside that function.
--- drivers/infiniband/hw/cxgb3/iwch_qp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/infiniband/hw/cxgb3/iwch_qp.c +3 -0
@@ -722,10 +722,13 @@ int iwch_post_terminate(struct iwch_qp *qhp, struct respQ_msg_t *rsp_msg)*/ static void __flush_qp (struct iwch_qp *qhp,struct iwch_cq *rchp,struct iwch_cq *schp) + __releases(&qhp->lock) + __acquires(&qhp->lock) {int count;int flushed; +lockdep_assert_held (&qhp->lock);pr_debug ("%s qhp %p rchp %p schp %p\n" , __func__, qhp, rchp, schp);/* take a ref on the qhp since we must release the lock */
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 10/47 RDMA/cxgb3: Annotate an RCU pointer
In reply to a message not in the archiveAnnotate t3cdev.l2opt with __rcu since it is used as an RCU pointer.
--- drivers/net/ethernet/chelsio/cxgb3/t3cdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb3/t3cdev.h +1 -1
@@ -60,7 +60,7 @@ struct t3cdev {int (*ctl)(struct t3cdev *dev,unsigned int req,void *data);void (*neigh_update)(struct t3cdev *dev,struct neighbour *neigh);void *priv;/* driver private data */ -void *l2opt;/* optional layer 2 data */ +void __rcu *l2opt;/* optional layer 2 data */ void *l3opt;/* optional layer 3 data */ void *l4opt;/* optional layer 4 data */ void *ulp;/* ulp stuff */
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 11/47 RDMA/cxgb3: Remove a set-but-not-used variable
In reply to a message not in the archive--- drivers/infiniband/hw/cxgb3/iwch_cm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/cxgb3/iwch_cm.c +3 -3
@@ -1760,8 +1760,8 @@ static void ep_timeout(unsigned long arg)int iwch_reject_cr (struct iw_cm_id *cm_id,const void *pdata,u8 pdata_len) { -int err;struct iwch_ep *ep =to_ep (cm_id); +pr_debug ("%s ep %p tid %u\n" , __func__, ep, ep->hwtid);if (state_read (&ep->com) ==DEAD ) {
@@ -1772,8 +1772,8 @@ int iwch_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len)if (mpa_rev ==0 )abort_connection (ep,NULL ,GFP_KERNEL );else { - err =send_mpa_reject (ep, pdata, pdata_len); - err =iwch_ep_disconnect (ep,0 ,GFP_KERNEL ); +send_mpa_reject (ep, pdata, pdata_len); +iwch_ep_disconnect (ep,0 ,GFP_KERNEL ); }put_ep (&ep->com);return 0 ;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 12/47 RDMA/cxgb4: Fix indentation
In reply to a message not in the archiveThis patch avoids that smatch reports the following:
drivers/infiniband/hw/cxgb4/device.c:1105: copy_gl_to_skb_pkt() warn: inconsistent indenting drivers/infiniband/hw/cxgb4/cm.c:835: send_connect() warn: inconsistent indenting drivers/infiniband/hw/cxgb4/cm.c:841: send_connect() warn: inconsistent indenting drivers/infiniband/hw/cxgb4/cm.c:888: send_connect() warn: inconsistent indenting drivers/infiniband/hw/cxgb4/cm.c:894: send_connect() warn: inconsistent indenting
--- drivers/infiniband/hw/cxgb4/cm.c | 8 ++++---- drivers/infiniband/hw/cxgb4/device.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/infiniband/hw/cxgb4/cm.c +4 -4
@@ -832,13 +832,13 @@ static int send_connect(struct c4iw_ep *ep) t5req->params =cpu_to_be64 (FILTER_TUPLE_V (params)); t5req->rsvd =cpu_to_be32 (isn); -pr_debug ("snd_isn %u\n" , t5req->rsvd); +pr_debug ("snd_isn %u\n" , t5req->rsvd); t5req->opt2 =cpu_to_be32 (opt2); }else { t6req->params =cpu_to_be64 (FILTER_TUPLE_V (params)); t6req->rsvd =cpu_to_be32 (isn); -pr_debug ("snd_isn %u\n" , t6req->rsvd); +pr_debug ("snd_isn %u\n" , t6req->rsvd); t6req->opt2 =cpu_to_be32 (opt2); } }
@@ -885,13 +885,13 @@ static int send_connect(struct c4iw_ep *ep) t5req6->params =cpu_to_be64 (FILTER_TUPLE_V (params)); t5req6->rsvd =cpu_to_be32 (isn); -pr_debug ("snd_isn %u\n" , t5req6->rsvd); +pr_debug ("snd_isn %u\n" , t5req6->rsvd); t5req6->opt2 =cpu_to_be32 (opt2); }else { t6req6->params =cpu_to_be64 (FILTER_TUPLE_V (params)); t6req6->rsvd =cpu_to_be32 (isn); -pr_debug ("snd_isn %u\n" , t6req6->rsvd); +pr_debug ("snd_isn %u\n" , t6req6->rsvd); t6req6->opt2 =cpu_to_be32 (opt2); }
drivers/infiniband/hw/cxgb4/device.c +2 -2
@@ -1102,8 +1102,8 @@ static inline struct sk_buff *copy_gl_to_skb_pkt(const struct pkt_gl *gl,if (unlikely (!skb))return NULL ; -__skb_put (skb, gl->tot_len +sizeof (struct cpl_pass_accept_req ) + -sizeof (struct rss_header ) - pktshift); +__skb_put (skb, gl->tot_len +sizeof (struct cpl_pass_accept_req ) + +sizeof (struct rss_header ) - pktshift);/* * This skb will contain:
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 13/47 RDMA/cxgb4: Declare a local variable 'static'
In reply to a message not in the archive--- drivers/infiniband/hw/cxgb4/cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/cxgb4/cm.c +1 -1
@@ -99,7 +99,7 @@ module_param(enable_tcp_window_scaling, int, 0644);MODULE_PARM_DESC (enable_tcp_window_scaling,"Enable tcp window scaling (default=1)" ); -int c4iw_debug; +static int c4iw_debug;module_param (c4iw_debug, int,0644 );MODULE_PARM_DESC (c4iw_debug,"obsolete" );
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 14/47 RDMA/cxgb4: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/hw/cxgb4/cm.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/hw/cxgb4/cm.c +1 -0
@@ -3642,6 +3642,7 @@ static void active_ofld_conn_reply(struct c4iw_dev *dev, struct sk_buff *skb,send_fw_act_open_req (ep, atid);return ; } +/* fall through */ case FW_EADDRINUSE :set_bit (ACT_RETRY_INUSE , &ep->com.history);if (ep->retry_count++ <ACT_OPEN_RETRY_COUNT ) {
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 15/47 RDMA/cxgb4: Remove a set-but-not-used variable
In reply to a message not in the archive--- drivers/infiniband/hw/cxgb4/cm.c | 3 --- 1 file changed, 3 deletions(-)
drivers/infiniband/hw/cxgb4/cm.c +0 -3
@@ -3881,7 +3881,6 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb)struct net_device *pdev;u16 rss_qid, eth_hdr_len;int step; -u32 tx_chan;struct neighbour *neigh;/* Drop all non-SYN packets */
@@ -3963,14 +3962,12 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb) e =cxgb4_l2t_get (dev->rdev.lldi.l2t, neigh, pdev,0 ); pi = (struct port_info *)netdev_priv (pdev); - tx_chan =cxgb4_port_chan (pdev);dev_put (pdev); }else { pdev =get_real_dev (neigh->dev); e =cxgb4_l2t_get (dev->rdev.lldi.l2t, neigh, pdev,0 ); pi = (struct port_info *)netdev_priv (pdev); - tx_chan =cxgb4_port_chan (pdev); }neigh_release (neigh);if (!e) {
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 16/47 IB/hfi1: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/hw/hfi1/mad.c | 1 + drivers/infiniband/hw/hfi1/rc.c | 2 +- drivers/infiniband/hw/hfi1/sdma.c | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hfi1/mad.c +1 -0
@@ -711,6 +711,7 @@ static int check_mkey(struct hfi1_ibport *ibp, struct ib_mad_hdr *mad,/* Bad mkey not a violation below level 2 */ if (ibp->rvp.mkeyprot <2 )break ; +/* fall through */ case IB_MGMT_METHOD_SET :case IB_MGMT_METHOD_TRAP_REPRESS :if (ibp->rvp.mkey_violations !=0xFFFF )
drivers/infiniband/hw/hfi1/rc.c +1 -1
@@ -2175,7 +2175,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) goto no_immediate_data;if (opcode ==OP (SEND_ONLY_WITH_INVALIDATE )) goto send_last_inv; -/* FALLTHROUGH for SEND_ONLY_WITH_IMMEDIATE */ +/* FALLTHROUGH -- for SEND_ONLY_WITH_IMMEDIATE */ case OP (SEND_LAST_WITH_IMMEDIATE ): send_last_imm: wc.ex.imm_data = ohdr->u.imm_data;
drivers/infiniband/hw/hfi1/sdma.c +2 -1
@@ -2593,7 +2593,7 @@ static void __sdma_process_event(struct sdma_engine *sde,* 7220, e.g. */ ss->go_s99_running =1 ; -/* fall through and start dma engine */ +/* fall through -- and start dma engine */ case sdma_event_e10_go_hw_start:/* This reference means the state machine is started */ sdma_get (&sde->state);
@@ -3016,6 +3016,7 @@ static void __sdma_process_event(struct sdma_engine *sde,case sdma_event_e60_hw_halted: need_progress =1 ;sdma_err_progress_check_schedule (sde); +/* fall through */ case sdma_event_e90_sw_halted:/* * SW initiated halt does not perform engines
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 17/47 IB/hfi1: Remove set-but-not-used variables
In reply to a message not in the archive--- drivers/infiniband/hw/hfi1/file_ops.c | 4 +--- drivers/infiniband/hw/hfi1/mad.c | 2 -- drivers/infiniband/hw/hfi1/ruc.c | 9 --------- drivers/infiniband/hw/hfi1/sdma.c | 2 -- drivers/infiniband/hw/hfi1/ud.c | 2 -- drivers/infiniband/hw/hfi1/verbs.c | 10 ---------- 6 files changed, 1 insertion(+), 28 deletions(-)
drivers/infiniband/hw/hfi1/file_ops.c +1 -3
@@ -776,7 +776,7 @@ static int complete_subctxt(struct hfi1_filedata *fd)static int assign_ctxt (struct hfi1_filedata *fd,unsigned long arg,u32 len) {int ret; -unsigned int swmajor, swminor; +unsigned int swmajor;struct hfi1_ctxtdata *uctxt =NULL ;struct hfi1_user_info uinfo;
@@ -796,8 +796,6 @@ static int assign_ctxt(struct hfi1_filedata *fd, unsigned long arg, u32 len)if (uinfo.subctxt_cnt >HFI1_MAX_SHARED_CTXTS )return -EINVAL ; - swminor = uinfo.userversion &0xffff ; -/* * Acquire the mutex to protect against multiple creations of what * could be a shared base context.
drivers/infiniband/hw/hfi1/mad.c +0 -2
@@ -2889,7 +2889,6 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp,struct _vls_dctrs *vlinfo;size_t response_data_size;u32 num_ports; -u8 num_pslm;u8 lq, num_vls;u8 res_lli, res_ler;u64 port_mask;
@@ -2899,7 +2898,6 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp,int vfi; num_ports =be32_to_cpu (pmp->mad_hdr.attr_mod) >>24 ; - num_pslm =hweight64 (be64_to_cpu (req->port_select_mask[3 ])); num_vls =hweight32 (be32_to_cpu (req->vl_select_mask)); vl_select_mask =be32_to_cpu (req->vl_select_mask); res_lli = (u8)(be32_to_cpu (req->resolution) &MSK_LLI ) >>MSK_LLI_SFT ;
drivers/infiniband/hw/hfi1/ruc.c +0 -9
@@ -825,11 +825,9 @@ static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp, {struct hfi1_qp_priv *priv = qp->priv;struct hfi1_ibport *ibp = ps->ibp; -struct hfi1_pportdata *ppd =ppd_from_ibp (ibp);u32 bth1 =0 ;u16 pkey =hfi1_get_pkey (ibp, qp->s_pkey_index);u16 lrh0 =HFI1_LRH_BTH ; -u16 slid;u8 extra_bytes = -ps->s_txreq->s_cur_size &3 ;u32 nwords =SIZE_OF_CRC + ((ps->s_txreq->s_cur_size + extra_bytes) >>2 );
@@ -866,13 +864,6 @@ static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp, bth1 |= (IB_BECN_MASK <<IB_BECN_SHIFT ); }hfi1_make_ruc_bth (qp, ohdr, bth0, bth1, bth2); - -if (!ppd->lid) - slid =be16_to_cpu (IB_LID_PERMISSIVE ); -else - slid = ppd->lid | - (rdma_ah_get_path_bits (&qp->remote_ah_attr) & - ((1 << ppd->lmc) -1 )); hfi1_make_ib_hdr(&ps->s_txreq->phdr.hdr.ibh, lrh0, qp->s_hdrwords + nwords,
drivers/infiniband/hw/hfi1/sdma.c +0 -2
@@ -2144,7 +2144,6 @@ void sdma_dumpstate(struct sdma_engine *sde)static void dump_sdma_state (struct sdma_engine *sde) { -struct hw_sdma_desc *descq;struct hw_sdma_desc *descqp;u64 desc[2 ];u64 addr;
@@ -2155,7 +2154,6 @@ static void dump_sdma_state(struct sdma_engine *sde) head = sde->descq_head & sde->sdma_mask; tail = sde->descq_tail & sde->sdma_mask; cnt =sdma_descq_freecnt (sde); - descq = sde->descq; dd_dev_err(sde->dd, "SDMA (%u) descq_head: %u descq_tail: %u freecnt: %u FLE %d\n",
drivers/infiniband/hw/hfi1/ud.c +0 -2
@@ -854,7 +854,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)int mgmt_pkey_idx =-1 ;struct hfi1_ibport *ibp =rcd_to_iport (packet->rcd);struct hfi1_pportdata *ppd =ppd_from_ibp (ibp); -struct ib_header *hdr = packet->hdr;void *data = packet->payload;u32 tlen = packet->tlen;struct rvt_qp *qp = packet->qp;
@@ -880,7 +879,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) dlid_is_permissive = (dlid == permissive_lid); slid_is_permissive = (slid == permissive_lid); }else { - hdr = packet->hdr; pkey =ib_bth_get_pkey (ohdr); dlid_is_permissive = (dlid ==be16_to_cpu (IB_LID_PERMISSIVE )); slid_is_permissive = (slid ==be16_to_cpu (IB_LID_PERMISSIVE ));
drivers/infiniband/hw/hfi1/verbs.c +0 -10
@@ -812,7 +812,6 @@ static int build_verbs_tx_desc(int ret =0 ;struct hfi1_sdma_header *phdr = &tx->phdr;u16 hdrbytes = tx->hdr_dwords <<2 ; -u32 *hdr;u8 extra_bytes =0 ;static char trail_buf[12 ];/* CRC = 4, LT = 1, Pad = 0 to 7 bytes */
@@ -823,9 +822,6 @@ static int build_verbs_tx_desc(*/ extra_bytes =hfi1_get_16b_padding (hdrbytes -8 , length) + (SIZE_OF_CRC <<2 ) +SIZE_OF_LT ; - hdr = (u32 *)&phdr->hdr.opah; - }else { - hdr = (u32 *)&phdr->hdr.ibh; }if (!ahg_info->ahgcount) { ret = sdma_txinit_ahg(
@@ -891,14 +887,12 @@ int hfi1_verbs_send_dma(struct rvt_qp *qp, struct hfi1_pkt_state *ps,u8 sc5 = priv->s_sc;int ret;u32 dwords; -bool bypass = false;if (ps->s_txreq->phdr.hdr.hdr_type) {u8 extra_bytes =hfi1_get_16b_padding ((hdrwords <<2 ), len); dwords = (len + extra_bytes + (SIZE_OF_CRC <<2 ) +SIZE_OF_LT ) >>2 ; - bypass = true; }else { dwords = (len +3 ) >>2 ; }
@@ -1033,8 +1027,6 @@ int hfi1_verbs_send_pio(struct rvt_qp *qp, struct hfi1_pkt_state *ps,int wc_status =IB_WC_SUCCESS ;int ret =0 ;pio_release_cb cb =NULL ; -u32 lrh0_16b; -bool bypass = false;u8 extra_bytes =0 ;if (ps->s_txreq->phdr.hdr.hdr_type) {
@@ -1043,8 +1035,6 @@ int hfi1_verbs_send_pio(struct rvt_qp *qp, struct hfi1_pkt_state *ps, extra_bytes = pad_size + (SIZE_OF_CRC <<2 ) +SIZE_OF_LT ; dwords = (len + extra_bytes) >>2 ; hdr = (u32 *)&ps->s_txreq->phdr.hdr.opah; - lrh0_16b = ps->s_txreq->phdr.hdr.opah.lrh[0 ]; - bypass = true; }else { dwords = (len +3 ) >>2 ; hdr = (u32 *)&ps->s_txreq->phdr.hdr.ibh;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 18/47 IB/hfi1: Define hfi1_handle_cnp_tbl[] once
In reply to a message not in the archiveThis patch does not change any functionality.
--- drivers/infiniband/hw/hfi1/driver.c | 6 ++++++ drivers/infiniband/hw/hfi1/hfi.h | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/infiniband/hw/hfi1/driver.c +6 -0
@@ -433,6 +433,12 @@ static inline void init_packet(struct hfi1_ctxtdata *rcd, packet->numpkt =0 ; } +/* We support only two types - 9B and 16B for now */ +static const hfi1_handle_cnp hfi1_handle_cnp_tbl[2 ] = { + [HFI1_PKT_TYPE_9B ] = &return_cnp, + [HFI1_PKT_TYPE_16B ] = &return_cnp_16B +}; +void hfi1_process_ecn_slowpath (struct rvt_qp *qp,struct hfi1_packet *pkt,bool do_cnp) {
drivers/infiniband/hw/hfi1/hfi.h +0 -5
@@ -1535,11 +1535,6 @@ typedef void (*hfi1_handle_cnp)(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, u32 pkey, u32 slid, u32 dlid, u8 sc5, const struct ib_grh *old_grh); -/* We support only two types - 9B and 16B for now */ -static const hfi1_handle_cnp hfi1_handle_cnp_tbl[2 ] = { - [HFI1_PKT_TYPE_9B ] = &return_cnp, - [HFI1_PKT_TYPE_16B ] = &return_cnp_16B -};#define PKEY_CHECK_INVALID -1int egress_pkey_check (struct hfi1_pportdata *ppd,u32 slid,u16 pkey,u8 sc5,int8_t s_pkey_index);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 19/47 IB/hns: Annotate iomem pointers correctly
In reply to a message not in the archiveThis patch avoids that sparse complains that there is an address space mismatch.
--- drivers/infiniband/hw/hns/hns_roce_eq.c | 6 +++--- drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 9 +++++---- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-)
drivers/infiniband/hw/hns/hns_roce_eq.c +3 -3
@@ -558,7 +558,7 @@ static int hns_roce_create_eq(struct hns_roce_dev *hr_dev,writel (eqshift_val, eqc);/* Configure eq extended address 12~44bit */ -writel ((u32)(eq->buf_list[0 ].map >>12 ), (u8 *)eqc +4 ); +writel ((u32)(eq->buf_list[0 ].map >>12 ), eqc +4 );/* * Configure eq extended address 45~49 bit.
@@ -572,13 +572,13 @@ static int hns_roce_create_eq(struct hns_roce_dev *hr_dev,roce_set_field (eqcuridx_val,ROCEE_CAEP_AEQE_CUR_IDX_CAEP_AEQE_CUR_IDX_M ,ROCEE_CAEP_AEQE_CUR_IDX_CAEP_AEQE_CUR_IDX_S ,0 ); -writel (eqcuridx_val, (u8 *)eqc +8 ); +writel (eqcuridx_val, eqc +8 );/* Configure eq consumer index */ roce_set_field (eqconsindx_val,ROCEE_CAEP_AEQE_CONS_IDX_CAEP_AEQE_CONS_IDX_M ,ROCEE_CAEP_AEQE_CONS_IDX_CAEP_AEQE_CONS_IDX_S ,0 ); -writel (eqconsindx_val, (u8 *)eqc +0xc ); +writel (eqconsindx_val, eqc +0xc );return 0 ;
drivers/infiniband/hw/hns/hns_roce_hw_v1.c +5 -4
@@ -1639,7 +1639,7 @@ static int hns_roce_v1_post_mbox(struct hns_roce_dev *hr_dev, u64 in_param, u64 out_param, u32 in_modifier, u8 op_modifier, u16 op, u16 token, int event) { - u32 *hcr = (u32 *)(hr_dev->reg_base + ROCEE_MB1_REG); + u32 __iomem *hcr = (u32 __iomem *)(hr_dev->reg_base + ROCEE_MB1_REG);unsigned long end;u32 val =0 ;
@@ -2534,7 +2534,7 @@ static int hns_roce_v1_m_sqp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,int rq_pa_start;u32 reg_val;u64 *mtts; -u32 *addr; +u32 __iomem *addr; context =kzalloc (sizeof (*context),GFP_KERNEL );if (!context)
@@ -2616,8 +2616,9 @@ static int hns_roce_v1_m_sqp(struct ib_qp *ibqp, const struct ib_qp_attr *attr, QP1C_BYTES_40_SQ_CUR_IDX_S, 0);/* Copy context to QP1C register */ - addr = (u32 *)(hr_dev->reg_base +ROCEE_QP1C_CFG0_0_REG + - hr_qp->phy_port *sizeof (*context)); + addr = (u32 __iomem *)(hr_dev->reg_base + +ROCEE_QP1C_CFG0_0_REG + + hr_qp->phy_port *sizeof (*context));writel (context->qp1c_bytes_4, addr);writel (context->sq_rq_bt_l, addr +1 );
drivers/infiniband/hw/hns/hns_roce_hw_v2.c +2 -1
@@ -976,7 +976,8 @@ static int hns_roce_v2_post_mbox(struct hns_roce_dev *hr_dev, u64 in_param, u16 op, u16 token, int event) { struct device *dev = hr_dev->dev; -u32 *hcr = (u32 *)(hr_dev->reg_base +ROCEE_VF_MB_CFG0_REG ); +u32 __iomem *hcr = (u32 __iomem *)(hr_dev->reg_base + +ROCEE_VF_MB_CFG0_REG );unsigned long end;u32 val0 =0 ;u32 val1 =0 ;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 20/47 IB/hns: Declare local functions 'static'
In reply to a message not in the archive--- drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 64 ++++++++++++++++-------------- 1 file changed, 35 insertions(+), 29 deletions(-)
drivers/infiniband/hw/hns/hns_roce_hw_v1.c +35 -29
@@ -57,8 +57,8 @@ static void set_raddr_seg(struct hns_roce_wqe_raddr_seg *rseg, u64 remote_addr, rseg->len =0 ; } -int hns_roce_v1_post_send (struct ib_qp *ibqp,struct ib_send_wr *wr, -struct ib_send_wr **bad_wr) +static int hns_roce_v1_post_send (struct ib_qp *ibqp,struct ib_send_wr *wr, +struct ib_send_wr **bad_wr) {struct hns_roce_dev *hr_dev =to_hr_dev (ibqp->device);struct hns_roce_ah *ah =to_hr_ah (ud_wr (wr)->ah);
@@ -317,8 +317,8 @@ int hns_roce_v1_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,return ret; } -int hns_roce_v1_post_recv (struct ib_qp *ibqp,struct ib_recv_wr *wr, -struct ib_recv_wr **bad_wr) +static int hns_roce_v1_post_recv (struct ib_qp *ibqp,struct ib_recv_wr *wr, +struct ib_recv_wr **bad_wr) {int ret =0 ;int nreq =0 ;
@@ -877,7 +877,7 @@ static int hns_roce_db_init(struct hns_roce_dev *hr_dev)return 0 ; } -void hns_roce_v1_recreate_lp_qp_work_fn (struct work_struct *work) +static void hns_roce_v1_recreate_lp_qp_work_fn (struct work_struct *work) {struct hns_roce_recreate_lp_qp_work *lp_qp_work;struct hns_roce_dev *hr_dev;
@@ -1033,7 +1033,8 @@ static void hns_roce_v1_mr_free_work_fn(struct work_struct *work)kfree (mr_work); } -int hns_roce_v1_dereg_mr (struct hns_roce_dev *hr_dev,struct hns_roce_mr *mr) +static int hns_roce_v1_dereg_mr (struct hns_roce_dev *hr_dev, +struct hns_roce_mr *mr) {struct device *dev = &hr_dev->pdev->dev;struct hns_roce_mr_free_work *mr_work;
@@ -1391,7 +1392,7 @@ static void hns_roce_free_mr_free(struct hns_roce_dev *hr_dev)* @enable: true -- drop reset, false -- reset * return 0 - success , negative --fail */ -int hns_roce_v1_reset (struct hns_roce_dev *hr_dev,bool dereset) +static int hns_roce_v1_reset (struct hns_roce_dev *hr_dev,bool dereset) {struct device_node *dsaf_node;struct device *dev = &hr_dev->pdev->dev;
@@ -1466,7 +1467,7 @@ static void hns_roce_des_qp_free(struct hns_roce_dev *hr_dev)destroy_workqueue (des_qp->qp_wq); } -int hns_roce_v1_profile (struct hns_roce_dev *hr_dev) +static int hns_roce_v1_profile (struct hns_roce_dev *hr_dev) {int i =0 ;struct hns_roce_caps *caps = &hr_dev->caps;
@@ -1538,7 +1539,7 @@ int hns_roce_v1_profile(struct hns_roce_dev *hr_dev)return 0 ; } -int hns_roce_v1_init (struct hns_roce_dev *hr_dev) +static int hns_roce_v1_init (struct hns_roce_dev *hr_dev) {int ret;u32 val;
@@ -1617,7 +1618,7 @@ int hns_roce_v1_init(struct hns_roce_dev *hr_dev)return ret; } -void hns_roce_v1_exit (struct hns_roce_dev *hr_dev) +static void hns_roce_v1_exit (struct hns_roce_dev *hr_dev) {hns_roce_port_enable (hr_dev,HNS_ROCE_PORT_DOWN );hns_roce_free_mr_free (hr_dev);
@@ -1701,8 +1702,8 @@ static int hns_roce_v1_chk_mbox(struct hns_roce_dev *hr_dev,return 0 ; } -void hns_roce_v1_set_gid (struct hns_roce_dev *hr_dev,u8 port,int gid_index, -union ib_gid *gid) +static void hns_roce_v1_set_gid (struct hns_roce_dev *hr_dev,u8 port, +int gid_index,union ib_gid *gid) {u32 *p =NULL ;u8 gid_idx =0 ;
@@ -1765,8 +1766,8 @@ static int hns_roce_v1_set_mac(struct hns_roce_dev *hr_dev, u8 phy_port,return 0 ; } -void hns_roce_v1_set_mtu (struct hns_roce_dev *hr_dev,u8 phy_port, -enum ib_mtu mtu) +static void hns_roce_v1_set_mtu (struct hns_roce_dev *hr_dev,u8 phy_port, +enum ib_mtu mtu) {u32 val;
@@ -1778,8 +1779,8 @@ void hns_roce_v1_set_mtu(struct hns_roce_dev *hr_dev, u8 phy_port, val); } -int hns_roce_v1_write_mtpt (void *mb_buf,struct hns_roce_mr *mr, -unsigned long mtpt_idx) +static int hns_roce_v1_write_mtpt (void *mb_buf,struct hns_roce_mr *mr, +unsigned long mtpt_idx) {struct hns_roce_v1_mpt_entry *mpt_entry;struct scatterlist *sg;
@@ -1951,7 +1952,7 @@ static struct hns_roce_cqe *next_cqe_sw(struct hns_roce_cq *hr_cq)return get_sw_cqe (hr_cq, hr_cq->cons_index); } -void hns_roce_v1_cq_set_ci (struct hns_roce_cq *hr_cq,u32 cons_index) +static void hns_roce_v1_cq_set_ci (struct hns_roce_cq *hr_cq,u32 cons_index) {u32 doorbell[2 ];
@@ -2024,9 +2025,10 @@ static void hns_roce_v1_cq_clean(struct hns_roce_cq *hr_cq, u32 qpn,spin_unlock_irq (&hr_cq->lock); } -void hns_roce_v1_write_cqc (struct hns_roce_dev *hr_dev, -struct hns_roce_cq *hr_cq,void *mb_buf,u64 *mtts, -dma_addr_t dma_handle,int nent,u32 vector) +static void hns_roce_v1_write_cqc (struct hns_roce_dev *hr_dev, +struct hns_roce_cq *hr_cq,void *mb_buf, +u64 *mtts,dma_addr_t dma_handle,int nent, +u32 vector) {struct hns_roce_cq_context *cq_context =NULL ;struct hns_roce_buf_list *tptr_buf;
@@ -2111,7 +2113,8 @@ void hns_roce_v1_write_cqc(struct hns_roce_dev *hr_dev, cq_context->cqc_byte_32 =cpu_to_le32 (cq_context->cqc_byte_32); } -int hns_roce_v1_req_notify_cq (struct ib_cq *ibcq,enum ib_cq_notify_flags flags) +static int hns_roce_v1_req_notify_cq (struct ib_cq *ibcq, +enum ib_cq_notify_flags flags) {struct hns_roce_cq *hr_cq =to_hr_cq (ibcq);u32 notification_flag;
@@ -2372,8 +2375,9 @@ int hns_roce_v1_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc)return ret; } -int hns_roce_v1_clear_hem (struct hns_roce_dev *hr_dev, -struct hns_roce_hem_table *table,int obj,int step_idx) +static int hns_roce_v1_clear_hem (struct hns_roce_dev *hr_dev, +struct hns_roce_hem_table *table,int obj, +int step_idx) {struct device *dev = &hr_dev->pdev->dev;struct hns_roce_v1_priv *priv;
@@ -3272,9 +3276,10 @@ static int hns_roce_v1_m_qp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,return ret; } -int hns_roce_v1_modify_qp (struct ib_qp *ibqp,const struct ib_qp_attr *attr, -int attr_mask,enum ib_qp_state cur_state, -enum ib_qp_state new_state) +static int hns_roce_v1_modify_qp (struct ib_qp *ibqp, +const struct ib_qp_attr *attr,int attr_mask, +enum ib_qp_state cur_state, +enum ib_qp_state new_state) {if (ibqp->qp_type ==IB_QPT_GSI || ibqp->qp_type ==IB_QPT_SMI )
@@ -3541,8 +3546,9 @@ static int hns_roce_v1_q_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,return ret; } -int hns_roce_v1_query_qp (struct ib_qp *ibqp,struct ib_qp_attr *qp_attr, -int qp_attr_mask,struct ib_qp_init_attr *qp_init_attr) +static int hns_roce_v1_query_qp (struct ib_qp *ibqp,struct ib_qp_attr *qp_attr, +int qp_attr_mask, +struct ib_qp_init_attr *qp_init_attr) {struct hns_roce_qp *hr_qp =to_hr_qp (ibqp);
@@ -3893,7 +3899,7 @@ int hns_roce_v1_destroy_qp(struct ib_qp *ibqp)return 0 ; } -int hns_roce_v1_destroy_cq (struct ib_cq *ibcq) +static int hns_roce_v1_destroy_cq (struct ib_cq *ibcq) {struct hns_roce_dev *hr_dev =to_hr_dev (ibcq->device);struct hns_roce_cq *hr_cq =to_hr_cq (ibcq);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 21/47 RDMA/i40iw: Fix a race condition
In reply to a message not in the archiveUse the proper primitives to dereference the RCU pointer upper_dev->ip_ptr. Compile-tested only.
--- drivers/infiniband/hw/i40iw/i40iw_utils.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/infiniband/hw/i40iw/i40iw_utils.c +9 -4
@@ -168,11 +168,16 @@ int i40iw_inetaddr_event(struct notifier_block *notifier,if (netdev != event_netdev)return NOTIFY_DONE ; -if (upper_dev) - local_ipaddr =ntohl ( - ((struct in_device *)upper_dev->ip_ptr)->ifa_list->ifa_address); -else +if (upper_dev) { +struct in_device *in; + +rcu_read_lock (); + in =__in_dev_get_rcu (upper_dev); + local_ipaddr =ntohl (in->ifa_list->ifa_address); +rcu_read_unlock (); + }else { local_ipaddr =ntohl (ifa->ifa_address); + }switch (event) {case NETDEV_DOWN : action =I40IW_ARP_DELETE ;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 22/47 RDMA/i40iw: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/hw/i40iw/i40iw_cm.c | 1 + drivers/infiniband/hw/i40iw/i40iw_hw.c | 1 + drivers/infiniband/hw/i40iw/i40iw_puda.c | 1 + 3 files changed, 3 insertions(+)
drivers/infiniband/hw/i40iw/i40iw_cm.c +1 -0
@@ -2406,6 +2406,7 @@ static void i40iw_handle_rst_pkt(struct i40iw_cm_node *cm_node,case I40IW_CM_STATE_FIN_WAIT1 :case I40IW_CM_STATE_LAST_ACK : cm_node->cm_id->rem_ref (cm_node->cm_id); +/* fall through */ case I40IW_CM_STATE_TIME_WAIT : cm_node->state =I40IW_CM_STATE_CLOSED ;i40iw_rem_ref_cm_node (cm_node);
drivers/infiniband/hw/i40iw/i40iw_hw.c +1 -0
@@ -410,6 +410,7 @@ void i40iw_process_aeq(struct i40iw_device *iwdev)case I40IW_AE_UDA_XMIT_DGRAM_TOO_LONG :case I40IW_AE_UDA_XMIT_IPADDR_MISMATCH : ctx_info->err_rq_idx_valid = false; +/* fall through */ default :if (!info->sq && ctx_info->err_rq_idx_valid) { ctx_info->err_rq_idx = info->wqe_idx;
drivers/infiniband/hw/i40iw/i40iw_puda.c +1 -0
@@ -816,6 +816,7 @@ void i40iw_puda_dele_resources(struct i40iw_sc_vsi *vsi,switch (rsrc->completion) {case PUDA_HASH_CRC_COMPLETE :i40iw_free_hash_desc (rsrc->hash_desc); +/* fall through */ case PUDA_QP_CREATED :if (!reset)i40iw_puda_free_qp (rsrc);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 23/47 RDMA/i40iw: Remove a set-but-not-used variable
In reply to a message not in the archive--- drivers/infiniband/hw/i40iw/i40iw_cm.c | 2 -- 1 file changed, 2 deletions(-)
drivers/infiniband/hw/i40iw/i40iw_cm.c +0 -2
@@ -1199,7 +1199,6 @@ static void i40iw_cm_timer_tick(unsigned long pass)struct i40iw_cm_core *cm_core = (struct i40iw_cm_core *)pass;u32 settimer =0 ;unsigned long timetosend; -struct i40iw_sc_dev *dev;unsigned long flags;struct list_head timer_list;
@@ -1271,7 +1270,6 @@ static void i40iw_cm_timer_tick(unsigned long pass)spin_unlock_irqrestore (&cm_node->retrans_list_lock, flags); vsi = &cm_node->iwdev->vsi; - dev = cm_node->dev;atomic_inc (&send_entry->sqbuf->refcount);i40iw_puda_send_buf (vsi->ilq, send_entry->sqbuf);spin_lock_irqsave (&cm_node->retrans_list_lock, flags);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 24/47 IB/mthca: Fix indentation
In reply to a message not in the archive--- drivers/infiniband/hw/mthca/mthca_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/infiniband/hw/mthca/mthca_main.c +5 -5
@@ -473,11 +473,11 @@ static int mthca_init_icm(struct mthca_dev *mdev, goto err_unmap_eqp; } - mdev->cq_table.table =mthca_alloc_icm_table (mdev, init_hca->cqc_base, - dev_lim->cqc_entry_sz, - mdev->limits.num_cqs, - mdev->limits.reserved_cqs, -0 ,0 ); + mdev->cq_table.table =mthca_alloc_icm_table (mdev, init_hca->cqc_base, + dev_lim->cqc_entry_sz, + mdev->limits.num_cqs, + mdev->limits.reserved_cqs, +0 ,0 );if (!mdev->cq_table.table) {mthca_err (mdev,"Failed to map CQ context memory, aborting.\n" ); err = -ENOMEM ;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 25/47 IB/mlx4: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/hw/mlx4/cq.c | 2 ++ drivers/infiniband/hw/mlx4/mcg.c | 1 + 2 files changed, 3 insertions(+)
drivers/infiniband/hw/mlx4/cq.c +2 -0
@@ -768,11 +768,13 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,switch (cqe->owner_sr_opcode &MLX4_CQE_OPCODE_MASK ) {case MLX4_OPCODE_RDMA_WRITE_IMM : wc->wc_flags |=IB_WC_WITH_IMM ; +/* fall through */ case MLX4_OPCODE_RDMA_WRITE : wc->opcode =IB_WC_RDMA_WRITE ;break ;case MLX4_OPCODE_SEND_IMM : wc->wc_flags |=IB_WC_WITH_IMM ; +/* fall through */ case MLX4_OPCODE_SEND :case MLX4_OPCODE_SEND_INVAL : wc->opcode =IB_WC_SEND ;
drivers/infiniband/hw/mlx4/mcg.c +1 -0
@@ -944,6 +944,7 @@ int mlx4_ib_mcg_multiplex_handler(struct ib_device *ibdev, int port,switch (sa_mad->mad_hdr.method) {case IB_MGMT_METHOD_SET : may_create =1 ; +/* fall through */ case IB_SA_METHOD_DELETE : req =kzalloc (sizeof *req,GFP_KERNEL );if (!req)
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 26/47 IB/mlx5: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/hw/mlx5/cq.c | 2 ++ drivers/infiniband/hw/mlx5/qp.c | 1 + 2 files changed, 3 insertions(+)
drivers/infiniband/hw/mlx5/cq.c +2 -0
@@ -124,11 +124,13 @@ static void handle_good_req(struct ib_wc *wc, struct mlx5_cqe64 *cqe,switch (be32_to_cpu (cqe->sop_drop_qpn) >>24 ) {case MLX5_OPCODE_RDMA_WRITE_IMM : wc->wc_flags |=IB_WC_WITH_IMM ; +/* fall through */ case MLX5_OPCODE_RDMA_WRITE : wc->opcode =IB_WC_RDMA_WRITE ;break ;case MLX5_OPCODE_SEND_IMM : wc->wc_flags |=IB_WC_WITH_IMM ; +/* fall through */ case MLX5_OPCODE_SEND :case MLX5_OPCODE_SEND_INVAL : wc->opcode =IB_WC_SEND ;
drivers/infiniband/hw/mlx5/qp.c +1 -0
@@ -4053,6 +4053,7 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, *bad_wr = wr; goto out; } +/* fall through */ case MLX5_IB_QPT_HW_GSI :set_datagram_seg (seg, wr); seg +=sizeof (struct mlx5_wqe_datagram_seg );
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 27/47 IB/mlx5: Remove a set-but-not-used variable
In reply to a message not in the archive--- drivers/infiniband/hw/mlx5/qp.c | 2 -- 1 file changed, 2 deletions(-)
drivers/infiniband/hw/mlx5/qp.c +0 -2
@@ -3858,7 +3858,6 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,unsigned long flags;unsigned idx;int err =0 ; -int inl =0 ;int num_sge;void *seg;int nreq;
@@ -4117,7 +4116,6 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, *bad_wr = wr; goto out; } - inl =1 ; size += sz; }else { dpseg = seg;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 28/47 IB/nes: Fix indentation
In reply to a message not in the archive--- drivers/infiniband/hw/nes/nes.c | 22 +++++++++++----------- drivers/infiniband/hw/nes/nes_hw.c | 4 ++-- drivers/infiniband/hw/nes/nes_nic.c | 10 +++++----- drivers/infiniband/hw/nes/nes_utils.c | 8 ++++---- drivers/infiniband/hw/nes/nes_verbs.c | 12 ++++++------ 5 files changed, 28 insertions(+), 28 deletions(-)
drivers/infiniband/hw/nes/nes.c +11 -11
@@ -757,18 +757,18 @@ static void nes_remove(struct pci_dev *pcidev)int netdev_index =0 ;unsigned long flags; -if (nesdev->netdev_count) { - netdev = nesdev->netdev[netdev_index]; -if (netdev) { -netif_stop_queue (netdev); -unregister_netdev (netdev); -nes_netdev_destroy (netdev); - - nesdev->netdev[netdev_index] =NULL ; - nesdev->netdev_count--; - nesdev->nesadapter->netdev_count--; - } +if (nesdev->netdev_count) { + netdev = nesdev->netdev[netdev_index]; +if (netdev) { +netif_stop_queue (netdev); +unregister_netdev (netdev); +nes_netdev_destroy (netdev); + + nesdev->netdev[netdev_index] =NULL ; + nesdev->netdev_count--; + nesdev->nesadapter->netdev_count--; } + } nes_notifiers_registered--;if (nes_notifiers_registered ==0 ) {
drivers/infiniband/hw/nes/nes_hw.c +2 -2
@@ -1861,8 +1861,8 @@ int nes_init_nic_qp(struct nes_device *nesdev, struct net_device *netdev) }if ((nesdev->nesadapter->allow_unaligned_fpdus) && (nes_init_mgt_qp (nesdev, netdev, nesvnic))) { -nes_debug (NES_DBG_INIT ,"%s: Out of memory for pau nic\n" , netdev->name); -nes_destroy_nic_qp (nesvnic); +nes_debug (NES_DBG_INIT ,"%s: Out of memory for pau nic\n" , netdev->name); +nes_destroy_nic_qp (nesvnic);return -ENOMEM ; }
drivers/infiniband/hw/nes/nes_nic.c +5 -5
@@ -926,11 +926,11 @@ static void nes_netdev_set_multicast_list(struct net_device *netdev) nesadapter->pft_mcast_map[mc_index] != nesvnic->nic_index && mc_index < max_pft_entries_avaiable) { -nes_debug (NES_DBG_NIC_RX , -"mc_index=%d skipping nic_index=%d, " -"used for=%d \n" , mc_index, - nesvnic->nic_index, - nesadapter->pft_mcast_map[mc_index]); +nes_debug (NES_DBG_NIC_RX , +"mc_index=%d skipping nic_index=%d, " +"used for=%d \n" , mc_index, + nesvnic->nic_index, + nesadapter->pft_mcast_map[mc_index]); mc_index++; }if (mc_index >= max_pft_entries_avaiable)
drivers/infiniband/hw/nes/nes_utils.c +4 -4
@@ -888,10 +888,10 @@ void nes_clc(unsigned long parm)struct nes_adapter *nesadapter = nesdev->nesadapter;spin_lock_irqsave (&nesadapter->phy_lock, flags); - nesadapter->link_interrupt_count[0 ] =0 ; - nesadapter->link_interrupt_count[1 ] =0 ; - nesadapter->link_interrupt_count[2 ] =0 ; - nesadapter->link_interrupt_count[3 ] =0 ; + nesadapter->link_interrupt_count[0 ] =0 ; + nesadapter->link_interrupt_count[1 ] =0 ; + nesadapter->link_interrupt_count[2 ] =0 ; + nesadapter->link_interrupt_count[3 ] =0 ;spin_unlock_irqrestore (&nesadapter->phy_lock, flags); nesadapter->lc_timer.expires = jiffies +3600 *HZ ;/* 1 hour */
drivers/infiniband/hw/nes/nes_verbs.c +6 -6
@@ -2865,11 +2865,11 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, next_iwarp_state =NES_CQP_QP_IWARP_STATE_ERROR ;/* next_iwarp_state = (NES_CQP_QP_IWARP_STATE_TERMINATE | 0x02000000); */ -if (nesqp->hte_added) { -nes_debug (NES_DBG_MOD_QP ,"set CQP_QP_DEL_HTE\n" ); - next_iwarp_state |=NES_CQP_QP_DEL_HTE ; - nesqp->hte_added =0 ; - } +if (nesqp->hte_added) { +nes_debug (NES_DBG_MOD_QP ,"set CQP_QP_DEL_HTE\n" ); + next_iwarp_state |=NES_CQP_QP_DEL_HTE ; + nesqp->hte_added =0 ; + }if ((nesqp->hw_tcp_state >NES_AEQE_TCP_STATE_CLOSED ) && (nesdev->iw_status) && (nesqp->hw_tcp_state !=NES_AEQE_TCP_STATE_TIME_WAIT )) {
@@ -3560,7 +3560,7 @@ static int nes_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry) entry->byte_len =le32_to_cpu (cqe.cqe_words[NES_CQE_PAYLOAD_LENGTH_IDX ]); wrid = ((u64)(le32_to_cpu (nesqp->hwqp.rq_vbase[wqe_index].wqe_words[NES_IWARP_RQ_WQE_COMP_SCRATCH_LOW_IDX ]))) | ((u64)(le32_to_cpu (nesqp->hwqp.rq_vbase[wqe_index].wqe_words[NES_IWARP_RQ_WQE_COMP_SCRATCH_HIGH_IDX ]))<<32 ); - entry->opcode =IB_WC_RECV ; + entry->opcode =IB_WC_RECV ; nesqp->hwqp.rq_tail = (wqe_index+1 )&(nesqp->hwqp.rq_size -1 );if ((entry->status !=IB_WC_SUCCESS ) && (nesqp->hwqp.rq_tail != nesqp->hwqp.rq_head)) {
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 29/47 IB/nes: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/hw/nes/nes_cm.c | 1 + drivers/infiniband/hw/nes/nes_hw.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/nes/nes_cm.c +1 -0
@@ -1768,6 +1768,7 @@ static void handle_rst_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb,case NES_CM_STATE_FIN_WAIT1 :case NES_CM_STATE_LAST_ACK : cm_node->cm_id->rem_ref (cm_node->cm_id); +/* fall through */ case NES_CM_STATE_TIME_WAIT : cm_node->state =NES_CM_STATE_CLOSED ;rem_ref_cm_node (cm_node->cm_core, cm_node);
drivers/infiniband/hw/nes/nes_hw.c +1 -1
@@ -3631,7 +3631,7 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, aeq_info |=NES_AEQE_AEID_RDMAP_ROE_UNEXPECTED_OPCODE ; aeqe->aeqe_words[NES_AEQE_MISC_IDX ] =cpu_to_le32 (aeq_info); } - +/* fall through */ case NES_AEQE_AEID_RDMAP_ROE_BAD_LLP_CLOSE :case NES_AEQE_AEID_LLP_TOO_MANY_RETRIES :case NES_AEQE_AEID_DDP_UBE_INVALID_MSN_NO_BUFFER_AVAILABLE :
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 30/47 IB/nes: Remove set-but-not-used variables
In reply to a message not in the archiveThis patch does not change any functionality.
--- drivers/infiniband/hw/nes/nes_cm.c | 8 -------- drivers/infiniband/hw/nes/nes_utils.c | 5 ++--- 2 files changed, 2 insertions(+), 11 deletions(-)
drivers/infiniband/hw/nes/nes_cm.c +0 -8
@@ -1389,7 +1389,6 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpistruct rtable *rt;struct neighbour *neigh;int rc = arpindex; -struct net_device *netdev;struct nes_adapter *nesadapter = nesvnic->nesdev->nesadapter;__be32 dst_ipaddr =htonl (dst_ip);
@@ -1400,11 +1399,6 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpireturn rc; } -if (netif_is_bond_slave (nesvnic->netdev)) - netdev =netdev_master_upper_dev_get (nesvnic->netdev); -else - netdev = nesvnic->netdev; - neigh =dst_neigh_lookup (&rt->dst, &dst_ipaddr);rcu_read_lock ();
@@ -3075,7 +3069,6 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)u32 crc_value;int ret;int passive_state; -struct nes_ib_device *nesibdev;struct ib_mr *ibmr =NULL ;struct nes_pd *nespd;u64 tagged_offset;
@@ -3158,7 +3151,6 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)if (raddr->sin_addr.s_addr != laddr->sin_addr.s_addr) { u64temp = (unsigned long )nesqp; - nesibdev = nesvnic->nesibdev; nespd = nesqp->nespd; tagged_offset = (u64 )(unsigned long )*start_buff; ibmr = nes_reg_phys_mr(&nespd->ibpd,
drivers/infiniband/hw/nes/nes_utils.c +2 -3
@@ -753,7 +753,6 @@ void nes_mh_fix(unsigned long parm)u32 mac_tx_frames_low;u32 mac_tx_frames_high;u32 mac_tx_pauses; -u32 serdes_status;u32 reset_value;u32 tx_control;u32 tx_config;
@@ -846,7 +845,7 @@ void nes_mh_fix(unsigned long parm) }nes_write_indexed (nesdev,NES_IDX_ETH_SERDES_COMMON_CONTROL0 ,0x00000008 ); - serdes_status =nes_read_indexed (nesdev,NES_IDX_ETH_SERDES_COMMON_STATUS0 ); +nes_read_indexed (nesdev,NES_IDX_ETH_SERDES_COMMON_STATUS0 );nes_write_indexed (nesdev,NES_IDX_ETH_SERDES_TX_EMP0 ,0x000bdef7 );nes_write_indexed (nesdev,NES_IDX_ETH_SERDES_TX_DRIVE0 ,0x9ce73000 );
@@ -859,7 +858,7 @@ void nes_mh_fix(unsigned long parm) }else {nes_write_indexed (nesdev,NES_IDX_ETH_SERDES_RX_EQ_CONTROL0 ,0xf0042222 ); } - serdes_status =nes_read_indexed (nesdev,NES_IDX_ETH_SERDES_RX_EQ_STATUS0 ); +nes_read_indexed (nesdev,NES_IDX_ETH_SERDES_RX_EQ_STATUS0 );nes_write_indexed (nesdev,NES_IDX_ETH_SERDES_CDR_CONTROL0 ,0x000000ff );nes_write_indexed (nesdev,NES_IDX_MAC_TX_CONTROL , tx_control);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 31/47 IB/nes: Fix a race condition in nes_inetaddr_event()
In reply to a message not in the archiveThis patch has been compile-tested only.
--- drivers/infiniband/hw/nes/nes.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/infiniband/hw/nes/nes.c +9 -4
@@ -178,11 +178,16 @@ static int nes_inetaddr_event(struct notifier_block *notifier,/* fall through */ case NETDEV_CHANGEADDR :/* Add the address to the IP table */ -if (upper_dev) - nesvnic->local_ipaddr = - ((struct in_device *)upper_dev->ip_ptr)->ifa_list->ifa_address; -else +if (upper_dev) { +struct in_device *in; + +rcu_read_lock (); + in =__in_dev_get_rcu (upper_dev); + nesvnic->local_ipaddr = in->ifa_list->ifa_address; +rcu_read_unlock (); + }else { nesvnic->local_ipaddr = ifa->ifa_address; + } nes_write_indexed(nesdev, NES_IDX_DST_IP_ADDR+(0x10*PCI_FUNC(nesdev->pcidev->devfn)),
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 32/47 RDMA/ocrdma: Use NULL instead of 0 to represent a pointer
In reply to a message not in the archive--- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/ocrdma/ocrdma_hw.c +1 -1
@@ -3186,7 +3186,7 @@ void ocrdma_eqd_set_task(struct work_struct *work) {struct ocrdma_dev *dev = container_of(work, struct ocrdma_dev, eqd_work.work); -struct ocrdma_eq *eq =0 ; +struct ocrdma_eq *eq =NULL ;int i, num =0 , status = -EINVAL ;u64 eq_intr;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 33/47 RDMA/ocrdma: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +2 -0
@@ -2247,6 +2247,7 @@ int ocrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,case IB_WR_SEND_WITH_IMM : hdr->cw |= (OCRDMA_FLAG_IMM <<OCRDMA_WQE_FLAGS_SHIFT ); hdr->immdt =ntohl (wr->ex.imm_data); +/* fall through */ case IB_WR_SEND : hdr->cw |= (OCRDMA_SEND <<OCRDMA_WQE_OPCODE_SHIFT );ocrdma_build_send (qp, hdr, wr);
@@ -2260,6 +2261,7 @@ int ocrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,case IB_WR_RDMA_WRITE_WITH_IMM : hdr->cw |= (OCRDMA_FLAG_IMM <<OCRDMA_WQE_FLAGS_SHIFT ); hdr->immdt =ntohl (wr->ex.imm_data); +/* fall through */ case IB_WR_RDMA_WRITE : hdr->cw |= (OCRDMA_WRITE <<OCRDMA_WQE_OPCODE_SHIFT ); status =ocrdma_build_write (qp, hdr, wr);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 34/47 RDMA/ocrdma: Remove set-but-not-used variables
In reply to a message not in the archive--- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 4 ++-- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/infiniband/hw/ocrdma/ocrdma_hw.c +2 -2
@@ -3187,7 +3187,7 @@ void ocrdma_eqd_set_task(struct work_struct *work)struct ocrdma_dev *dev = container_of(work, struct ocrdma_dev, eqd_work.work);struct ocrdma_eq *eq =NULL ; -int i, num =0 , status = -EINVAL ; +int i, num =0 ;u64 eq_intr;for (i =0 ; i < dev->eq_cnt; i++) {
@@ -3209,7 +3209,7 @@ void ocrdma_eqd_set_task(struct work_struct *work) }if (num) - status =ocrdma_modify_eqd (dev, &dev->eq_tbl[0 ], num); +ocrdma_modify_eqd (dev, &dev->eq_tbl[0 ], num);schedule_delayed_work (&dev->eqd_work,msecs_to_jiffies (1000 )); }
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +0 -2
@@ -66,9 +66,7 @@ int ocrdma_query_gid(struct ib_device *ibdev, u8 port, int index, union ib_gid *sgid) { int ret; -struct ocrdma_dev *dev; - dev =get_ocrdma_dev (ibdev);memset (sgid,0 ,sizeof (*sgid));if (index >=OCRDMA_MAX_SGID )return -EINVAL ;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 35/47 IB/opa: Fix endianness annotation of opa_is_extended_lid()
In reply to a message not in the archiveThis patch does not change any functionality.
--- include/rdma/opa_addr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/rdma/opa_addr.h +1 -1
@@ -97,7 +97,7 @@ static inline u32 opa_get_lid_from_gid(const union ib_gid *gid)* @dlid: The DLID * @slid: The SLID */ -static inline bool opa_is_extended_lid (u32 dlid,u32 slid) +static inline bool opa_is_extended_lid (__be32 dlid,__be32 slid) { if ((be32_to_cpu(dlid) >= be16_to_cpu(IB_MULTICAST_LID_BASE)) ||
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 36/47 RDMA/qedr: Use NULL instead of 0 to represent a pointer
In reply to a message not in the archive--- drivers/infiniband/hw/qedr/qedr_roce_cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/qedr/qedr_roce_cm.c +1 -1
@@ -660,7 +660,7 @@ int qedr_gsi_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, dev->gsi_ll2_handle, wr->sg_list[0 ].addr, wr->sg_list[0 ].length, -0 /* cookie */ , +NULL /* cookie */ , 1 /* notify_fw */);if (rc) { DP_ERR(dev,
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 37/47 RDMA/qedr: Declare local functions static
In reply to a message not in the archive--- drivers/infiniband/hw/qedr/main.c | 22 +++++++++++----------- drivers/infiniband/hw/qedr/qedr_iw_cm.c | 14 +++++++------- drivers/infiniband/hw/qedr/qedr_roce_cm.c | 27 +++++++++++++-------------- drivers/infiniband/hw/qedr/verbs.c | 2 +- 4 files changed, 32 insertions(+), 33 deletions(-)
drivers/infiniband/hw/qedr/main.c +11 -11
@@ -54,8 +54,8 @@ MODULE_LICENSE("Dual BSD/GPL");#define QEDR_WQ_MULTIPLIER_DFT (3) -void qedr_ib_dispatch_event (struct qedr_dev *dev,u8 port_num, -enum ib_event_type type) +static void qedr_ib_dispatch_event (struct qedr_dev *dev,u8 port_num, +enum ib_event_type type) {struct ib_event ibev;
@@ -96,8 +96,8 @@ static struct net_device *qedr_get_netdev(struct ib_device *dev, u8 port_num)return qdev->ndev; } -int qedr_roce_port_immutable (struct ib_device *ibdev,u8 port_num, -struct ib_port_immutable *immutable) +static int qedr_roce_port_immutable (struct ib_device *ibdev,u8 port_num, +struct ib_port_immutable *immutable) {struct ib_port_attr attr;int err;
@@ -115,8 +115,8 @@ int qedr_roce_port_immutable(struct ib_device *ibdev, u8 port_num,return 0 ; } -int qedr_iw_port_immutable (struct ib_device *ibdev,u8 port_num, -struct ib_port_immutable *immutable) +static int qedr_iw_port_immutable (struct ib_device *ibdev,u8 port_num, +struct ib_port_immutable *immutable) {struct ib_port_attr attr;int err;
@@ -133,7 +133,7 @@ int qedr_iw_port_immutable(struct ib_device *ibdev, u8 port_num,return 0 ; } -int qedr_iw_register_device (struct qedr_dev *dev) +static int qedr_iw_register_device (struct qedr_dev *dev) { dev->ibdev.node_type =RDMA_NODE_RNIC ; dev->ibdev.query_gid = qedr_iw_query_gid;
@@ -159,7 +159,7 @@ int qedr_iw_register_device(struct qedr_dev *dev)return 0 ; } -void qedr_roce_register_device (struct qedr_dev *dev) +static void qedr_roce_register_device (struct qedr_dev *dev) { dev->ibdev.node_type =RDMA_NODE_IB_CA ; dev->ibdev.query_gid = qedr_query_gid;
@@ -689,12 +689,12 @@ static int qedr_set_device_attr(struct qedr_dev *dev)return 0 ; } -void qedr_unaffiliated_event (void *context,u8 event_code) +static void qedr_unaffiliated_event (void *context,u8 event_code) {pr_err ("unaffiliated event not implemented yet\n" ); } -void qedr_affiliated_event (void *context,u8 e_code,void *fw_handle) +static void qedr_affiliated_event (void *context,u8 e_code,void *fw_handle) {#define EVENT_TYPE_NOT_DEFINED 0#define EVENT_TYPE_CQ 1
@@ -833,7 +833,7 @@ static int qedr_init_hw(struct qedr_dev *dev)return rc; } -void qedr_stop_hw (struct qedr_dev *dev) +static void qedr_stop_hw (struct qedr_dev *dev) { dev->ops->rdma_remove_user (dev->rdma_ctx, dev->dpi); dev->ops->rdma_stop (dev->rdma_ctx);
drivers/infiniband/hw/qedr/qedr_iw_cm.c +7 -7
@@ -79,7 +79,7 @@ qedr_fill_sockaddr6(const struct qed_iwarp_cm_info *cm_info, } } -void +static void qedr_iw_mpa_request (void *context,struct qed_iwarp_cm_event_params *params) {struct qedr_iw_listener *listener = (struct qedr_iw_listener *)context;
@@ -113,7 +113,7 @@ qedr_iw_mpa_request(void *context, struct qed_iwarp_cm_event_params *params) listener->cm_id->event_handler (listener->cm_id, &event); } -void +static void qedr_iw_issue_event (void *context,struct qed_iwarp_cm_event_params *params,enum iw_cm_event_type event_type)
@@ -136,7 +136,7 @@ qedr_iw_issue_event(void *context, ep->cm_id->event_handler (ep->cm_id, &event); } -void +static void qedr_iw_close_event (void *context,struct qed_iwarp_cm_event_params *params) {struct qedr_iw_ep *ep = (struct qedr_iw_ep *)context;
@@ -149,7 +149,7 @@ qedr_iw_close_event(void *context, struct qed_iwarp_cm_event_params *params) } } -void +static void qedr_iw_qp_event (void *context,struct qed_iwarp_cm_event_params *params,enum ib_event_type ib_event,char *str)
@@ -217,7 +217,7 @@ static void qedr_iw_disconnect_worker(struct work_struct *work)qedr_iw_qp_rem_ref (&qp->ibqp); } -void +static void qedr_iw_disconnect_event (void *context,struct qed_iwarp_cm_event_params *params) {
@@ -262,7 +262,7 @@ qedr_iw_passive_complete(void *context,qedr_iw_close_event (context, params); } -int +static int qedr_iw_mpa_reply (void *context,struct qed_iwarp_cm_event_params *params) {struct qedr_iw_ep *ep = (struct qedr_iw_ep *)context;
@@ -274,7 +274,7 @@ qedr_iw_mpa_reply(void *context, struct qed_iwarp_cm_event_params *params)return dev->ops->iwarp_send_rtr (dev->rdma_ctx, &rtr_in); } -int +static int qedr_iw_event_handler (void *context,struct qed_iwarp_cm_event_params *params) {struct qedr_iw_ep *ep = (struct qedr_iw_ep *)context;
drivers/infiniband/hw/qedr/qedr_roce_cm.c +13 -14
@@ -64,11 +64,11 @@ void qedr_store_gsi_qp_cq(struct qedr_dev *dev, struct qedr_qp *qp, dev->gsi_qp = qp; } -void qedr_ll2_complete_tx_packet (void *cxt, -u8 connection_handle, -void *cookie, -dma_addr_t first_frag_addr, -bool b_last_fragment,bool b_last_packet) +static void qedr_ll2_complete_tx_packet (void *cxt,u8 connection_handle, +void *cookie, +dma_addr_t first_frag_addr, +bool b_last_fragment, +bool b_last_packet) {struct qedr_dev *dev = (struct qedr_dev *)cxt;struct qed_roce_ll2_packet *pkt = cookie;
@@ -93,8 +93,8 @@ void qedr_ll2_complete_tx_packet(void *cxt, (*cq->ibcq.comp_handler) (&cq->ibcq, cq->ibcq.cq_context); } -void qedr_ll2_complete_rx_packet (void *cxt, -struct qed_ll2_comp_rx_data *data) +static void qedr_ll2_complete_rx_packet (void *cxt, +struct qed_ll2_comp_rx_data *data) {struct qedr_dev *dev = (struct qedr_dev *)cxt;struct qedr_cq *cq = dev->gsi_rqcq;
@@ -122,10 +122,9 @@ void qedr_ll2_complete_rx_packet(void *cxt, (*cq->ibcq.comp_handler) (&cq->ibcq, cq->ibcq.cq_context); } -void qedr_ll2_release_rx_packet (void *cxt, -u8 connection_handle, -void *cookie, -dma_addr_t rx_buf_addr,bool b_last_packet) +static void qedr_ll2_release_rx_packet (void *cxt,u8 connection_handle, +void *cookie,dma_addr_t rx_buf_addr, +bool b_last_packet) {/* Do nothing... */ }
@@ -237,7 +236,7 @@ static int qedr_ll2_post_tx(struct qedr_dev *dev,return 0 ; } -int qedr_ll2_stop (struct qedr_dev *dev) +static int qedr_ll2_stop (struct qedr_dev *dev) {int rc;
@@ -260,8 +259,8 @@ int qedr_ll2_stop(struct qedr_dev *dev)return rc; } -int qedr_ll2_start (struct qedr_dev *dev, -struct ib_qp_init_attr *attrs,struct qedr_qp *qp) +static int qedr_ll2_start (struct qedr_dev *dev, +struct ib_qp_init_attr *attrs,struct qedr_qp *qp) {struct qed_ll2_acquire_data data;struct qed_ll2_cbs cbs;
drivers/infiniband/hw/qedr/verbs.c +1 -1
@@ -2268,7 +2268,7 @@ int qedr_query_qp(struct ib_qp *ibqp,return rc; } -int qedr_free_qp_resources (struct qedr_dev *dev,struct qedr_qp *qp) +static int qedr_free_qp_resources (struct qedr_dev *dev,struct qedr_qp *qp) {int rc =0 ;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 38/47 RDMA/qedr: Annotate iomem pointers correctly
In reply to a message not in the archive--- drivers/infiniband/hw/qedr/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/qedr/main.c +1 -1
@@ -819,7 +819,7 @@ static int qedr_init_hw(struct qedr_dev *dev)if (rc) goto out; - dev->db_addr = (void *)(uintptr_t )out_params.dpi_addr; + dev->db_addr = (void __iomem *)(uintptr_t )out_params.dpi_addr; dev->db_phys_addr = out_params.dpi_phys_addr; dev->db_size = out_params.dpi_size; dev->dpi = out_params.dpi;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 39/47 RDMA/qedr: Remove set-but-not-used variables
In reply to a message not in the archive--- drivers/infiniband/hw/qedr/verbs.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/infiniband/hw/qedr/verbs.c +1 -6
@@ -1447,13 +1447,11 @@ static int qedr_create_user_qp(struct qedr_dev *dev,struct qed_rdma_create_qp_out_params out_params;struct qedr_pd *pd =get_qedr_pd (ibpd);struct ib_ucontext *ib_ctx =NULL ; -struct qedr_ucontext *ctx =NULL ;struct qedr_create_qp_ureq ureq;int alloc_and_init =rdma_protocol_roce (&dev->ibdev,1 );int rc = -EINVAL ; ib_ctx = ibpd->uobject->context; - ctx =get_qedr_ucontext (ib_ctx);memset (&ureq,0 ,sizeof (ureq)); rc =ib_copy_from_udata (&ureq, udata,sizeof (ureq));
@@ -2602,7 +2600,6 @@ static struct qedr_mr *__qedr_alloc_mr(struct ib_pd *ibpd,struct ib_mr *qedr_alloc_mr (struct ib_pd *ibpd,enum ib_mr_type mr_type,u32 max_num_sg) { -struct qedr_dev *dev;struct qedr_mr *mr;if (mr_type !=IB_MR_TYPE_MEM_REG )
@@ -2613,8 +2610,6 @@ struct ib_mr *qedr_alloc_mr(struct ib_pd *ibpd,if (IS_ERR (mr))return ERR_PTR (-EINVAL ); - dev = mr->dev; -return &mr->ibmr; }
@@ -3109,7 +3104,7 @@ static int __qedr_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,break ;case IB_WR_RDMA_READ_WITH_INV :SET_FIELD2 (wqe->flags,RDMA_SQ_RDMA_WQE_1ST_READ_INV_FLG ,1 ); -/* fallthrough... same is identical to RDMA READ */ +/* fallthrough -- same is identical to RDMA READ */ case IB_WR_RDMA_READ : wqe->req_type =RDMA_SQ_REQ_TYPE_RDMA_RD ;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 40/47 IB/qib: Make qib_inc_eeprom_err() macro more safe to use
In reply to a message not in the archiveAvoid that using the qib_inc_eeprom_err() macro in an if-statement triggers the following compiler warning:
warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
--- drivers/infiniband/hw/qib/qib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/qib/qib.h +1 -1
@@ -1297,7 +1297,7 @@ int qib_twsi_blk_rd(struct qib_devdata *dd, int dev, int addr, void *buffer,int qib_twsi_blk_wr (struct qib_devdata *dd,int dev,int addr,const void *buffer,int len);void qib_get_eeprom_info (struct qib_devdata *); -#define qib_inc_eeprom_err (dd, eidx, incr) +#define qib_inc_eeprom_err (dd, eidx, incr) do { } while (0)void qib_dump_lookup_output_queue (struct qib_devdata *);void qib_force_pio_avail_update (struct qib_devdata *);void qib_clear_symerror_on_linkup (unsigned long opaque);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 41/47 IB/qib: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/hw/qib/qib_mad.c | 1 + drivers/infiniband/hw/qib/qib_rc.c | 2 +- drivers/infiniband/hw/qib/qib_sdma.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)
drivers/infiniband/hw/qib/qib_mad.c +1 -0
@@ -434,6 +434,7 @@ static int check_mkey(struct qib_ibport *ibp, struct ib_smp *smp, int mad_flags)/* Bad mkey not a violation below level 2 */ if (ibp->rvp.mkeyprot <2 )break ; +/* fall through */ case IB_MGMT_METHOD_SET :case IB_MGMT_METHOD_TRAP_REPRESS :if (ibp->rvp.mkey_violations !=0xFFFF )
drivers/infiniband/hw/qib/qib_rc.c +1 -1
@@ -1869,7 +1869,7 @@ void qib_rc_rcv(struct qib_ctxtdata *rcd, struct ib_header *hdr, qp->r_rcv_len =0 ;if (opcode ==OP (SEND_ONLY )) goto no_immediate_data; -/* FALLTHROUGH for SEND_ONLY_WITH_IMMEDIATE */ +/* fall through -- for SEND_ONLY_WITH_IMMEDIATE */ case OP (SEND_LAST_WITH_IMMEDIATE ): send_last_imm: wc.ex.imm_data = ohdr->u.imm_data;
drivers/infiniband/hw/qib/qib_sdma.c +1 -1
@@ -808,7 +808,7 @@ void __qib_sdma_process_event(struct qib_pportdata *ppd,* bringing the link up with traffic active on * 7220, e.g. */ ss->go_s99_running =1 ; -/* fall through and start dma engine */ +/* fall through -- and start dma engine */ case qib_sdma_event_e10_go_hw_start:/* This reference means the state machine is started */ sdma_get (&ppd->sdma_state);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 42/47 IB/qib: Remove set-but-not-used variables
In reply to a message not in the archive--- drivers/infiniband/hw/qib/qib_diag.c | 6 ------ drivers/infiniband/hw/qib/qib_file_ops.c | 9 --------- drivers/infiniband/hw/qib/qib_iba6120.c | 2 -- drivers/infiniband/hw/qib/qib_iba7220.c | 3 --- drivers/infiniband/hw/qib/qib_iba7322.c | 15 ++++----------- drivers/infiniband/hw/qib/qib_mad.c | 3 +-- drivers/infiniband/hw/qib/qib_pcie.c | 3 +-- drivers/infiniband/hw/qib/qib_sd7220.c | 2 -- drivers/infiniband/hw/qib/qib_tx.c | 4 ---- drivers/infiniband/hw/qib/qib_verbs.c | 3 +-- 10 files changed, 7 insertions(+), 43 deletions(-)
drivers/infiniband/hw/qib/qib_diag.c +0 -6
@@ -761,7 +761,6 @@ static ssize_t qib_diag_read(struct file *fp, char __user *data, {struct qib_diag_client *dc = fp->private_data;struct qib_devdata *dd = dc->dd; -void __iomem *kreg_base;ssize_t ret;if (dc->pid != current->pid) {
@@ -769,8 +768,6 @@ static ssize_t qib_diag_read(struct file *fp, char __user *data, goto bail; } - kreg_base = dd->kregbase; -if (count ==0 ) ret =0 ;else if ((count %4 ) || (*off %4 ))
@@ -838,7 +835,6 @@ static ssize_t qib_diag_write(struct file *fp, const char __user *data, {struct qib_diag_client *dc = fp->private_data;struct qib_devdata *dd = dc->dd; -void __iomem *kreg_base;ssize_t ret;if (dc->pid != current->pid) {
@@ -846,8 +842,6 @@ static ssize_t qib_diag_write(struct file *fp, const char __user *data, goto bail; } - kreg_base = dd->kregbase; -if (count ==0 ) ret =0 ;else if ((count %4 ) || (*off %4 ))
drivers/infiniband/hw/qib/qib_file_ops.c +0 -9
@@ -696,15 +696,8 @@ static void qib_clean_part_key(struct qib_ctxtdata *rcd, struct qib_devdata *dd) {int i, j, pchanged =0 ; -u64 oldpkey;struct qib_pportdata *ppd = rcd->ppd; -/* for debugging only */ - oldpkey = (u64 ) ppd->pkeys[0 ] | - ((u64 ) ppd->pkeys[1 ] <<16 ) | - ((u64 ) ppd->pkeys[2 ] <<32 ) | - ((u64 ) ppd->pkeys[3 ] <<48 ); -for (i =0 ; i <ARRAY_SIZE (rcd->pkeys); i++) {if (!rcd->pkeys[i])continue ;
@@ -1817,7 +1810,6 @@ static int qib_close(struct inode *in, struct file *fp)struct qib_devdata *dd;unsigned long flags;unsigned ctxt; -pid_t pid;mutex_lock (&qib_mutex);
@@ -1859,7 +1851,6 @@ static int qib_close(struct inode *in, struct file *fp)spin_lock_irqsave (&dd->uctxt_lock, flags); ctxt = rcd->ctxt; dd->rcd[ctxt] =NULL ; - pid = rcd->pid; rcd->pid =0 ;spin_unlock_irqrestore (&dd->uctxt_lock, flags);
drivers/infiniband/hw/qib/qib_iba6120.c +0 -2
@@ -1914,7 +1914,6 @@ static void qib_6120_put_tid_2(struct qib_devdata *dd, u64 __iomem *tidptr, u32 type, unsigned long pa) {u32 __iomem *tidp32 = (u32 __iomem *)tidptr; -u32 tidx;if (!dd->kregbase)return ;
@@ -1938,7 +1937,6 @@ static void qib_6120_put_tid_2(struct qib_devdata *dd, u64 __iomem *tidptr,else /* for now, always full 4KB page */ pa |=2 <<29 ; } - tidx = tidptr - dd->egrtidbase;writel (pa, tidp32);mmiowb (); }
drivers/infiniband/hw/qib/qib_iba7220.c +0 -3
@@ -3524,7 +3524,6 @@ static void autoneg_7220_work(struct work_struct *work) {struct qib_pportdata *ppd;struct qib_devdata *dd; -u64 startms;u32 i;unsigned long flags;
@@ -3532,8 +3531,6 @@ static void autoneg_7220_work(struct work_struct *work) autoneg_work.work)->pportdata; dd = ppd->dd; - startms =jiffies_to_msecs (jiffies); -/* * Busy wait for this first part, it should be at most a * few hundred usec, since we scheduled ourselves for 2msec.
drivers/infiniband/hw/qib/qib_iba7322.c +4 -11
@@ -3435,7 +3435,6 @@ static void qib_setup_7322_interrupt(struct qib_devdata *dd, int clearpend)for (i =0 ; msixnum < dd->cspec->num_msix_entries; i++) {irq_handler_t handler;void *arg; -u64 val;int lsb, reg, sh;#ifdef CONFIG_INFINIBAND_QIB_DCA int dca =0 ;
@@ -3506,8 +3505,8 @@ static void qib_setup_7322_interrupt(struct qib_devdata *dd, int clearpend) mask &= ~(1ULL << lsb); redirect[reg] |= ((u64 ) msixnum) << sh; } - val =qib_read_kreg64 (dd,2 * msixnum +1 + - (QIB_7322_MsixTable_OFFS /sizeof (u64))); +qib_read_kreg64 (dd,2 * msixnum +1 + + (QIB_7322_MsixTable_OFFS /sizeof (u64)));if (firstcpu < nr_cpu_ids && zalloc_cpumask_var( &dd->cspec->msix_entries[msixnum].mask,
@@ -5362,16 +5361,11 @@ static void try_7322_autoneg(struct qib_pportdata *ppd)static void autoneg_7322_work (struct work_struct *work) {struct qib_pportdata *ppd; -struct qib_devdata *dd; -u64 startms;u32 i;unsigned long flags; ppd = container_of(work, struct qib_chippport_specific, autoneg_work.work)->ppd; - dd = ppd->dd; - - startms =jiffies_to_msecs (jiffies);/* * Busy wait for this first part, it should be at most a
@@ -7811,13 +7805,12 @@ static void ibsd_wr_allchans(struct qib_pportdata *ppd, int addr, unsigned data, {struct qib_devdata *dd = ppd->dd;int chan; -u32 rbc;for (chan =0 ; chan <SERDES_CHANS ; ++chan) {ahb_mod (dd,IBSD (ppd->hw_pidx), (chan + (chan >>1 )), addr, data, mask); - rbc =ahb_mod (dd,IBSD (ppd->hw_pidx), (chan + (chan >>1 )), - addr,0 ,0 ); +ahb_mod (dd,IBSD (ppd->hw_pidx), (chan + (chan >>1 )), addr, +0 ,0 ); } }
drivers/infiniband/hw/qib/qib_mad.c +1 -2
@@ -280,7 +280,7 @@ static int subn_get_nodeinfo(struct ib_smp *smp, struct ib_device *ibdev, {struct ib_node_info *nip = (struct ib_node_info *)&smp->data;struct qib_devdata *dd =dd_from_ibdev (ibdev); -u32 vendor, majrev, minrev; +u32 majrev, minrev;unsigned pidx = port -1 ;/* IB number port from 1, hdw from 0 */ /* GUID 0 is illegal */
@@ -303,7 +303,6 @@ static int subn_get_nodeinfo(struct ib_smp *smp, struct ib_device *ibdev, minrev = dd->minrev; nip->revision =cpu_to_be32 ((majrev <<16 ) | minrev); nip->local_port_num = port; - vendor = dd->vendorid; nip->vendor_id[0 ] =QIB_SRC_OUI_1 ; nip->vendor_id[1 ] =QIB_SRC_OUI_2 ; nip->vendor_id[2 ] =QIB_SRC_OUI_3 ;
drivers/infiniband/hw/qib/qib_pcie.c +1 -2
@@ -397,7 +397,6 @@ MODULE_PARM_DESC(pcie_coalesce, "tune PCIe colescing on some Intel chipsets");*/ static void qib_tune_pcie_coalesce (struct qib_devdata *dd) { -int r;struct pci_dev *parent;u16 devid;u32 mask, bits, val;
@@ -452,7 +451,7 @@ static void qib_tune_pcie_coalesce(struct qib_devdata *dd)pci_read_config_dword (parent,0x48 , &val); val &= ~mask; val |= bits; - r =pci_write_config_dword (parent,0x48 , val); +pci_write_config_dword (parent,0x48 , val); }/*
drivers/infiniband/hw/qib/qib_sd7220.c +0 -2
@@ -755,7 +755,6 @@ static int qib_sd7220_ram_xfer(struct qib_devdata *dd, int sdnum, u32 loc,int addr;int ret;unsigned long flags; -const char *op;/* Pick appropriate transaction reg and "Chip select" for this serdes */ switch (sdnum) {
@@ -775,7 +774,6 @@ static int qib_sd7220_ram_xfer(struct qib_devdata *dd, int sdnum, u32 loc,return -1 ; } - op = rd_notwr ?"Rd" :"Wr" ;spin_lock_irqsave (&dd->cspec->sdepb_lock, flags); owned =epb_access (dd, sdnum,1 );
drivers/infiniband/hw/qib/qib_tx.c +0 -4
@@ -179,8 +179,6 @@ void qib_disarm_piobufs_set(struct qib_devdata *dd, unsigned long *mask, pppd[i] =NULL ;for (i =0 ; i < cnt; i++) { -int which; -if (!test_bit (i, mask))continue ;/*
@@ -201,9 +199,7 @@ void qib_disarm_piobufs_set(struct qib_devdata *dd, unsigned long *mask, (!test_bit(i << 1, dd->pioavailkernel) && find_ctxt(dd, i))) { __set_bit(i, dd->pio_need_disarm); - which = 0; } else { - which =1 ; dd->f_sendctrl (dd->pport,QIB_SENDCTRL_DISARM_BUF (i)); }spin_unlock_irqrestore (&dd->pioavail_lock, flags);
drivers/infiniband/hw/qib/qib_verbs.c +1 -2
@@ -701,7 +701,7 @@ void qib_put_txreq(struct qib_verbs_txreq *tx)*/ void qib_verbs_sdma_desc_avail (struct qib_pportdata *ppd,unsigned avail) { -struct rvt_qp *qp, *nqp; +struct rvt_qp *qp;struct qib_qp_priv *qpp, *nqpp;struct rvt_qp *qps[20 ];struct qib_ibdev *dev;
@@ -714,7 +714,6 @@ void qib_verbs_sdma_desc_avail(struct qib_pportdata *ppd, unsigned avail)/* Search wait list for first QP wanting DMA descriptors. */ list_for_each_entry_safe (qpp, nqpp, &dev->dmawait, iowait) { qp = qpp->owner; - nqp = nqpp->owner;if (qp->port_num != ppd->port)continue ;if (n ==ARRAY_SIZE (qps))
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 43/47 RDMA/rdmavt: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/sw/rdmavt/qp.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/sw/rdmavt/qp.c +1 -0
@@ -807,6 +807,7 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,if (init_attr->port_num ==0 || init_attr->port_num > ibpd->device->phys_port_cnt)return ERR_PTR (-EINVAL ); +/* fall through */ case IB_QPT_UC :case IB_QPT_RC :case IB_QPT_UD :
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 44/47 RDMA/rxe: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveAvoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
--- drivers/infiniband/sw/rxe/rxe_comp.c | 4 ++-- drivers/infiniband/sw/rxe/rxe_task.c | 2 +- drivers/infiniband/sw/rxe/rxe_verbs.c | 1 + 3 files changed, 4 insertions(+), 3 deletions(-)
drivers/infiniband/sw/rxe/rxe_comp.c +2 -2
@@ -270,8 +270,8 @@ static inline enum comp_state check_ack(struct rxe_qp *qp,if ((syn &AETH_TYPE_MASK ) !=AETH_ACK )return COMPST_ERROR ; -/* Fall through (IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE -* doesn't have an AETH) +/* fall through */ +/* (IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE doesn't have an AETH) */ case IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE : if (wqe->wr.opcode != IB_WR_RDMA_READ &&
drivers/infiniband/sw/rxe/rxe_task.c +1 -1
@@ -71,7 +71,7 @@ void rxe_do_task(unsigned long data)case TASK_STATE_BUSY : task->state =TASK_STATE_ARMED ; -/* fall through to */ +/* fall through */ case TASK_STATE_ARMED :spin_unlock_irqrestore (&task->state_lock, flags);return ;
drivers/infiniband/sw/rxe/rxe_verbs.c +1 -0
@@ -644,6 +644,7 @@ static void init_send_wr(struct rxe_qp *qp, struct rxe_send_wr *wr,switch (wr->opcode) {case IB_WR_RDMA_WRITE_WITH_IMM : wr->ex.imm_data = ibwr->ex.imm_data; +/* fall through */ case IB_WR_RDMA_READ :case IB_WR_RDMA_WRITE : wr->wr.rdma.remote_addr =rdma_wr (ibwr)->remote_addr;
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 45/47 RDMA/usnic: Make the compiler check declaration consistency during compilation
In reply to a message not in the archiveThis patch avoids that sparse complains about missing declarations.
--- drivers/infiniband/hw/usnic/usnic_ib_sysfs.c | 1 + drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 1 + 2 files changed, 2 insertions(+)
drivers/infiniband/hw/usnic/usnic_ib_sysfs.c +1 -0
@@ -43,6 +43,7 @@#include "usnic_ib_qp_grp.h" #include "usnic_vnic.h" #include "usnic_ib_verbs.h" +#include "usnic_ib_sysfs.h" #include "usnic_log.h" #include "usnic_ib_sysfs.h"
drivers/infiniband/hw/usnic/usnic_ib_verbs.c +1 -0
@@ -42,6 +42,7 @@#include "usnic_ib.h" #include "usnic_common_util.h" #include "usnic_ib_qp_grp.h" +#include "usnic_ib_verbs.h" #include "usnic_fwd.h" #include "usnic_log.h" #include "usnic_uiom.h"
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 46/47 RDMA/usnic: Remove a set-but-not-used variable
In reply to a message not in the archive--- drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 2 -- 1 file changed, 2 deletions(-)
drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c +0 -2
@@ -392,14 +392,12 @@ int usnic_ib_qp_grp_modify(struct usnic_ib_qp_grp *qp_grp, void *data) {int status =0 ; -int vnic_idx;struct ib_event ib_event;enum ib_qp_state old_state;struct usnic_transport_spec *trans_spec;struct usnic_ib_qp_grp_flow *qp_flow; old_state = qp_grp->state; - vnic_idx =usnic_vnic_get_index (qp_grp->vf->vnic); trans_spec = (struct usnic_transport_spec *) data;spin_lock (&qp_grp->lock);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 47/47 RDMA/usnic: Instantiate data structures once
In reply to a message not in the archiveData structures should not be defined in a header file. Hence move the min_transport_spec[] definition from a header file to a .c file.
--- drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h | 25 +------------------------ drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 24 deletions(-)
drivers/infiniband/hw/usnic/usnic_ib_qp_grp.h +1 -24
@@ -84,30 +84,7 @@ struct usnic_ib_qp_grp_flow {char dentry_name[32 ]; }; -static const struct -usnic_vnic_res_spec min_transport_spec[USNIC_TRANSPORT_MAX ] = { - {/*USNIC_TRANSPORT_UNKNOWN*/ - .resources = { - {.type =USNIC_VNIC_RES_TYPE_EOL , .cnt =0 ,}, - }, - }, - {/*USNIC_TRANSPORT_ROCE_CUSTOM*/ - .resources = { - {.type =USNIC_VNIC_RES_TYPE_WQ , .cnt =1 ,}, - {.type =USNIC_VNIC_RES_TYPE_RQ , .cnt =1 ,}, - {.type =USNIC_VNIC_RES_TYPE_CQ , .cnt =1 ,}, - {.type =USNIC_VNIC_RES_TYPE_EOL , .cnt =0 ,}, - }, - }, - {/*USNIC_TRANSPORT_IPV4_UDP*/ - .resources = { - {.type =USNIC_VNIC_RES_TYPE_WQ , .cnt =1 ,}, - {.type =USNIC_VNIC_RES_TYPE_RQ , .cnt =1 ,}, - {.type =USNIC_VNIC_RES_TYPE_CQ , .cnt =1 ,}, - {.type =USNIC_VNIC_RES_TYPE_EOL , .cnt =0 ,}, - }, - }, -}; +extern const struct usnic_vnic_res_spec min_transport_spec[USNIC_TRANSPORT_MAX ];const char *usnic_ib_qp_grp_state_to_string (enum ib_qp_state state);int usnic_ib_qp_grp_dump_hdr (char *buf,int buf_sz);
drivers/infiniband/hw/usnic/usnic_ib_verbs.c +24 -0
@@ -51,6 +51,30 @@#define USNIC_DEFAULT_TRANSPORT USNIC_TRANSPORT_ROCE_CUSTOM +const struct usnic_vnic_res_spec min_transport_spec[USNIC_TRANSPORT_MAX ] = { + {/*USNIC_TRANSPORT_UNKNOWN*/ + .resources = { + {.type =USNIC_VNIC_RES_TYPE_EOL , .cnt =0 ,}, + }, + }, + {/*USNIC_TRANSPORT_ROCE_CUSTOM*/ + .resources = { + {.type =USNIC_VNIC_RES_TYPE_WQ , .cnt =1 ,}, + {.type =USNIC_VNIC_RES_TYPE_RQ , .cnt =1 ,}, + {.type =USNIC_VNIC_RES_TYPE_CQ , .cnt =1 ,}, + {.type =USNIC_VNIC_RES_TYPE_EOL , .cnt =0 ,}, + }, + }, + {/*USNIC_TRANSPORT_IPV4_UDP*/ + .resources = { + {.type =USNIC_VNIC_RES_TYPE_WQ , .cnt =1 ,}, + {.type =USNIC_VNIC_RES_TYPE_RQ , .cnt =1 ,}, + {.type =USNIC_VNIC_RES_TYPE_CQ , .cnt =1 ,}, + {.type =USNIC_VNIC_RES_TYPE_EOL , .cnt =0 ,}, + }, + }, +}; +static void usnic_ib_fw_string_to_u64 (char *fw_ver_str,u64 *fw_ver) { *fw_ver = *((u64 *)fw_ver_str);
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hefty, Sean
Acked-byRE: [PATCH 03/47] RDMA/cma: Avoid triggering undefined behavior
In reply to a message not in the archiveQuoted 15 lines
According to the C standard the behavior of computations with integer operands is as follows:
* A computation involving unsigned operands can never overflow, because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting type.
* The behavior for signed integer underflow and overflow is undefined.Hence only use unsigned integers when checking for integer overflow.
This patch is what I came up with after having analyzed the following smatch warnings:
Quoted 8 lines
drivers/infiniband/core/cma.c:3448:cma_resolve_ib_udp()warn: signed overflow undefined. 'offset +conn_param->private_data_len<conn_param->private_data_len'drivers/infiniband/core/cma.c:3505:cma_connect_ib()warn: signed overflow undefined. 'offset +conn_param->private_data_len<conn_param->private_data_len'Signed-off-by Bart Van Assche <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hefty, Sean
Acked-byRE: [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 5 lines
Avoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by Bart Van Assche <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Steve Wise
Reviewed-byRE: [PATCH 04/47] RDMA/iwcm: Remove a set-but-not-used variable
In reply to a message not in the archiveQuoted 4 lines
Subject: [PATCH 04/47] RDMA/iwcm: Remove a set-but-not-used variable
Signed-off-by Bart Van Assche <[email protected]>Cc Steve Wise <[email protected]>
Looks fine.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Steve Wise
Reviewed-byRE: [PATCH 09/47] RDMA/cxgb3: Annotate locking assumptions
In reply to a message not in the archiveQuoted 8 lines
Subject: [PATCH 09/47] RDMA/cxgb3: Annotate locking assumptions
Tell sparse what the locking assumptions are for
__flush_qp()such that it does not complain about the locking operations inside that function.Signed-off-by Bart Van Assche <[email protected]>Cc Steve Wise <[email protected]>
Looks ok to me.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Steve Wise
Reviewed-byRE: [PATCH 11/47] RDMA/cxgb3: Remove a set-but-not-used variable
In reply to a message not in the archiveQuoted 4 lines
Subject: [PATCH 11/47] RDMA/cxgb3: Remove a set-but-not-used variable
Signed-off-by Bart Van Assche <[email protected]>Cc Steve Wise <[email protected]>
Looks fine.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Steve Wise
Reviewed-byRE: [PATCH 10/47] RDMA/cxgb3: Annotate an RCU pointer
In reply to a message not in the archiveQuoted 8 lines
Subject: [PATCH 10/47] RDMA/cxgb3: Annotate an RCU pointer
Annotate t3cdev.l2opt with
__rcusince it is used as an RCU pointer.Signed-off-by Bart Van Assche <[email protected]>Cc Steve Wise <[email protected]>
Looks ok.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Steve Wise
Reviewed-byRE: [PATCH 15/47] RDMA/cxgb4: Remove a set-but-not-used variable
In reply to a message not in the archiveQuoted 4 lines
Subject: [PATCH 15/47] RDMA/cxgb4: Remove a set-but-not-used variable
Signed-off-by Bart Van Assche <[email protected]>Cc Steve Wise <[email protected]>
Looks fine.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Steve Wise
Reviewed-byRE: [PATCH 14/47] RDMA/cxgb4: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 8 lines
Subject: [PATCH 14/47] RDMA/cxgb4: Suppress gcc 7 fall-through complaints
Avoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by Bart Van Assche <[email protected]>Cc Steve Wise <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Steve Wise
Reviewed-byRE: [PATCH 13/47] RDMA/cxgb4: Declare a local variable 'static'
In reply to a message not in the archiveReview
Quoted 8 lines
Signed-off-by Bart Van Assche <[email protected]>Cc Steve Wise <[email protected]>--- drivers/infiniband/hw/cxgb4/cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/infiniband/hw/cxgb4/cm.c
drivers/infiniband/hw/cxgb4/cm.c module_param(enable_tcp_window_scaling, int, 0644); · line 104
Quoted 11 lines
index
2331e7d57704..49d9f9b870e5100644drivers/infiniband/hw/cxgb4/cm.c +1
-1@@ -99,7 +99,7 @@ module_param(enable_tcp_window_scaling, int, 0644);MODULE_PARM_DESC (enable_tcp_window_scaling,"Enable tcp window scaling (default=1)" ); -int c4iw_debug; +static int c4iw_debug;module_param (c4iw_debug, int,0644 );MODULE_PARM_DESC (c4iw_debug,"obsolete" );
Can we just remove this now? IE has it been 1 release since it was obsoleted?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Steve Wise
Reviewed-byRE: [PATCH 12/47] RDMA/cxgb4: Fix indentation
In reply to a message not in the archiveQuoted 6 lines
This patch avoids that smatch reports the following:
drivers/infiniband/hw/cxgb4/device.c:1105:copy_gl_to_skb_pkt()warn:
inconsistent indentingdrivers/infiniband/hw/cxgb4/cm.c:835:send_connect()warn: inconsistent
indenting
Quoted 1 line
drivers/infiniband/hw/cxgb4/cm.c:841:send_connect()warn: inconsistent
indenting
Quoted 1 line
drivers/infiniband/hw/cxgb4/cm.c:888:send_connect()warn: inconsistent
indenting
Quoted 1 line
drivers/infiniband/hw/cxgb4/cm.c:894:send_connect()warn: inconsistent
indenting
Quoted 3 lines
Signed-off-by Bart Van Assche <[email protected]>Cc Steve Wise <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Leon Romanovsky
Reviewed-byRe: [PATCH 25/47] IB/mlx4: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 11 lines · Bart Van Assche
Avoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by Bart Van Assche <[email protected]>Cc Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>--- drivers/infiniband/hw/mlx4/cq.c | 2 ++ drivers/infiniband/hw/mlx4/mcg.c | 1 + 2 files changed, 3 insertions(+)
Thanks,
Leon Romanovsky
Reviewed-byRe: [PATCH 27/47] IB/mlx5: Remove a set-but-not-used variable
In reply to a message not in the archiveQuoted 6 lines · Bart Van Assche
Signed-off-by Bart Van Assche <[email protected]>Cc Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>--- drivers/infiniband/hw/mlx5/qp.c | 2 -- 1 file changed, 2 deletions(-)
Thanks,
The "inl" variable was removed in commit: 5fe9dec0d045 ("IB/mlx5: Use blue flame register allocator in mlx5_ib")
Leon Romanovsky
Reviewed-byRe: [PATCH 26/47] IB/mlx5: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 11 lines · Bart Van Assche
Avoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by Bart Van Assche <[email protected]>Cc Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>--- drivers/infiniband/hw/mlx5/cq.c | 2 ++ drivers/infiniband/hw/mlx5/qp.c | 1 + 2 files changed, 3 insertions(+)
Thanks,
Re: [PATCH 19/47] IB/hns: Annotate iomem pointers correctly
In reply to a message not in the archiveQuoted 5 lines · Bart Van Assche
This patch avoids that sparse complains that there is an address space mismatch.
Signed-off-by Bart Van Assche <[email protected]>Cc Signed-off-by: Lijun Ou <[email protected]>
Something went wrong here.
Quoted 3 lines
Cc Wei Hu (Xavier) <[email protected]>Cc Shaobo Xu <[email protected]>---
Re: [PATCH 20/47] IB/hns: Declare local functions 'static'
In reply to a message not in the archiveQuoted 2 lines · Bart Van Assche
Signed-off-by Bart Van Assche <[email protected]>Cc Signed-off-by: Lijun Ou <[email protected]>
^^^^^^^^^^ something wrong.
Quoted 3 lines
Cc Wei Hu (Xavier) <[email protected]>Cc Shaobo Xu <[email protected]>---
Leon Romanovsky
Reviewed-byRe: [PATCH 44/47] RDMA/rxe: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 4 lines · Bart Van Assche
Avoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
Quoted 8 lines
Signed-off-by Bart Van Assche <[email protected]>Cc Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/[email protected]>--- drivers/infiniband/sw/rxe/rxe_comp.c | 4 ++-- drivers/infiniband/sw/rxe/rxe_task.c | 2 +- drivers/infiniband/sw/rxe/rxe_verbs.c | 1 + 3 files changed, 4 insertions(+), 3 deletions(-)
Thanks,
Leon Romanovsky
Reviewed-byRe: [PATCH 01/47] IB/core: Fix endianness annotation in rdma_is_multicast_addr()
In reply to a message not in the archiveQuoted 8 lines · Bart Van Assche
Since
ipv4_addris a big endian 32-bit number, annotate it as such.Fixes commit be1d325a3358 ("IB/core: Set RoCEv2 MGID according to spec")Signed-off-by Bart Van Assche <[email protected]>--- include/rdma/ib_addr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks,
Re: [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
In reply to a message not in the archiveQuoted 44 lines · Bart Van Assche
This patch reduces the number of #ifdefs and also avoids that smatch reports the following:
drivers/infiniband/core/uverbs_ioctl.c:276:ib_uverbs_cmd_verbs()warn: if statement not indenteddrivers/infiniband/core/uverbs_ioctl.c:280:ib_uverbs_cmd_verbs()warn: possible memory leak of 'ctx'drivers/infiniband/core/uverbs_ioctl.c:315:ib_uverbs_cmd_verbs()warn: if statement not indentedReferences: commit
fac9658cabb9("IB/core: Add new ioctl interface")Signed-off-by Bart Van Assche <[email protected]>Cc Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/[email protected]>Cc Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/[email protected]>---
drivers/infiniband/core/uverbs_ioctl.c| 20 +++++++++-----------1 file changed, 9 insertions(+), 11 deletions(-)drivers/infiniband/core/uverbs_ioctl.c +5
-2@@ -234,7 +234,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, const struct uverbs_method_spec *method_spec; long err = 0; unsigned int i; - struct { + struct attr_and_bundle { struct ib_uverbs_attr *uattrs; struct uverbs_attr_bundle *uverbs_attr_bundle; } *ctx = NULL;@@ -242,7 +242,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, unsigned long *curr_bitmap; size_t ctx_size; #ifdef UVERBS_OPTIMIZE_USING_STACK_SZ - uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)]; + uintptr_t __data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)]; + struct attr_and_bundle *const data = (void *)__data; +#else + struct attr_and_bundle *const data = NULL; #endif if (hdr->reserved)@@ -269,13 +272,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,(method_spec->num_child_attrs /
BITS_PER_LONG+method_spec->num_buckets);
Quoted 2 lines
-#ifdef
UVERBS_OPTIMIZE_USING_STACK_SZ
if (ctx_size<=UVERBS_OPTIMIZE_USING_STACK_SZ)
If UVERBS_OPTIMIZE_USING_STACK_SZ isn't defined, you'll get an error here. Maybe we could define it as 0 in the else part of the local variables deceleration.
Quoted 20 lines
- ctx = (void *)data;
-
+ ctx = data;
if (!ctx)
-#endif
- ctx =kmalloc(ctx_size, GFP_KERNEL);
+ ctx =kmalloc(ctx_size, GFP_KERNEL);
if (!ctx)
return-ENOMEM;drivers/infiniband/core/uverbs_ioctl.c +0
-0@@ -311,10 +311,8 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, err = uverbs_handle_method(buf, ctx->uattrs, hdr->num_attrs, ib_dev, file, method_spec, ctx->uverbs_attr_bundle);out:
drivers/infiniband/core/uverbs_ioctl.c +2
-4-#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ - if (ctx_size > UVERBS_OPTIMIZE_USING_STACK_SZ) -#endif - kfree(ctx); + if (ctx != data) + kfree(ctx);
Quoted 4 lines
return err;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 15 lines · Bart Van Assche
Hello Doug,
As we all know there are several static analysis tools available for the Linux
kernel and these tools are valuable. I'm referring to increasing the gcc
warning level (W=1), sparse and smatch. It is helpful to analyze new code with
these tools before submitting a patch. These tools are most useful if existing
code is clean. Hence this patch series that significantly reduces the number
of complaints reported by static analysis tools. Please consider this patch
series for kernel v4.15.
The series looks pretty good Bart. I'd like some Intel eyes on the hfi1 changes, and I'd like some people to report back that the rcu changes in their code are good, and the Cc: Signed-off-by: mistakes in the hns_roce parts needs fixed. Then I'll be ready to take it. Thanks for all the work here.
Signature · 8 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 19/47] IB/hns: Annotate iomem pointers correctly
In reply to a message not in the archiveT24gU3VuLCAyMDE3LTEwLTA4IGF0IDE2OjQyICswMzAwLCBMZW9uIFJvbWFub3Zza3kgd3JvdGU6 DQo+IE9uIEZyaSwgT2N0IDA2LCAyMDE3IGF0IDAyOjMzOjA1UE0gLTA3MDAsIEJhcnQgVmFuIEFz c2NoZSB3cm90ZToNCj4gPiBUaGlzIHBhdGNoIGF2b2lkcyB0aGF0IHNwYXJzZSBjb21wbGFpbnMg dGhhdCB0aGVyZSBpcyBhbiBhZGRyZXNzDQo+ID4gc3BhY2UgbWlzbWF0Y2guDQo+ID4gDQo+ID4g U2lnbmVkLW9mZi1ieTogQmFydCBWYW4gQXNzY2hlIDxiYXJ0LnZhbmFzc2NoZUB3ZGMuY29tPg0K PiA+IENjOiBTaWduZWQtb2ZmLWJ5OiBMaWp1biBPdSA8b3VsaWp1bkBodWF3ZWkuY29tPg0KPiAN Cj4gU29tZXRoaW5nIHdlbnQgd3JvbmcgaGVyZS4NCg0KSGVsbG8gTGVvbiwNCg0KVGhhbmtzIGZv ciBoYXZpbmcgcmVwb3J0ZWQgdGhpcy4gSSB3aWxsIGZpeCB0aGUgQ2MtbGlzdC4NCg0KQmFydC4= --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
In reply to a message not in the archiveT24gTW9uLCAyMDE3LTEwLTA5IGF0IDEwOjQwICswMzAwLCBNYXRhbiBCYXJhayAoRXh0ZXJuYWwp IHdyb3RlOg0KPiBPbiAwNy8xMC8yMDE3IDAwOjMyLCBCYXJ0IFZhbiBBc3NjaGUgd3JvdGU6DQo+ ID4gVGhpcyBwYXRjaCByZWR1Y2VzIHRoZSBudW1iZXIgb2YgI2lmZGVmcyBhbmQgYWxzbyBhdm9p ZHMgdGhhdA0KPiA+IHNtYXRjaCByZXBvcnRzIHRoZSBmb2xsb3dpbmc6DQo+ID4gDQo+ID4gZHJp dmVycy9pbmZpbmliYW5kL2NvcmUvdXZlcmJzX2lvY3RsLmM6Mjc2OiBpYl91dmVyYnNfY21kX3Zl cmJzKCkgd2FybjogaWYgc3RhdGVtZW50IG5vdCBpbmRlbnRlZA0KPiA+IGRyaXZlcnMvaW5maW5p YmFuZC9jb3JlL3V2ZXJic19pb2N0bC5jOjI4MDogaWJfdXZlcmJzX2NtZF92ZXJicygpIHdhcm46 IHBvc3NpYmxlIG1lbW9yeSBsZWFrIG9mICdjdHgnDQo+ID4gZHJpdmVycy9pbmZpbmliYW5kL2Nv cmUvdXZlcmJzX2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WJfZGV2LA0KIAllcnIgPSB1dmVyYnNfaGFuZGxlX21ldGhvZChidWYsIGN0eC0+dWF0dHJz LCBoZHItPm51bV9hdHRycywgaWJfZGV2LA0KIAkJCQkgICBmaWxlLCBtZXRob2Rfc3BlYywgY3R4 LT51dmVyYnNfYXR0cl9idW5kbGUpOw0KIG91dDoNCi0jaWZkZWYgVVZFUkJTX09QVElNSVpFX1VT SU5HX1NUQUNLX1NaDQotCWlmIChjdHhfc2l6ZSA+IFVWRVJCU19PUFRJTUlaRV9VU0lOR19TVEFD S19TWikNCi0jZW5kaWYNCi0Ja2ZyZWUoY3R4KTsNCisJaWYgKGN0eCAhPSBkYXRhKQ0KKwkJa2Zy ZWUoY3R4KTsNCiAJcmV0dXJuIGVycjsNCiB9DQogDQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Shiraz Saleem
Reviewed-byRe: [PATCH 21/47] RDMA/i40iw: Fix a race condition
In reply to a message not in the archiveQuoted 5 lines · Bart Van Assche
Use the proper primitives to dereference the RCU pointer
upper_dev->ip_ptr. Compile-tested only.Signed-off-by Bart Van Assche <[email protected]>Cc Shiraz Saleem <[email protected]>
Thank you for this patch. Looks fine.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Shiraz Saleem
Reviewed-byRe: [PATCH 22/47] RDMA/i40iw: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 7 lines · Bart Van Assche
Avoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by Bart Van Assche <[email protected]>Cc Shiraz Saleem <[email protected]>---
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Shiraz Saleem
Reviewed-byRe: [PATCH 23/47] RDMA/i40iw: Remove a set-but-not-used variable
In reply to a message not in the archiveQuoted 3 lines · Bart Van Assche
Signed-off-by Bart Van Assche <[email protected]>Cc Shiraz Saleem <[email protected]>---
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 13/47] RDMA/cxgb4: Declare a local variable 'static'
In reply to Steve WiseT24gRnJpLCAyMDE3LTEwLTA2IGF0IDE3OjA5IC0wNTAwLCBTdGV2ZSBXaXNlIHdyb3RlOg0KPiA+ IA0KPiA+IFNpZ25lZC1vZmYtYnk6IEJhcnQgVmFuIEFzc2NoZSA8YmFydC52YW5hc3NjaGVAd2Rj LmNvbT4NCj4gPiBDYzogU3RldmUgV2lzZSA8c3dpc2VAb3BlbmdyaWRjb21wdXRpbmcuY29tPg0K PiA+IC0tLQ0KPiA+ICBkcml2ZXJzL2luZmluaWJhbmQvaHcvY3hnYjQvY20uYyB8IDIgKy0NCj4g PiAgMSBmaWxlIGNoYW5nZWQsIDEgaW5zZXJ0aW9uKCspLCAxIGRlbGV0aW9uKC0pDQo+ID4gDQo+ ID4gZGlmZiAtLWdpdCBhL2RyaXZlcnMvaW5maW5pYmFuZC9ody9jeGdiNC9jbS5jDQo+IA0KPiBi L2RyaXZlcnMvaW5maW5pYmFuZC9ody9jeGdiNC9jbS5jDQo+ID4gaW5kZXggMjMzMWU3ZDU3NzA0 Li40OWQ5ZjliODcwZTUgMTAwNjQ0DQo+ID4gLS0tIGEvZHJpdmVycy9pbmZpbmliYW5kL2h3L2N4 Z2I0L2NtLmMNCj4gPiArKysgYi9kcml2ZXJzL2luZmluaWJhbmQvaHcvY3hnYjQvY20uYw0KPiA+ IEBAIC05OSw3ICs5OSw3IEBAIG1vZHVsZV9wYXJhbShlbmFibGVfdGNwX3dpbmRvd19zY2FsaW5n LCBpbnQsIDA2NDQpOw0KPiA+ICBNT0RVTEVfUEFSTV9ERVNDKGVuYWJsZV90Y3Bfd2luZG93X3Nj YWxpbmcsDQo+ID4gIAkJICJFbmFibGUgdGNwIHdpbmRvdyBzY2FsaW5nIChkZWZhdWx0PTEpIik7 DQo+ID4gDQo+ID4gLWludCBjNGl3X2RlYnVnOw0KPiA+ICtzdGF0aWMgaW50IGM0aXdfZGVidWc7 DQo+ID4gIG1vZHVsZV9wYXJhbShjNGl3X2RlYnVnLCBpbnQsIDA2NDQpOw0KPiA+ICBNT0RVTEVf UEFSTV9ERVNDKGM0aXdfZGVidWcsICJvYnNvbGV0ZSIpOw0KPiANCj4gQ2FuIHdlIGp1c3QgcmVt b3ZlIHRoaXMgbm93PyAgSUUgaGFzIGl0IGJlZW4gMSByZWxlYXNlIHNpbmNlIGl0IHdhcyBvYnNv bGV0ZWQ/DQoNClRoYXQncyBhIGdvb2QgcXVlc3Rpb24gYnV0IEknbSBub3Qgc3VyZSB3aGF0IHdv dWxkIGJlIGEgZ29vZCB0aW1lIHRvIHJlbW92ZQ0KdGhpcy4gSSB0aGluayB0aGUgYW5zd2VyIGRl cGVuZHMgb24gaG93IGxpa2VseSBpdCBpcyB0aGF0IHBlb3BsZSB1c2UgdGhpcw0KdmFyaWFibGUg aW4gc2NyaXB0cyBvciAvZXRjL21vZHByb2JlLmQgY29uZmlndXJhdGlvbiBmaWxlcyBiZWNhdXNl IGluIHRoYXQNCmNhc2UgcmVtb3ZpbmcgdGhlIG1vZHVsZSBwYXJhbWV0ZXIgd291bGQgYnJlYWsg c2V0dXBzLg0KDQpCYXJ0Lg==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 13/47] RDMA/cxgb4: Declare a local variable 'static'
In reply to a message not in the archiveQuoted 25 lines · Bart Van Assche
Quoted 17 lines · Steve Wise
Review
Quoted 8 lines
Signed-off-by Bart Van Assche <[email protected]>Cc Steve Wise <[email protected]>--- drivers/infiniband/hw/cxgb4/cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/infiniband/hw/cxgb4/cm.cQuoted 7 lines
index
2331e7d57704..49d9f9b870e5100644drivers/infiniband/hw/cxgb4/cm.c +0
-0@@ -99,7 +99,7 @@ module_param(enable_tcp_window_scaling, int, 0644);MODULE_PARM_DESC (enable_tcp_window_scaling,"Enable tcp window scaling (default=1)" );Quoted 6 lines
drivers/infiniband/hw/cxgb4/cm.c module_param(enable_tcp_window_scaling, int, 0644); · line 104
Quoted 4 lines
drivers/infiniband/hw/cxgb4/cm.c +1
-1-int c4iw_debug; +static int c4iw_debug;module_param (c4iw_debug, int,0644 );MODULE_PARM_DESC (c4iw_debug,"obsolete" );Can we just remove this now? IE has it been 1 release since it was obsoleted?
Quoted 4 lines
That's a good question but I'm not sure what would be a good time to remove this. I think the answer depends on how likely it is that people use this variable in scripts or
/etc/modprobe.dconfiguration files because in that case removing the module parameter would break setups.
It is unlikely to happen, for many reasons. It is marked as obsolete for a long time, the proper infrastructure (dynamic prints) already for a decade with us and no adequate user is running debug system in production.
Another thing that we do remove visible to user interfaces from time to time and the rule is "try to remove it and see if someone screams about it".
There are a lot of commits which do such thing and latest one is 0d0c71b31720 ("btrfs: obsolete and remove mount option alloc_start")
It is safe to remove c4iw_debug module parameter.
Thanks
Quoted 2 lines
Bart.
Marciniszyn, Mike
Acked-byRE: [PATCH 41/47] IB/qib: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 6 lines
Subject: [PATCH 41/47] IB/qib: Suppress gcc 7 fall-through complaints
Avoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
Bart,
I'm ok with this but...
I'm curious if there is a documentation change in the kernel on a common tree wide approach for gcc 7.
I saw a patch to add the attribute based method of getting rid of the warning, but it doesn't appear to have been merged.
This error probably runs through all of our drivers.
Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Marciniszyn, Mike
Acked-byRE: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
In reply to a message not in the archiveQuoted 9 lines
Subject: [PATCH 40/47] IB/qib: Make
qib_inc_eeprom_err()macro more safe to useAvoid that using the
qib_inc_eeprom_err()macro in an if-statement triggers the following compiler warning:warning: suggest braces around empty body in an 'if' statement [-Wempty- body]
There needs to be a follow-on patch here to get rid of the uses of this macro.
The original fix got rid of a bad implementation, but should have totally removed both the function and its use.
The is not the fault of this patch.
Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 41/47] IB/qib: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveT24gVHVlLCAyMDE3LTEwLTEwIGF0IDEzOjU2ICswMDAwLCBNYXJjaW5pc3p5biwgTWlrZSB3cm90 ZToNCj4gPiBTdWJqZWN0OiBbUEFUQ0ggNDEvNDddIElCL3FpYjogU3VwcHJlc3MgZ2NjIDcgZmFs bC10aHJvdWdoIGNvbXBsYWludHMNCj4gPiANCj4gPiBBdm9pZCB0aGF0IGdjYyA3IHJlcG9ydHMg dGhlIGZvbGxvd2luZyB3YXJuaW5nIHdoZW4gYnVpbGRpbmcgd2l0aCBXPTE6DQo+ID4gDQo+ID4g d2FybmluZzogdGhpcyBzdGF0ZW1lbnQgbWF5IGZhbGwgdGhyb3VnaCBbLVdpbXBsaWNpdC1mYWxs dGhyb3VnaD1dDQo+IA0KPiBJJ20gb2sgd2l0aCB0aGlzIGJ1dC4uLg0KPiANCj4gSSdtIGN1cmlv dXMgaWYgdGhlcmUgaXMgYSBkb2N1bWVudGF0aW9uIGNoYW5nZSBpbiB0aGUga2VybmVsIG9uIGEg Y29tbW9uDQo+IHRyZWUgd2lkZSBhcHByb2FjaCBmb3IgZ2NjIDcuDQo+IA0KPiBJIHNhdyBhIHBh dGNoIHRvIGFkZCB0aGUgYXR0cmlidXRlIGJhc2VkIG1ldGhvZCBvZiBnZXR0aW5nIHJpZCBvZiB0 aGUgd2FybmluZywNCj4gYnV0IGl0IGRvZXNuJ3QgYXBwZWFyIHRvIGhhdmUgYmVlbiBtZXJnZWQu DQo+IA0KPiBUaGlzIGVycm9yIHByb2JhYmx5IHJ1bnMgdGhyb3VnaCBhbGwgb2Ygb3VyIGRyaXZl cnMuDQo+IA0KPiBBY2tlZC1ieTogTWlrZSBNYXJjaW5pc3p5biA8bWlrZS5tYXJjaW5pc3p5bkBp bnRlbC5jb20+DQoNCkhlbGxvIE1pa2UsDQoNClRoYW5rcyBmb3IgdGhlIHJldmlldy4gUmVnYXJk aW5nIHRoZSB0cmVlLXdpZGUgYXBwcm9hY2g6IHRoZXJlIGhhcyBhbHJlYWR5DQpiZWVuIGEgZGlz Y3Vzc2lvbiBhYm91dCB0aGlzIG9uIHZhcmlvdXMga2VybmVsLXJlbGF0ZWQgbWFpbGluZyBsaXN0 cy4gU2VlDQphbHNvIExpbnVzIFRvcnZhbGRzLCBMb3RzIG9mIG5ldyB3YXJuaW5ncyB3aXRoIGdj Yy03LjEuMSwgSnVseSAxMSwgMjAxNw0KKGh0dHBzOi8vd3d3Lm1haWwtYXJjaGl2ZS5jb20vbmV0 ZGV2QHZnZXIua2VybmVsLm9yZy9tc2cxNzc0NTkuaHRtbCkuIFRoZQ0KY29uY2x1c2lvbiB3YXMg dGhhdCBjZXJ0YWluIG9mIHRoZXNlIHdhcm5pbmdzIHNob3VsZCBiZSBzdXBwcmVzc2VkIGJ1dCB0 aGF0DQpvdGhlciB3YXJuaW5ncyBhcmUgdXNlZnVsIGFuZCBzaG91bGQgYmUgcmV0YWluZWQuIFNl ZSBhbHNvIGNvbW1pdA0KYmQ2NjRmNmIzZTM3ICgiZGlzYWJsZSBuZXcgZ2NjLTcuMS4xIHdhcm5p bmdzIGZvciBub3ciKS4NCg0KQmFydC4NCg==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 40/47] IB/qib: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SwNCg0KSG93IGFib3V0IGRyb3BwaW5nIHRoaXMgcGF0Y2ggYW5k IHJlcGxhY2luZyBpdCB3aXRoIGEgcGF0Y2ggdGhhdCByZW1vdmVzIGFsbCB1c2VzDQpvZiBxaWJf aW5jX2VlcHJvbV9lcnIoKT8NCg0KVGhhbmtzLA0KDQpCYXJ0Lg==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
In reply to a message not in the archivePiANCj4gSGVsbG8gTWlrZSwNCj4gDQo+IEhvdyBhYm91dCBkcm9wcGluZyB0aGlzIHBhdGNoIGFu ZCByZXBsYWNpbmcgaXQgd2l0aCBhIHBhdGNoIHRoYXQgcmVtb3ZlcyBhbGwNCj4gdXNlcw0KPiBv ZiBxaWJfaW5jX2VlcHJvbV9lcnIoKT8NCj4gDQoNCkknbSBmaW5lIHdpdGggdGhhdCB0b28uDQoN Ck1pa2UNCg==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 13/47] RDMA/cxgb4: Declare a local variable 'static'
In reply to a message not in the archiveT24gVHVlLCAyMDE3LTEwLTEwIGF0IDA2OjU5ICswMzAwLCBMZW9uIFJvbWFub3Zza3kgd3JvdGU6 DQo+IE9uIE1vbiwgT2N0IDA5LCAyMDE3IGF0IDExOjIwOjIwUE0gKzAwMDAsIEJhcnQgVmFuIEFz c2NoZSB3cm90ZToNCj4gPiBPbiBGcmksIDIwMTctMTAtMDYgYXQgMTc6MDkgLTA1MDAsIFN0ZXZl IFdpc2Ugd3JvdGU6DQo+ID4gPiBDYW4gd2UganVzdCByZW1vdmUgdGhpcyBub3c/ICBJRSBoYXMg aXQgYmVlbiAxIHJlbGVhc2Ugc2luY2UgaXQgd2FzIG9ic29sZXRlZD8NCj4gPiANCj4gPiBUaGF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XRlIGFuZCByZW1vdmUg bW91bnQgb3B0aW9uIGFsbG9jX3N0YXJ0IikNCj4gDQo+IEl0IGlzIHNhZmUgdG8gcmVtb3ZlIGM0 aXdfZGVidWcgbW9kdWxlIHBhcmFtZXRlci4NCg0KT0ssIEkgd2lsbCByZW1vdmUgdGhhdCBtb2R1 bGUgcGFyYW1ldGVyLg0KDQpCYXJ0Lg==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
In reply to a message not in the archiveT24gVHVlLCAyMDE3LTEwLTEwIGF0IDE1OjM2ICswMDAwLCBNYXJjaW5pc3p5biwgTWlrZSB3cm90 ZToNCj4gQmFydCB3cm90ZToNCj4gPiBIb3cgYWJvdXQgZHJvcHBpbmcgdGhpcyBwYXRjaCBhbmQg cmVwbGFjaW5nIGl0IHdpdGggYSBwYXRjaCB0aGF0IHJlbW92ZXMgYWxsDQo+ID4gdXNlcyBvZiBx aWJfaW5jX2VlcHJvbV9lcnIoKT8NCj4gDQo+IEknbSBmaW5lIHdpdGggdGhhdCB0b28uDQoNCkhv dyBhYm91dCB0aGUgcGF0Y2ggYmVsb3c/DQoNClRoYW5rcywNCg0KQmFydC4NCg0KDQpTdWJqZWN0 OiBbUEFUQ0hdIElCL3FpYjogUmVtb3ZlIHRoZSBxaWJfaW5jX2VlcHJvbV9lcnIoKSBtYWNybw0K DQpTaW5jZSB0aGUgYm9keSBvZiB0aGUgcWliX2luY19lZXByb21fZXJyKCkgbWFjcm8gaXMgZW1w dHksIHJlbW92ZQ0KdGhlIGludm9jYXRpb25zIG9mIHRoaXMgbWFjcm8uDQoNClJlZmVyZW5jZXM6 IGNvbW1pdCAxOGMwYjgyYTNlNDUgKCIgSUIvcWliOiBEbyBub3Qgd3JpdGUgRUVQUk9NIikNClNp Z25lZC1vZmYtYnk6IEJhcnQgVmFuIEFzc2NoZS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Agc3RhdGljIG5vaW5saW5lIHZvaWQgaGFuZGxlXzcz MjJfZXJyb3JzKHN0cnVjdCBxaWJfZGV2ZGF0YSAqZGQpDQogCWlmIChlcnJzICYgUUlCX0VfSEFS RFdBUkUpIHsNCiAJCSptc2cgPSAnXDAnOw0KIAkJcWliXzczMjJfaGFuZGxlX2h3ZXJyb3JzKGRk LCBtc2csIHNpemVvZihkZC0+Y3NwZWMtPmVtc2didWYpKTsNCi0JfSBlbHNlDQotCQlmb3IgKGxv Z19pZHggPSAwOyBsb2dfaWR4IDwgUUlCX0VFUF9MT0dfQ05UOyArK2xvZ19pZHgpDQotCQkJaWYg KGVycnMgJiBkZC0+ZWVwX3N0X21hc2tzW2xvZ19pZHhdLmVycnNfdG9fbG9nKQ0KLQkJCQlxaWJf aW5jX2VlcHJvbV9lcnIoZGQsIGxvZ19pZHgsIDEpOw0KKwl9DQogDQogCWlmIChlcnJzICYgUUlC X0VfU1BLVEVSUlMpIHsNCiAJCXFpYl9kaXNhcm1fNzMyMl9zZW5kZXJyYnVmcyhkZC0+cHBvcnQp Ow0K
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
In reply to a message not in the archiveQuoted 54 lines · Bart Van Assche
Quoted 5 lines · Mike
Quoted 2 lines · Bart
How about dropping this patch and replacing it with a patch that removes all uses of
qib_inc_eeprom_err()?I'm fine with that too.
How about the patch below?
Thanks,
Bart.
Subject: [PATCH] IB/qib: Remove the
qib_inc_eeprom_err()macroSince the body of the
qib_inc_eeprom_err()macro is empty, remove the invocations of this macro.References: commit
18c0b82a3e45(" IB/qib: Do not write EEPROM")Signed-off-by Bart Van Assche <[email protected]>Cc Mike Marciniszyn <[email protected]>--- drivers/infiniband/hw/qib/qib.h | 1 - drivers/infiniband/hw/qib/qib_iba6120.c | 11 ----------- drivers/infiniband/hw/qib/qib_iba7220.c | 10 ---------- drivers/infiniband/hw/qib/qib_iba7322.c | 6 +----- 4 files changed, 1 insertion(+), 27 deletions(-)drivers/infiniband/hw/qib/qib.h +0
-1@@ -1297,7 +1297,6 @@ int qib_twsi_blk_rd(struct qib_devdata *dd, int dev, int addr, void *buffer,int qib_twsi_blk_wr (struct qib_devdata *dd,int dev,int addr,const void *buffer,int len);void qib_get_eeprom_info (struct qib_devdata *); -#define qib_inc_eeprom_err (dd, eidx, incr)void qib_dump_lookup_output_queue (struct qib_devdata *);void qib_force_pio_avail_update (struct qib_devdata *);void qib_clear_symerror_on_linkup (unsigned long opaque);drivers/infiniband/hw/qib/qib_iba6120.c +0
-1@@ -748,7 +748,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,u32 bits, ctrl;int isfatal =0 ;char *bitsmsg; -int log_idx; hwerrs =qib_read_kreg64 (dd, kr_hwerrstatus);if (!hwerrs)
drivers/infiniband/hw/qib/qib_iba6120.c static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg, · line 775
Quoted 6 lines
drivers/infiniband/hw/qib/qib_iba6120.c +0
-3@@ -770,11 +769,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg, hwerrs &= dd->cspec->hwerrmask; -/* We log some errors to EEPROM, check if we have any of those. */ -for (log_idx =0 ; log_idx <QIB_EEP_LOG_CNT ; ++log_idx) -if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log)
Does it mean that you can get rid of eep_st_masks and QIB_EEP_LOG_CNT too?
Quoted 91 lines
drivers/infiniband/hw/qib/qib_iba6120.c +0
-7-qib_inc_eeprom_err (dd, log_idx,1 ); -/* * Make sure we get this much out, unless told to be quiet, * or it's occurred within the last 5 seconds. @@ -1004,7 +998,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)char *msg;u64 ignore_this_time =0 ;u64 iserr =0 ; -int log_idx;struct qib_pportdata *ppd = dd->pport;u64 mask;@@ -1015,10 +1008,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)/* do these first, they are most important */ if (errs &ERR_MASK (HardwareErr))qib_handle_6120_hwerrors (dd, msg,sizeof (dd->cspec->emsgbuf)); -else -for (log_idx =0 ; log_idx <QIB_EEP_LOG_CNT ; ++log_idx) -if (errs & dd->eep_st_masks[log_idx].errs_to_log) -qib_inc_eeprom_err (dd, log_idx,1 );if (errs & ~IB_E_BITSEXTANT ) qib_dev_err(dd,drivers/infiniband/hw/qib/qib_iba7220.c +0
-10@@ -1094,7 +1094,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)char *msg;u64 ignore_this_time =0 ;u64 iserr =0 ; -int log_idx;struct qib_pportdata *ppd = dd->pport;u64 mask;@@ -1105,10 +1104,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)/* do these first, they are most important */ if (errs &ERR_MASK (HardwareErr))qib_7220_handle_hwerrors (dd, msg,sizeof (dd->cspec->emsgbuf)); -else -for (log_idx =0 ; log_idx <QIB_EEP_LOG_CNT ; ++log_idx) -if (errs & dd->eep_st_masks[log_idx].errs_to_log) -qib_inc_eeprom_err (dd, log_idx,1 );if (errs &QLOGIC_IB_E_SDMAERRS )sdma_7220_errors (ppd, errs);@@ -1302,7 +1297,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,u32 bits, ctrl;int isfatal =0 ;char *bitsmsg; -int log_idx; hwerrs =qib_read_kreg64 (dd, kr_hwerrstatus);if (!hwerrs)@@ -1326,10 +1320,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg, hwerrs &= dd->cspec->hwerrmask; -/* We log some errors to EEPROM, check if we have any of those. */ -for (log_idx =0 ; log_idx <QIB_EEP_LOG_CNT ; ++log_idx) -if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log) -qib_inc_eeprom_err (dd, log_idx,1 );if (hwerrs & ~(TXEMEMPARITYERR_PIOBUF |TXEMEMPARITYERR_PIOPBC |RXE_PARITY )) qib_devinfo(dd->pcidev,drivers/infiniband/hw/qib/qib_iba7322.c +1
-5@@ -1644,7 +1644,6 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)u64 iserr =0 ;u64 errs;u64 mask; -int log_idx; qib_stats.sps_errints++; errs =qib_read_kreg64 (dd, kr_errstatus);@@ -1662,10 +1661,7 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)if (errs &QIB_E_HARDWARE ) { *msg ='\0' ;qib_7322_handle_hwerrors (dd, msg,sizeof (dd->cspec->emsgbuf)); - }else -for (log_idx =0 ; log_idx <QIB_EEP_LOG_CNT ; ++log_idx) -if (errs & dd->eep_st_masks[log_idx].errs_to_log) -qib_inc_eeprom_err (dd, log_idx,1 ); + }if (errs &QIB_E_SPKTERRS ) {qib_disarm_7322_senderrbufs (dd->pport);N?????r??y????b?X??ǧv?^?){.n?+????{??ٚ?{ay?ʇڙ?,j??f???h???z??w??????j:+v???w?j?m????????zZ+?????ݢj"??!
Re: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
In reply to a message not in the archiveT24gVHVlLCAyMDE3LTEwLTEwIGF0IDIxOjA4ICswMzAwLCBMZW9uIFJvbWFub3Zza3kgd3JvdGU6 DQo+IERvZXMgaXQgbWVhbiB0aGF0IHlvdSBjYW4gZ2V0IHJpZCBvZiBlZXBfc3RfbWFza3MgYW5k IFFJQl9FRVBfTE9HX0NOVCB0b28/DQoNCkkgdGhpbmsgc28uIEhlcmUgd2UgZ28gLi4uDQoNCg0K U3ViamVjdDogW1BBVENIXSBJQi9xaWI6IFJlbW92ZSByZW1haW5pbmcgY29kZSByZWxhdGVkIHRv IHdyaXRpbmcgdGhlIEVFUFJPTQ0KDQpEdWUgdG8gcmVtb3ZhbCBvZiB0aGUgRUVQUk9NIHdyaXRp bmcgY29kZSwgdGhlIHFpYl9pbmNfZWVwcm9tX2VycigpDQptYWNybyBiZWNhbWUgYSBuby1vcC4g UmVtb3ZlIHRoZSBjb2RlIHRoYXQgY2FsbHMgaX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ody9xaWIvcWliX2liYTczMjIuYw0KQEAg LTE2NDQsNyArMTY0NCw2IEBAIHN0YXRpYyBub2lubGluZSB2b2lkIGhhbmRsZV83MzIyX2Vycm9y cyhzdHJ1Y3QgcWliX2RldmRhdGEgKmRkKQ0KIAl1NjQgaXNlcnIgPSAwOw0KIAl1NjQgZXJyczsN CiAJdTY0IG1hc2s7DQotCWludCBsb2dfaWR4Ow0KIA0KIAlxaWJfc3RhdHMuc3BzX2VycmludHMr KzsNCiAJZXJycyA9IHFpYl9yZWFkX2tyZWc2NChkZCwga3JfZXJyc3RhdHVzKTsNCkBAIC0xNjYy LDEwICsxNjYxLDcgQEAgc3RhdGljIG5vaW5saW5lIHZvaWQgaGFuZGxlXzczMjJfZXJyb3JzKHN0 cnVjdCBxaWJfZGV2ZGF0YSAqZGQpDQogCWlmIChlcnJzICYgUUlCX0VfSEFSRFdBUkUpIHsNCiAJ CSptc2cgPSAnXDAnOw0KIAkJcWliXzczMjJfaGFuZGxlX2h3ZXJyb3JzKGRkLCBtc2csIHNpemVv ZihkZC0+Y3NwZWMtPmVtc2didWYpKTsNCi0JfSBlbHNlDQotCQlmb3IgKGxvZ19pZHggPSAwOyBs b2dfaWR4IDwgUUlCX0VFUF9MT0dfQ05UOyArK2xvZ19pZHgpDQotCQkJaWYgKGVycnMgJiBkZC0+ ZWVwX3N0X21hc2tzW2xvZ19pZHhdLmVycnNfdG9fbG9nKQ0KLQkJCQlxaWJfaW5jX2VlcHJvbV9l cnIoZGQsIGxvZ19pZHgsIDEpOw0KKwl9DQogDQogCWlmIChlcnJzICYgUUlCX0VfU1BLVEVSUlMp IHsNCiAJCXFpYl9kaXNhcm1fNzMyMl9zZW5kZXJyYnVmcyhkZC0+cHBvcnQpOw0KLS0gDQoyLjE0 LjINCg==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
In reply to a message not in the archiveQuoted 4 lines · Bart Van Assche
Quoted 1 line · Leon Romanovsky
Does it mean that you can get rid of
eep_st_masksandQIB_EEP_LOG_CNTtoo?I think so. Here we go ...
Thanks
Quoted 211 lines
Subject: [PATCH] IB/qib: Remove remaining code related to writing the EEPROM
Due to removal of the EEPROM writing code, the
qib_inc_eeprom_err()macro became a no-op. Remove the code that calls it. Since that change removes all code that reads theeep_st_masksarray, also remove the code that updates that array and the array itself.References: commit
18c0b82a3e45(" IB/qib: Do not write EEPROM")Signed-off-by Bart Van Assche <[email protected]>Cc Mike Marciniszyn <[email protected]>--- drivers/infiniband/hw/qib/qib.h | 18 ------------------ drivers/infiniband/hw/qib/qib_iba6120.c | 25 ------------------------- drivers/infiniband/hw/qib/qib_iba7220.c | 20 -------------------- drivers/infiniband/hw/qib/qib_iba7322.c | 6 +----- 4 files changed, 1 insertion(+), 68 deletions(-)drivers/infiniband/hw/qib/qib.h +0
-18@@ -101,18 +101,6 @@ extern const struct pci_error_handlers qib_pci_err_handler;*/ #define QIB_TRAFFIC_ACTIVE_THRESHOLD (2000) -/* -* Struct used to indicate which errors are logged in each of the -* error-counters that are logged to EEPROM. A counter is incremented -* _once_ (saturating at 255) for each event with any bits set in -* the error or hwerror register masks below. -*/ -#define QIB_EEP_LOG_CNT (4) -struct qib_eep_log_mask { -u64 errs_to_log; -u64 hwerrs_to_log; -}; -/* * Below contains all data related to a single context (formerly called port). */ @@ -1079,11 +1067,6 @@ struct qib_devdata {/* control high-level access to EEPROM */ struct mutex eep_lock;uint64_t traffic_wds; -/* -* masks for which bits of errs, hwerrs that cause -* each of the counters to increment. -*/ -struct qib_eep_log_mask eep_st_masks[QIB_EEP_LOG_CNT ];struct qib_diag_client *diag_client;spinlock_t qib_diag_trans_lock;/* protect diag observer ops */ struct diag_observer_list_elt *diag_observer_list;@@ -1297,7 +1280,6 @@ int qib_twsi_blk_rd(struct qib_devdata *dd, int dev, int addr, void *buffer,int qib_twsi_blk_wr (struct qib_devdata *dd,int dev,int addr,const void *buffer,int len);void qib_get_eeprom_info (struct qib_devdata *); -#define qib_inc_eeprom_err (dd, eidx, incr)void qib_dump_lookup_output_queue (struct qib_devdata *);void qib_force_pio_avail_update (struct qib_devdata *);void qib_clear_symerror_on_linkup (unsigned long opaque);drivers/infiniband/hw/qib/qib_iba6120.c +0
-25@@ -748,7 +748,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,u32 bits, ctrl;int isfatal =0 ;char *bitsmsg; -int log_idx; hwerrs =qib_read_kreg64 (dd, kr_hwerrstatus);if (!hwerrs)@@ -770,11 +769,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg, hwerrs &= dd->cspec->hwerrmask; -/* We log some errors to EEPROM, check if we have any of those. */ -for (log_idx =0 ; log_idx <QIB_EEP_LOG_CNT ; ++log_idx) -if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log) -qib_inc_eeprom_err (dd, log_idx,1 ); -/* * Make sure we get this much out, unless told to be quiet, * or it's occurred within the last 5 seconds. @@ -1004,7 +998,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)char *msg;u64 ignore_this_time =0 ;u64 iserr =0 ; -int log_idx;struct qib_pportdata *ppd = dd->pport;u64 mask;@@ -1015,10 +1008,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)/* do these first, they are most important */ if (errs &ERR_MASK (HardwareErr))qib_handle_6120_hwerrors (dd, msg,sizeof (dd->cspec->emsgbuf)); -else -for (log_idx =0 ; log_idx <QIB_EEP_LOG_CNT ; ++log_idx) -if (errs & dd->eep_st_masks[log_idx].errs_to_log) -qib_inc_eeprom_err (dd, log_idx,1 );if (errs & ~IB_E_BITSEXTANT ) qib_dev_err(dd,@@ -3227,20 +3216,6 @@ static int init_6120_variables(struct qib_devdata *dd)if (qib_unordered_wc ()) dd->flags |=QIB_PIO_FLUSH_WC ; -/* -* EEPROM error log 0 is TXE Parity errors. 1 is RXE Parity. -* 2 is Some Misc, 3 is reserved for future. -*/ - dd->eep_st_masks[0 ].hwerrs_to_log =HWE_MASK (TXEMemParityErr); - -/* Ignore errors in PIO/PBC on systems with unordered write-combining */ -if (qib_unordered_wc ()) - dd->eep_st_masks[0 ].hwerrs_to_log &= ~TXE_PIO_PARITY ; - - dd->eep_st_masks[1 ].hwerrs_to_log =HWE_MASK (RXEMemParityErr); - - dd->eep_st_masks[2 ].errs_to_log =ERR_MASK (ResetNegated); - ret =qib_init_pportdata (ppd, dd,0 ,1 );if (ret) goto bail;drivers/infiniband/hw/qib/qib_iba7220.c +0
-20@@ -1094,7 +1094,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)char *msg;u64 ignore_this_time =0 ;u64 iserr =0 ; -int log_idx;struct qib_pportdata *ppd = dd->pport;u64 mask;@@ -1105,10 +1104,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)/* do these first, they are most important */ if (errs &ERR_MASK (HardwareErr))qib_7220_handle_hwerrors (dd, msg,sizeof (dd->cspec->emsgbuf)); -else -for (log_idx =0 ; log_idx <QIB_EEP_LOG_CNT ; ++log_idx) -if (errs & dd->eep_st_masks[log_idx].errs_to_log) -qib_inc_eeprom_err (dd, log_idx,1 );if (errs &QLOGIC_IB_E_SDMAERRS )sdma_7220_errors (ppd, errs);@@ -1302,7 +1297,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,u32 bits, ctrl;int isfatal =0 ;char *bitsmsg; -int log_idx; hwerrs =qib_read_kreg64 (dd, kr_hwerrstatus);if (!hwerrs)@@ -1326,10 +1320,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg, hwerrs &= dd->cspec->hwerrmask; -/* We log some errors to EEPROM, check if we have any of those. */ -for (log_idx =0 ; log_idx <QIB_EEP_LOG_CNT ; ++log_idx) -if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log) -qib_inc_eeprom_err (dd, log_idx,1 );if (hwerrs & ~(TXEMEMPARITYERR_PIOBUF |TXEMEMPARITYERR_PIOPBC |RXE_PARITY )) qib_devinfo(dd->pcidev,@@ -4016,16 +4006,6 @@ static int qib_init_7220_variables(struct qib_devdata *dd) dd->flags |= qib_special_trigger ?QIB_USE_SPCL_TRIG :QIB_HAS_SEND_DMA ; -/* -* EEPROM error log 0 is TXE Parity errors. 1 is RXE Parity. -* 2 is Some Misc, 3 is reserved for future. -*/ - dd->eep_st_masks[0 ].hwerrs_to_log =HWE_MASK (TXEMemParityErr); - - dd->eep_st_masks[1 ].hwerrs_to_log =HWE_MASK (RXEMemParityErr); - - dd->eep_st_masks[2 ].errs_to_log =ERR_MASK (ResetNegated); -init_waitqueue_head (&cpspec->autoneg_wait);INIT_DELAYED_WORK (&cpspec->autoneg_work, autoneg_7220_work);drivers/infiniband/hw/qib/qib_iba7322.c +1
-6@@ -1644,7 +1644,6 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)u64 iserr =0 ;u64 errs;u64 mask; -int log_idx; qib_stats.sps_errints++; errs =qib_read_kreg64 (dd, kr_errstatus);@@ -1662,10 +1661,7 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)if (errs &QIB_E_HARDWARE ) { *msg ='\0' ;qib_7322_handle_hwerrors (dd, msg,sizeof (dd->cspec->emsgbuf)); - }else -for (log_idx =0 ; log_idx <QIB_EEP_LOG_CNT ; ++log_idx) -if (errs & dd->eep_st_masks[log_idx].errs_to_log) -qib_inc_eeprom_err (dd, log_idx,1 ); + }if (errs &QIB_E_SPKTERRS ) {qib_disarm_7322_senderrbufs (dd->pport); --2.14.2
Re: [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 16 lines · Bart Van Assche
Avoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by Bart Van Assche <[email protected]>Cc Sean Hefty <[email protected]>--- drivers/infiniband/core/cm.c | 1 + 1 file changed, 1 insertion(+)drivers/infiniband/core/cm.c +0
-0
drivers/infiniband/core/cm.c int ib_send_cm_mra(struct ib_cm_id *cm_id, · line 2814
Quoted 7 lines
drivers/infiniband/core/cm.c +1
-0@@ -2808,6 +2808,7 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id, msg_response =CM_MSG_RESPONSE_OTHER ;break ; } +/* fall through */ default : ret = -EINVAL ; goto error1;
So adding the comment is enough to make gcc shut up? Or are you just annotating the code so it's obvious it was intentional?
-Dennis
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints
In reply to a message not in the archivePiA+IGRpZmYgLS1naXQgYS9kcml2ZXJzL2luZmluaWJhbmQvY29yZS9jbS5jDQo+ID4gYi9kcml2 ZXJzL2luZmluaWJhbmQvY29yZS9jbS5jIGluZGV4IGQ4MDkxMWQ0YWJiNy4uNTkyN2VlNGU1N2Nh DQo+IDEwMDY0NA0KPiA+IC0tLSBhL2RyaXZlcnMvaW5maW5pYmFuZC9jb3JlL2NtLmMNCj4gPiAr KysgYi9kcml2ZXJzL2luZmluaWJhbmQvY29yZS9jbS5jDQo+ID4gQEAgLTI4MDgsNiArMjgwOCw3 IEBAIGludCBpYl9zZW5kX2NtX21yYShzdHJ1Y3QgaWJfY21faWQgKmNtX2lkLA0KPiA+ICAgCQkJ bXNnX3Jlc3BvbnNlID0gQ01fTVNHX1JFU1BPTlNFX09USEVSOw0KPiA+ICAgCQkJYnJlYWs7DQo+ ID4gICAJCX0NCj4gPiArCQkvKiBmYWxsIHRocm91Z2ggKi8NCj4gPiAgIAlkZWZhdWx0Og0KPiA+ ICAgCQlyZXQgPSAtRUlOVkFMOw0KPiA+ICAgCQlnb3RvIGVycm9yMTsNCj4gPg0KPiANCj4gU28g YWRkaW5nIHRoZSBjb21tZW50IGlzIGVub3VnaCB0byBtYWtlIGdjYyBzaHV0IHVwPyBPciBhcmUg eW91IGp1c3QNCj4gYW5ub3RhdGluZyB0aGUgY29kZSBzbyBpdCdzIG9idmlvdXMgaXQgd2FzIGlu dGVudGlvbmFsPw0KDQpnY2Mgd2lsbCBwcm9jZXNzIHRoZSBjb21tZW50IGFuZCBpdHMgaW50ZW50 DQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 11 lines · Dennis Dalessandro
Quoted 10 lines · Bart Van Assche
Avoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by Bart Van Assche <[email protected]>Cc Sean Hefty <[email protected]>--- drivers/infiniband/core/cm.c | 1 + 1 file changed, 1 insertion(+)
Quoted 16 lines
drivers/infiniband/core/cm.c int ib_send_cm_mra(struct ib_cm_id *cm_id, · line 2814
Quoted 13 lines
drivers/infiniband/core/cm.c +1
-0@@ -2808,6 +2808,7 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id, msg_response =CM_MSG_RESPONSE_OTHER ;break ; } +/* fall through */ default : ret = -EINVAL ; goto error1;So adding the comment is enough to make gcc shut up? Or are you just annotating the code so it's obvious it was intentional?
GCC is looking for the specific comment.
---
-Wimplicit-fallthrough warns when a switch case falls through.
This warning has five different levels. The compiler is able to parse a wide range of fallthrough comments, depending on the level. It also handles control-flow statements, such as ifs.
It's possible to suppress the warning by either adding a fallthrough comment,
or by using a null statement: __attribute__ ((fallthrough)); (C, C++),
or [[fallthrough]]; (C++17), or [[gnu::fallthrough]]; (C++11/C++14).
---
https://gcc.gnu.org/gcc-7/changes.html
Thanks
Quoted 6 lines
-Dennis
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/47] IB/cm: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 40 lines · Leon Romanovsky
Quoted 11 lines · Dennis Dalessandro
Quoted 10 lines · Bart Van Assche
Avoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by Bart Van Assche <[email protected]>Cc Sean Hefty <[email protected]>--- drivers/infiniband/core/cm.c | 1 + 1 file changed, 1 insertion(+)Quoted 16 lines
drivers/infiniband/core/cm.c int ib_send_cm_mra(struct ib_cm_id *cm_id, · line 2814
Quoted 13 lines
drivers/infiniband/core/cm.c +1
-0@@ -2808,6 +2808,7 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id, msg_response =CM_MSG_RESPONSE_OTHER ;break ; } +/* fall through */ default : ret = -EINVAL ; goto error1;So adding the comment is enough to make gcc shut up? Or are you just annotating the code so it's obvious it was intentional?
GCC is looking for the specific comment.
---
-Wimplicit-fallthrough warns when a switch case falls through.
This warning has five different levels. The compiler is able to parse a wide range of fallthrough comments, depending on the level. It also handles control-flow statements, such as ifs.
It's possible to suppress the warning by either adding a fallthrough comment,
or by using a null statement:__attribute__((fallthrough)); (C, C++),
or [[fallthrough]]; (C++17), or [[gnu::fallthrough]]; (C++11/C++14).
---
https://gcc.gnu.org/gcc-7/changes.html
Quoted 1 line
Thanks
Ah, makes sense now, thanks Leon.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Dennis Dalessandro
Reviewed-byRe: [PATCH 16/47] IB/hfi1: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 7 lines · Bart Van Assche
Avoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by Bart Van Assche <[email protected]>Cc Ira Weiny <[email protected]>Cc Dennis Dalessandro <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Dennis Dalessandro
Reviewed-byRe: [PATCH 43/47] RDMA/rdmavt: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 6 lines · Bart Van Assche
Avoid that gcc 7 reports the following warning when building with W=1:
warning: this statement may fall through [-Wimplicit-fallthrough=]
Signed-off-by Bart Van Assche <[email protected]>Cc Dennis Dalessandro <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 42/47] IB/qib: Remove set-but-not-used variables
In reply to a message not in the archiveQuoted 5 lines
Subject: [PATCH 42/47] IB/qib: Remove set-but-not-used variables
Signed-off-by Bart Van Assche <[email protected]>Cc Mike Marciniszyn <[email protected]>---
This one looks good!
I'm curious about the kbuild modificaitons to expose these issues.
Did you add them yourself, or are they now upstream?
Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 42/47] IB/qib: Remove set-but-not-used variables
In reply to a message not in the archiveT24gVHVlLCAyMDE3LTEwLTEwIGF0IDIwOjI1ICswMDAwLCBNYXJjaW5pc3p5biwgTWlrZSB3cm90 ZToNCj4gSSdtIGN1cmlvdXMgYWJvdXQgdGhlIGtidWlsZCBtb2RpZmljYWl0b25zIHRvIGV4cG9z ZSB0aGVzZSBpc3N1ZXMuDQo+IERpZCB5b3UgYWRkIHRoZW0geW91cnNlbGYsIG9yIGFyZSB0aGV5 IG5vdyB1cHN0cmVhbT8NCg0KSGVsbG8gTWlrZSwNCg0KVGhhbmtzIGZvciB0aGUgcmV2aWV3LiBJ cyB3aGF0IHlvdSB3b3VsZCBsaWtlIHRvIGtub3cgd2hhdCBidWlsZCBvcHRpb25zDQpJIHVzZWQg dG8gZW5hYmxlIHRoZSB3YXJuaW5ncyBhZGRyZXNzZWQgYnkgdGhpcyBwYXRjaCBzZXJpZXM/IFdo YXQgSSBkaWQNCmlzIHRvIGJ1aWxkIHRoZSBJQiBzdWJzeXN0ZW0gYXMgZm9sbG93czoNCg0KJCBm b3Igb3B0IGluICJXPTEiICJDPTIiICJDPTIgQ0hFQ0s9J3NtYXRjaCAtcD1rZXJuZWwnIjsgZG8g bWFrZSAtajUgTT1kcml2ZXJzL2luZmluaWJhbmQgJG9wdDsgZG9uZQ0KDQpJbnN0cnVjdGlvbnMg Zm9yIGhvdyB0byBkb3dubG9hZCB0aGUgc291cmNlIGNvZGUgb2Ygc3BhcnNlIGFuZCBzbWF0Y2gg YXJlDQphdmFpbGFibGUgYXQ6DQoqIGh0dHBzOi8vc3BhcnNlLndpa2kua2VybmVsLm9yZy9pbmRl eC5waHAvTWFpbl9QYWdlDQoqIGh0dHA6Ly9zbWF0Y2guc291cmNlZm9yZ2UubmV0Lw0KDQpCYXJ0 Lg==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use
In reply to a message not in the archivePiANCj4gU3ViamVjdDogW1BBVENIXSBJQi9xaWI6IFJlbW92ZSByZW1haW5pbmcgY29kZSByZWxh dGVkIHRvIHdyaXRpbmcgdGhlDQo+IEVFUFJPTQ0KPiANCg0KR28gYWhlYWQgYW5kIHN1Ym1pdCBh IHYyLg0KDQpJIHdpbGwgZ3JhYiBpdCBmcm9tIHBhdGNod29ya3MgYW5kIHRlc3QuDQoNCk1pa2UN Cg==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
In reply to a message not in the archiveQuoted 75 lines · Bart Van Assche
Quoted 45 lines · Matan Barak (External)
Quoted 44 lines · Bart Van Assche
This patch reduces the number of #ifdefs and also avoids that smatch reports the following:
drivers/infiniband/core/uverbs_ioctl.c:276:ib_uverbs_cmd_verbs()warn: if statement not indenteddrivers/infiniband/core/uverbs_ioctl.c:280:ib_uverbs_cmd_verbs()warn: possible memory leak of 'ctx'drivers/infiniband/core/uverbs_ioctl.c:315:ib_uverbs_cmd_verbs()warn: if statement not indentedReferences: commit
fac9658cabb9("IB/core: Add new ioctl interface")Signed-off-by Bart Van Assche <[email protected]>Cc Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/[email protected]>Cc Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/[email protected]>--- drivers/infiniband/core/uverbs_ioctl.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)drivers/infiniband/core/uverbs_ioctl.c +5
-2@@ -234,7 +234,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,const struct uverbs_method_spec *method_spec;long err =0 ;unsigned int i; -struct { +struct attr_and_bundle {struct ib_uverbs_attr *uattrs;struct uverbs_attr_bundle *uverbs_attr_bundle; } *ctx =NULL ;@@ -242,7 +242,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,unsigned long *curr_bitmap;size_t ctx_size;#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ -uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ /sizeof (uintptr_t )]; +uintptr_t __data[UVERBS_OPTIMIZE_USING_STACK_SZ /sizeof (uintptr_t )]; +struct attr_and_bundle *const data = (void *)__data; +#else +struct attr_and_bundle *const data =NULL ;#endif if (hdr->reserved)@@ -269,13 +272,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, (method_spec->num_child_attrs /BITS_PER_LONG + method_spec->num_buckets);Quoted 5 lines
drivers/infiniband/core/uverbs_ioctl.c static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, · line 275
Quoted 2 lines
drivers/infiniband/core/uverbs_ioctl.c +0
-1-#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ if (ctx_size <=UVERBS_OPTIMIZE_USING_STACK_SZ )If
UVERBS_OPTIMIZE_USING_STACK_SZisn't defined, you'll get an error here. Maybe we could define it as 0 in the else part of the local variables deceleration.Hello Matan,
That's an interesting suggestion but that wouldn't work well with the "#ifdef
UVERBS_OPTIMIZE_USING_STACK_SZ" code in the declaration section. How about changing "if (ctx_size<=UVERBS_OPTIMIZE_USING_STACK_SZ) ctx = data;" into "ctx = data;" such that it becomes again safe not to defineUVERBS_OPTIMIZE_USING_STACK_SZ? With that change this patch looks as follows:drivers/infiniband/core/uverbs_ioctl.c +1
-1@@ -234,7 +234,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,const struct uverbs_method_spec *method_spec;long err =0 ;unsigned int i; -struct { +struct attr_and_bundle {struct ib_uverbs_attr *uattrs;struct uverbs_attr_bundle *uverbs_attr_bundle; } *ctx =NULL ;
drivers/infiniband/core/uverbs_ioctl.c static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, · line 248
Quoted 8 lines
drivers/infiniband/core/uverbs_ioctl.c +4
-1@@ -242,7 +242,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,unsigned long *curr_bitmap;size_t ctx_size;#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ -uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ /sizeof (uintptr_t )]; +uintptr_t __data[UVERBS_OPTIMIZE_USING_STACK_SZ /sizeof (uintptr_t )]; +struct attr_and_bundle *const data = (void *)__data; +#else +struct attr_and_bundle *const data =NULL ;
I meant to define that macro here:
#define UVERBS_OPTIMIZE_USING_STACK_SZ 0
Quoted 6 lines
drivers/infiniband/core/uverbs_ioctl.c +0
-0#endif if (hdr->reserved)@@ -269,13 +272,9 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, (method_spec->num_child_attrs /BITS_PER_LONG + method_spec->num_buckets);
drivers/infiniband/core/uverbs_ioctl.c static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, · line 277
Quoted 10 lines
drivers/infiniband/core/uverbs_ioctl.c +2
-6-#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ -if (ctx_size <=UVERBS_OPTIMIZE_USING_STACK_SZ ) - ctx = (void *)data; - + ctx = data;if (!ctx) -#endif - ctx =kmalloc (ctx_size,GFP_KERNEL ); + ctx =kmalloc (ctx_size,GFP_KERNEL );
But what about cases where UVERBS_OPTIMIZE_USING_STACK_SZ is defined but is insufficient in size?
In the suggestion I posted above, I meant:
/* Here UVERBS_OPTIMIZE_USING_STACK_SZ is always defined */ if (ctx_size <= UVERBS_OPTIMIZE_USING_STACK_SZ)
ctx = data; if (!ctx) ctx = kmalloc(ctx_size, GFP_KERNEL);
The last hunk (free part) stays the same.
Quoted 7 lines
drivers/infiniband/core/uverbs_ioctl.c +0
-0if (!ctx)return -ENOMEM ;@@ -311,10 +310,8 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, err =uverbs_handle_method (buf, ctx->uattrs, hdr->num_attrs, ib_dev, file, method_spec, ctx->uverbs_attr_bundle);
drivers/infiniband/core/uverbs_ioctl.c static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, · line 317
Quoted 10 lines
drivers/infiniband/core/uverbs_ioctl.c +2
-4out: -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ - if (ctx_size > UVERBS_OPTIMIZE_USING_STACK_SZ) -#endif -kfree (ctx); +if (ctx != data) +kfree (ctx);return err; }
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Sagi Grimberg
Acked-byRe: [PATCH 06/47] RDMA/isert: Suppress gcc 7 fall-through complaints
In reply to a message not in the archive--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Dennis Dalessandro
Reviewed-byRe: [PATCH 17/47] IB/hfi1: Remove set-but-not-used variables
In reply to a message not in the archiveQuoted 13 lines · Bart Van Assche
drivers/infiniband/hw/hfi1/mad.c +0
-1@@ -2889,7 +2889,6 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp,struct _vls_dctrs *vlinfo;size_t response_data_size;u32 num_ports; -u8 num_pslm;u8 lq, num_vls;u8 res_lli, res_ler;u64 port_mask;
drivers/infiniband/hw/hfi1/mad.c static int pma_get_opa_datacounters(struct opa_pma_mad *pmp, · line 2902
Quoted 4 lines
drivers/infiniband/hw/hfi1/mad.c +0
-1@@ -2899,7 +2898,6 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp,int vfi; num_ports =be32_to_cpu (pmp->mad_hdr.attr_mod) >>24 ; - num_pslm =hweight64 (be64_to_cpu (req->port_select_mask[3 ]));
I need to figure out why we don't check num_pslm here like we do in every other instance. This may be a bug. I'm fine removing this for now, since it clearly doesn't hurt, and we will add it back later with the check if needed.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Dennis Dalessandro
Reviewed-byRe: [PATCH 18/47] IB/hfi1: Define hfi1_handle_cnp_tbl[] once
In reply to a message not in the archiveQuoted 1 line · Bart Van Assche
This patch does not change any functionality.
Greg K-H would probably tell you that you need to be more descriptive in the commit message.
Quoted 3 lines
Signed-off-by Bart Van Assche <[email protected]>Cc Ira Weiny <[email protected]>Cc Dennis Dalessandro <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 35/47] IB/opa: Fix endianness annotation of opa_is_extended_lid()
In reply to a message not in the archiveQuoted 16 lines · Bart Van Assche
This patch does not change any functionality.
Fixes commit e92aa00a5189 ("IB/CM: Add OPA Path record support to CM")Signed-off-by Bart Van Assche <[email protected]>Cc Dennis Dalessandro <[email protected]>Cc Niranjana Vishwanathapura <niranjana.vishwanathapura-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>--- include/rdma/opa_addr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/rdma/opa_addr.h +0
-0
include/rdma/opa_addr.h static inline u32 opa_get_lid_from_gid(const union ib_gid *gid) · line 103
Quoted 8 lines
include/rdma/opa_addr.h +1
-1@@ -97,7 +97,7 @@ static inline u32 opa_get_lid_from_gid(const union ib_gid *gid)* @dlid: The DLID * @slid: The SLID */ -static inline bool opa_is_extended_lid (u32 dlid,u32 slid) +static inline bool opa_is_extended_lid (__be32 dlid,__be32 slid) { if ((be32_to_cpu(dlid) >= be16_to_cpu(IB_MULTICAST_LID_BASE)) ||
Doug already has taken a patch for this, it is in his for-next branch:
a917374e8a20 ("IB/core: Use __be32 for LIDs in opa_is_extended_lid").
-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 17 lines · Doug Ledford
Quoted 15 lines · Bart Van Assche
Hello Doug,
As we all know there are several static analysis tools available for the Linux
kernel and these tools are valuable. I'm referring to increasing the gcc
warning level (W=1), sparse and smatch. It is helpful to analyze new code with
these tools before submitting a patch. These tools are most useful if existing
code is clean. Hence this patch series that significantly reduces the number
of complaints reported by static analysis tools. Please consider this patch
series for kernel v4.15.
Quoted 5 lines
The series looks pretty good Bart. I'd like some Intel eyes on the hfi1 changes, and I'd like some people to report back that the rcu changes in their code are good, and the Cc: Signed-off-by: mistakes in the
hns_roceparts needs fixed. Then I'll be ready to take it. Thanks for all the work here.
Thanks for the hard work here Bart! I know all of us driver maintainers appreciate your helping to clean up our mess :) and you might have even uncovered a bug in our driver so double thanks!
The only problem is the one patch isn't needed because I just submitted a patch last week for the same thing and Doug has already pulled it into his for-next.
-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
T24gV2VkLCAyMDE3LTEwLTExIGF0IDEwOjAzIC0wNDAwLCBEZW5uaXMgRGFsZXNzYW5kcm8gd3Jv dGU6DQo+IFRoZSBvbmx5IHByb2JsZW0gaXMgdGhlIG9uZSBwYXRjaCBpc24ndCBuZWVkZWQgYmVj YXVzZSBJIGp1c3Qgc3VibWl0dGVkIA0KPiBhIHBhdGNoIGxhc3Qgd2VlayBmb3IgdGhlIHNhbWUg dGhpbmcgYW5kIERvdWcgaGFzIGFscmVhZHkgcHVsbGVkIGl0IGludG8gDQo+IGhpcyBmb3ItbmV4 dC4NCg0KSGVsbG8gRGVubmlzLA0KDQpUaGF0J3MgZmluZS4gSSB3aWxsIHJlYmFzZSBhbmQgcmV0 ZXN0IHRoaXMgcGF0Y2ggc2VyaWVzIGFueXdheSBiZWZvcmUgSQ0KcmVwb3N0IHRoaXMgc2VyaWVz Lg0KDQpCYXJ0Lg==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
In reply to a message not in the archiveT24gV2VkLCAyMDE3LTEwLTExIGF0IDA4OjE5ICswMzAwLCBNYXRhbiBCYXJhayB3cm90ZToNCj4g QnV0IHdoYXQgYWJvdXQgY2FzZXMgd2hlcmUgVVZFUkJTX09QVElNSVpFX1VTSU5HX1NUQUNLX1Na IGlzIGRlZmluZWQgYnV0IA0KPiBpcyBpbnN1ZmZpY2llbnQgaW4gc2l6ZT8NCg0KU29ycnkuIEhv dyBhYm91dCB0aGUgcGF0Y2ggYmVsb3c/IFRoZSBtb3N0IHNpZ25pZmljYW50IGNoYW5nZSBjb21w YXJlZCB0byB0aGUNCmN1cnJlbnQgY29kZSBpcyB0aGF0IFVWRVJCU19PUFRJTUlaRV9VU0lOR19T VEFDS19TWiBoYXMgdG8gYmUgZGVmaW5lZCBhcyAwDQppbnN0ZWFkIG9mIG5vdCBkZWZpbmluZyB0 aGF0IG1hY3JvIHRvIGRpc2FibGUgdGhlIG9wdGltaXphdGlvbi4gQSBuZXcgY2hhbmdlDQppcyB0 aGF0IHRoaXMgdmVyc2lvbiB1c2VzIGdjYydzIHN1cHBvcnQgZm9yIHplcm8tbGVuZ3R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19QRVJfTE9ORyAr DQogCQkJIG1ldGhvZF9zcGVjLT5udW1fYnVja2V0cyk7DQogDQotI2lmZGVmIFVWRVJCU19PUFRJ TUlaRV9VU0lOR19TVEFDS19TWg0KIAlpZiAoY3R4X3NpemUgPD0gVVZFUkJTX09QVElNSVpFX1VT SU5HX1NUQUNLX1NaKQ0KIAkJY3R4ID0gKHZvaWQgKilkYXRhOw0KLQ0KIAlpZiAoIWN0eCkNCi0j ZW5kaWYNCi0JY3R4ID0ga21hbGxvYyhjdHhfc2l6ZSwgR0ZQX0tFUk5FTCk7DQorCQljdHggPSBr bWFsbG9jKGN0eF9zaXplLCBHRlBfS0VSTkVMKTsNCiAJaWYgKCFjdHgpDQogCQlyZXR1cm4gLUVO T01FTTsNCiANCkBAIC0zMTEsMTAgKzMwNiw4IEBAIHN0YXRpYyBsb25nIGliX3V2ZXJic19jbWRf dmVyYnMoc3RydWN0IGliX2RldmljZSAqaWJfZGV2LA0KIAllcnIgPSB1dmVyYnNfaGFuZGxlX21l dGhvZChidWYsIGN0eC0+dWF0dHJzLCBoZHItPm51bV9hdHRycywgaWJfZGV2LA0KIAkJCQkgICBm aWxlLCBtZXRob2Rfc3BlYywgY3R4LT51dmVyYnNfYXR0cl9idW5kbGUpOw0KIG91dDoNCi0jaWZk ZWYgVVZFUkJTX09QVElNSVpFX1VTSU5HX1NUQUNLX1NaDQotCWlmIChjdHhfc2l6ZSA+IFVWRVJC U19PUFRJTUlaRV9VU0lOR19TVEFDS19TWikNCi0jZW5kaWYNCi0Ja2ZyZWUoY3R4KTsNCisJaWYg KGN0eCAhPSAodm9pZCAqKWRhdGEpDQorCQlrZnJlZShjdHgpOw0KIAlyZXR1cm4gZXJyOw0KIH0N CiANCi0tIA0KMi4xNC4yDQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 42/47] IB/qib: Remove set-but-not-used variables
In reply to a message not in the archiveQuoted 4 lines · Bart Van Assche
Quoted 2 lines · Mike
I'm curious about the kbuild modificaitons to expose these issues. Did you add them yourself, or are they now upstream?
Quoted 8 lines
Hello Mike,
Thanks for the review. Is what you would like to know what build options I used to enable the warnings addressed by this patch series? What I did is to build the IB subsystem as follows:
$ for opt in "W=1" "C=2" "C=2 CHECK='smatch -p=kernel'"; do make -j5 M=drivers/infiniband $opt; done
Bart,
I'm running more or less the same checks ( + "CHECK=sparse C=2") and for a long time I'm trying to fix nes and orcdma endianess errors, but without much luck. Did you look on them and plan to address in near future?
Thanks
Quoted 6 lines
Instructions for how to download the source code of sparse and smatch are available at:
* https://sparse.wiki.kernel.org/index.php/Main_Page
* http://smatch.sourceforge.net/Bart.
Re: [PATCH 42/47] IB/qib: Remove set-but-not-used variables
In reply to a message not in the archiveT24gVGh1LCAyMDE3LTEwLTEyIGF0IDExOjQ0ICswMzAwLCBMZW9uIFJvbWFub3Zza3kgd3JvdGU6 DQo+IEknbSBydW5uaW5nIG1vcmUgb3IgbGVzcyB0aGUgc2FtZSBjaGVja3MgKCArICJDSEVDSz1z cGFyc2UgQz0yIikgYW5kIGZvcg0KPiBhIGxvbmcgdGltZSBJJ20gdHJ5aW5nIHRvIGZpeCBuZXMg YW5kIG9yY2RtYSBlbmRpYW5lc3MgZXJyb3JzLCBidXQNCj4gd2l0aG91dCBtdWNoIGx1Y2suIERp ZCB5b3UgbG9vayBvbiB0aGVtIGFuZCBwbGFuIHRvIGFkZHJlc3MgaW4gbmVhcg0KPiBmdXR1cmU/ DQoNCkhlbGxvIExlb24sDQoNCk15IGV4cGVyaWVuY2UgaXMgdGhhdCBmb3Igc29tZSBkcml2ZXJz LCBlLmcuIGRyaXZlcnMvc2NzaS9xbGEyeHh4LCBtYWtpbmcNCnRoZXNlIGVuZGlhbm5lc3MgY2xl YW4gaXMgYSBodWdlIHRhc2suIEkgcHJlZmVyIHRoYXQgdGhlIGRyaXZlciBhdXRob3JzIHdvcmsN Cm9uIHRoaXMuIEkgaGF2ZSBiZWVuIHVzaW5nIHRoZSBmb2xsb3dpbmcgcGF0Y2ggdG8gc3VwcHJl c3MgY29tcGxhaW50cyBhYm91dA0KZW5kaWFubmVzcyBpc3N1ZXMgZm9yIGRyaXZlcnMgdGhhdCBh cmUgbm90IGVuZGlhbm5lc3MgY2xlYW46DQpodHRwczovL2xrbWwub3JnL2xrbWwvMjAxNy8xMC82 LzYzOC4NCg0KQmFydC4NCg==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 42/47] IB/qib: Remove set-but-not-used variables
In reply to a message not in the archiveQuoted 6 lines · Bart Van Assche
Quoted 4 lines · Leon Romanovsky
I'm running more or less the same checks ( + "CHECK=sparse C=2") and for a long time I'm trying to fix nes and orcdma endianess errors, but without much luck. Did you look on them and plan to address in near future?
Quoted 7 lines
Hello Leon,
My experience is that for some drivers, e.g.
drivers/scsi/qla2xxx, making these endianness clean is a huge task. I prefer that the driver authors work on this. I have been using the following patch to suppress complaints about endianness issues for drivers that are not endianness clean:
https://lkml.org/lkml/2017/10/6/638.
Thanks, I'll try your approach.
Quoted 2 lines
Bart.
Matan Barak
Acked-byRe: [PATCH 05/47] RDMA/uverbs: Make the code in ib_uverbs_cmd_verbs() less confusing
In reply to a message not in the archiveQuoted 62 lines · Bart Van Assche
Quoted 2 lines · Matan Barak
But what about cases where
UVERBS_OPTIMIZE_USING_STACK_SZis defined but is insufficient in size?Sorry. How about the patch below? The most significant change compared to the current code is that
UVERBS_OPTIMIZE_USING_STACK_SZhas to be defined as 0 instead of not defining that macro to disable the optimization. A new change is that this version uses gcc's support for zero-length arrays (which is an extension of the C standard and is already used elsewhere in the kernel).Subject: [PATCH] RDMA/uverbs: Make the code in
ib_uverbs_cmd_verbs()less
confusingThis patch reduces the number of #ifdefs and also avoids that smatch reports the following:
drivers/infiniband/core/uverbs_ioctl.c:276:ib_uverbs_cmd_verbs()warn: if statement not indenteddrivers/infiniband/core/uverbs_ioctl.c:280:ib_uverbs_cmd_verbs()warn: possible memory leak of 'ctx'drivers/infiniband/core/uverbs_ioctl.c:315:ib_uverbs_cmd_verbs()warn: if statement not indentedReferences: commit
fac9658cabb9("IB/core: Add new ioctl interface")Signed-off-by Bart Van Assche <[email protected]>Cc Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/[email protected]>Cc Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/[email protected]>--- drivers/infiniband/core/uverbs_ioctl.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)drivers/infiniband/core/uverbs_ioctl.c +1
-6@@ -241,9 +241,7 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,struct uverbs_attr *curr_attr;unsigned long *curr_bitmap;size_t ctx_size; -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ /sizeof (uintptr_t )]; -#endif if (hdr->reserved)return -EINVAL ;@@ -269,13 +267,10 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, (method_spec->num_child_attrs /BITS_PER_LONG + method_spec->num_buckets); -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ if (ctx_size <=UVERBS_OPTIMIZE_USING_STACK_SZ ) ctx = (void *)data; -if (!ctx) -#endif - ctx =kmalloc (ctx_size,GFP_KERNEL ); + ctx =kmalloc (ctx_size,GFP_KERNEL );if (!ctx)return -ENOMEM ;@@ -311,10 +306,8 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, err =uverbs_handle_method (buf, ctx->uattrs, hdr->num_attrs, ib_dev, file, method_spec, ctx->uverbs_attr_bundle);
drivers/infiniband/core/uverbs_ioctl.c static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev, · line 313
Quoted 10 lines
drivers/infiniband/core/uverbs_ioctl.c +2
-4out: -#ifdef UVERBS_OPTIMIZE_USING_STACK_SZ - if (ctx_size > UVERBS_OPTIMIZE_USING_STACK_SZ) -#endif -kfree (ctx); +if (ctx != (void *)data) +kfree (ctx);return err; }
Simple and looks good to me. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html