Address issues detected by static analysis tools
Subsystems (15)
v2 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.
Changes compared to v1:
- Replaced the patch that modified a qib macro by a patch that removes that macro and the code that uses it.
- Removed the c4iw_debug kernel module parameter instead of declaring the c4iw_debug variable static.
- Left out the uverbs patch since it is still under discussion.
- Left out a patch for include/rdma/opa_addr.h because an alternative patch went into Doug's tree very recently.
- Added Reviewed-by tags for the patches that got a positive review.
Bart Van Assche (45):
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/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: Remove the obsolete kernel module option 'c4iw_debug' 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 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: Remove remaining code related to writing the EEPROM 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/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 | 16 ++---- 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 | 7 +-- drivers/infiniband/hw/nes/nes_nic.c | 9 ++-- 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 | 18 ------- drivers/infiniband/hw/qib/qib_diag.c | 6 --- drivers/infiniband/hw/qib/qib_file_ops.c | 9 ---- drivers/infiniband/hw/qib/qib_iba6120.c | 27 ---------- drivers/infiniband/hw/qib/qib_iba7220.c | 23 --------- drivers/infiniband/hw/qib/qib_iba7322.c | 21 ++------ 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 +- 68 files changed, 241 insertions(+), 369 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 v2 1/45 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 v2 2/45 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
@@ -2810,6 +2810,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 v2 3/45 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 v2 4/45 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 v2 5/45 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 v2 6/45 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 v2 7/45 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 v2 8/45 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 v2 9/45 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 v2 10/45 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 v2 11/45 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 v2 12/45 RDMA/cxgb4: Remove the obsolete kernel module option 'c4iw_debug'
In reply to a message not in the archiveThis patch avoids that building the cxgb4 module with W=1 triggers a complaint about a local variable that has not been declared static.
--- drivers/infiniband/hw/cxgb4/cm.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/infiniband/hw/cxgb4/cm.c +0 -4
@@ -99,10 +99,6 @@ module_param(enable_tcp_window_scaling, int, 0644);MODULE_PARM_DESC (enable_tcp_window_scaling,"Enable tcp window scaling (default=1)" ); -int c4iw_debug; -module_param (c4iw_debug, int,0644 ); -MODULE_PARM_DESC (c4iw_debug,"obsolete" ); -static int peer2peer =1 ;module_param (peer2peer, int,0644 );MODULE_PARM_DESC (peer2peer,"Support peer2peer ULPs (default=1)" );
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 v2 13/45 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
@@ -3638,6 +3638,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 v2 14/45 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
@@ -3877,7 +3877,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 */
@@ -3959,14 +3958,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 v2 15/45 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 v2 16/45 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 v2 17/45 IB/hfi1: Define hfi1_handle_cnp_tbl[] once
In reply to a message not in the archiveMove the hfi1_handle_cnp_tbl[] from a header file to a .c file such that only one copy ends up in the hfi1 kernel module. This 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
@@ -1538,11 +1538,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 v2 18/45 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 v2 19/45 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 v2 20/45 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 v2 21/45 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
@@ -2410,6 +2410,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 v2 22/45 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;
@@ -1270,7 +1269,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;if (!cm_node->ack_rcvd) {atomic_inc (&send_entry->sqbuf->refcount);
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 v2 23/45 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 v2 24/45 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 v2 25/45 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 v2 26/45 IB/mlx5: Remove a set-but-not-used variable
In reply to a message not in the archiveReferences: commit 5fe9dec0d045 ("IB/mlx5: Use blue flame register allocator in mlx5_ib")
--- 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 v2 27/45 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 | 5 +++-- drivers/infiniband/hw/nes/nes_nic.c | 9 ++++----- 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 +3 -2
@@ -1861,8 +1861,9 @@ 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 +4 -5
@@ -926,11 +926,10 @@ 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 v2 28/45 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
@@ -3632,7 +3632,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 v2 29/45 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 v2 30/45 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 v2 31/45 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 v2 32/45 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 v2 33/45 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 v2 34/45 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 v2 35/45 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 v2 36/45 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 v2 37/45 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 v2 38/45 IB/qib: Remove remaining code related to writing the EEPROM
In reply to a message not in the archiveDue 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 the eep_st_masks array, also remove the code that updates that array and the array itself.
References: commit 18c0b82a3e45 ("IB/qib: Do not write EEPROM")
--- 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 -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);
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 v2 39/45 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 v2 40/45 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
@@ -1903,7 +1903,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 ;
@@ -1927,7 +1926,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
@@ -3514,7 +3514,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;
@@ -3522,8 +3521,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
@@ -3431,7 +3431,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 ;
@@ -3502,8 +3501,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,
@@ -5358,16 +5357,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
@@ -7807,13 +7801,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 v2 41/45 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 v2 42/45 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 v2 43/45 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 v2 44/45 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 v2 45/45 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
Steve Wise
Acked-byRE: [PATCH v2 12/45] RDMA/cxgb4: Remove the obsolete kernel module option 'c4iw_debug'
In reply to a message not in the archiveQuoted 6 lines
This patch avoids that building the cxgb4 module with W=1 triggers a complaint about a local variable that has not been declared static.
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
Latif, Faisal
Acked-by Faisal LatifRE: [PATCH v2 28/45] IB/nes: Suppress gcc 7 fall-through complaints
In reply to a message not in the archiveQuoted 46 lines
-----Original Message-----
From: Bart Van Assche [mailto:[email protected]]
Sent: Wednesday, October 11, 2017 12:49 PM
To: Doug Ledford <[email protected]>
Cc: [email protected]; Bart Van Assche <[email protected]>; Latif, Faisal <[email protected]>
Subject: [PATCH v2 28/45] IB/nes: Suppress gcc 7 fall-through complaintsAvoid 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 Faisal Latif <[email protected]>---
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); diff --git
a/drivers/infiniband/hw/nes/nes_hw.cb/drivers/infiniband/hw/nes/nes_hw.cindex812b59d8f13c..c392f83c0629100644drivers/infiniband/hw/nes/nes_hw.c +1
-1@@ -3632,7 +3632,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 */
Quoted 6 lines
case
NES_AEQE_AEID_RDMAP_ROE_BAD_LLP_CLOSE:
caseNES_AEQE_AEID_LLP_TOO_MANY_RETRIES:
caseNES_AEQE_AEID_DDP_UBE_INVALID_MSN_NO_BUFFER_AVAILABLE:
--
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
Latif, Faisal
Acked-by Faisal LatifRE: [PATCH v2 29/45] IB/nes: Remove set-but-not-used variables
In reply to a message not in the archiveQuoted 101 lines
-----Original Message-----
From: Bart Van Assche [mailto:[email protected]]
Sent: Wednesday, October 11, 2017 12:49 PM
To: Doug Ledford <[email protected]>
Cc: [email protected]; Bart Van Assche <[email protected]>; Latif, Faisal <[email protected]>
Subject: [PATCH v2 29/45] IB/nes: Remove set-but-not-used variablesThis patch does not change any functionality.
Signed-off-by Bart Van Assche <[email protected]>Cc Faisal Latif <[email protected]>---
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
-6@@ -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();drivers/infiniband/hw/nes/nes_cm.c +0
-1@@ -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;drivers/infiniband/hw/nes/nes_cm.c +0
-1@@ -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 +1
-2@@ -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 @@ voidnes_mh_fix(unsigned long parm)} else { nes_write_indexed(nesdev, NES_IDX_ETH_SERDES_RX_EQ_CONTROL0, 0xf0042222); }drivers/infiniband/hw/nes/nes_utils.c +0
-1- serdes_status = nes_read_indexed(nesdev,
NES_IDX_ETH_SERDES_RX_EQ_STATUS0);drivers/infiniband/hw/nes/nes_utils.c +1
-0+ nes_read_indexed(nesdev,
NES_IDX_ETH_SERDES_RX_EQ_STATUS0);
nes_write_indexed(nesdev,NES_IDX_ETH_SERDES_CDR_CONTROL0,0x000000ff);
Quoted 4 lines
nes_write_indexed(nesdev,
NES_IDX_MAC_TX_CONTROL,tx_control);
--
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
Latif, Faisal
Acked-by Faisal LatifRE: [PATCH v2 30/45] IB/nes: Fix a race condition in nes_inetaddr_event()
In reply to a message not in the archiveQuoted 43 lines
From: Bart Van Assche [mailto:[email protected]]
Sent: Wednesday, October 11, 2017 12:49 PM
To: Doug Ledford <[email protected]>
Cc: [email protected]; Bart Van Assche <[email protected]>; Latif, Faisal <[email protected]>
Subject: [PATCH v2 30/45] IB/nes: Fix a race condition innes_inetaddr_event()This patch has been compile-tested only.
Signed-off-by Bart Van Assche <[email protected]>Cc Faisal Latif <[email protected]>---
drivers/infiniband/hw/nes/nes.c| 13 +++++++++----1 file changed, 9 insertions(+), 4 deletions(-)drivers/infiniband/hw/nes/nes.c +8
-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-Quoted 1 line
ifa_address;drivers/infiniband/hw/nes/nes.c +1
-0+ }
Quoted 5 lines
nes_write_indexed(nesdev, NES_IDX_DST_IP_ADDR+(0x10*PCI_FUNC(nesdev->pcidev->devfn)),--
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
Latif, Faisal
Acked-by Faisal LatifRE: [PATCH v2 27/45] IB/nes: Fix indentation
In reply to a message not in the archiveQuoted 160 lines
From: Bart Van Assche [mailto:[email protected]]
Sent: Wednesday, October 11, 2017 12:49 PM
To: Doug Ledford <[email protected]>
Cc: [email protected]; Bart Van Assche <[email protected]>; Latif, Faisal <[email protected]>
Subject: [PATCH v2 27/45] IB/nes: Fix indentationSigned-off-by Bart Van Assche <[email protected]>Cc Faisal Latif <[email protected]>---
drivers/infiniband/hw/nes/nes.c | 22 +++++++++++----------- drivers/infiniband/hw/nes/nes_hw.c | 5 +++-- drivers/infiniband/hw/nes/nes_nic.c | 9 ++++----- 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 +3
-2@@ -1861,8 +1861,9 @@ 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 +0
-2@@ -926,11 +926,10 @@ 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,"
drivers/infiniband/hw/nes/nes_nic.c +0
-3-"used for=%d \n" , mc_index, - nesvnic->nic_index, - nesadapter-Quoted 1 line
pft_mcast_map[mc_index]);
drivers/infiniband/hw/nes/nes_nic.c +2
-0+ nes_debug(NES_DBG_NIC_RX, + "mc_index=%d skippingnic_index=%d, used for=%d\n",
drivers/infiniband/hw/nes/nes_nic.c +2
-0+ mc_index, nesvnic->nic_index, + nesadapter-Quoted 1 line
pft_mcast_map[mc_index]);
mc_index++; } if (mc_index >= max_pft_entries_avaiable) diff --git
a/drivers/infiniband/hw/nes/nes_utils.cb/drivers/infiniband/hw/nes/nes_utils.c
index37331e2fdc5f..7b67e9cb57ed100644drivers/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 */ diff --git
a/drivers/infiniband/hw/nes/nes_verbs.cb/drivers/infiniband/hw/nes/nes_verbs.c
indexf0dc5f4aa177..6abe90b58c91100644drivers/infiniband/hw/nes/nes_verbs.c +0
-0@@ -2865,11 +2865,11 @@ int nes_modify_qp(struct ib_qp *ibqp, structib_qp_attr *attr, next_iwarp_state =NES_CQP_QP_IWARP_STATE_ERROR ;/* next_iwarp_state = (
NES_CQP_QP_IWARP_STATE_TERMINATE|0x02000000); */drivers/infiniband/hw/nes/nes_verbs.c +0
-2-if (nesqp->hte_added) { -nes_debug(NES_DBG_MOD_QP, "set CQP_QP_DEL_HTE\n");drivers/infiniband/hw/nes/nes_verbs.c +0
-1- next_iwarp_state |=
NES_CQP_QP_DEL_HTE;drivers/infiniband/hw/nes/nes_verbs.c +2
-2- nesqp->hte_added =0 ; - } +if (nesqp->hte_added) { + nes_debug(NES_DBG_MOD_QP, "setCQP_QP_DEL_HTE\n");
drivers/infiniband/hw/nes/nes_verbs.c +1
-0+ next_iwarp_state |=
NES_CQP_QP_DEL_HTE;drivers/infiniband/hw/nes/nes_verbs.c +2
-0+ 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-Quoted 1 line
hwqp.rq_vbase[wqe_index].wqe_words[NES_IWARP_RQ_WQE_COMP_SCRA
TCH_LOW_IDX]))) |((u64)(le32_to_cpu(nesqp-Quoted 1 line
hwqp.rq_vbase[wqe_index].wqe_words[NES_IWARP_RQ_WQE_COMP_SCRA
TCH_HIGH_IDX]))<<32);
drivers/infiniband/hw/nes/nes_verbs.c +1
-1- entry->opcode =IB_WC_RECV ; + entry->opcode =IB_WC_RECV ;
Quoted 6 lines
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)) {
--
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
Wei Hu (Xavier)
Acked-byRe: [PATCH v2 19/45] IB/hns: Declare local functions 'static'
In reply to a message not in the archiveQuoted 194 lines · Bart Van Assche
Signed-off-by Bart Van Assche <[email protected]>Cc Lijun Ou <[email protected]>Cc Wei Hu (Xavier) <[email protected]>Cc Shaobo Xu <[email protected]>--- 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 +34
-28@@ -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);
drivers/infiniband/hw/hns/hns_roce_hw_v1.c int hns_roce_v1_destroy_qp(struct ib_qp *ibqp) · line 3905
Quoted 8 lines
drivers/infiniband/hw/hns/hns_roce_hw_v1.c +1
-1@@ -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);
--
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 16 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 3 lines
Thanks,
Bart.
Hi Bart, thanks for all the work here. Series applied.
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 v2 37/45] RDMA/qedr: Remove set-but-not-used variables
In reply to a message not in the archiveHi Bart,
I think There's no point in ACK-ing the patches now as Doug has already applied the series. Thanks for this and the other ones too.
We were on long holidays here in Israel, but now we're back to routine.
Cheers,
Ram
--
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
Moni Shoua
Acked-byRe: [PATCH v2 42/45] RDMA/rxe: 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 Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/[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