Skip to content

Commit 2b54035

Browse files
AdrianBunkRoland Dreier
authored andcommitted
RDMA/cxgb3: cleanups
- don't mark static functions in C files as inline - gcc should know best whether inlining makes sense - never compile the unused cxio_dbg.c - make the following needlessly global functions static: - cxio_hal.c: cxio_hal_clear_qp_ctx() - iwch_provider.c: iwch_get_qp() - remove the following unused global functions: - cxio_hal.c: cxio_allocate_stag() - cxio_resource.: cxio_hal_get_rhdl() - cxio_resource.: cxio_hal_put_rhdl() Signed-off-by: Adrian Bunk <bunk@stusta.de> Acked-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
1 parent 1836854 commit 2b54035

8 files changed

Lines changed: 27 additions & 61 deletions

File tree

‎drivers/infiniband/hw/cxgb3/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ iw_cxgb3-y := iwch_cm.o iwch_ev.o iwch_cq.o iwch_qp.o iwch_mem.o \
88

99
ifdef CONFIG_INFINIBAND_CXGB3_DEBUG
1010
EXTRA_CFLAGS += -DDEBUG
11-
iw_cxgb3-y += cxio_dbg.o
1211
endif

‎drivers/infiniband/hw/cxgb3/cxio_hal.c‎

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
static LIST_HEAD(rdev_list);
4646
static cxio_hal_ev_callback_func_t cxio_ev_cb = NULL;
4747

48-
static inline struct cxio_rdev *cxio_hal_find_rdev_by_name(char *dev_name)
48+
static struct cxio_rdev *cxio_hal_find_rdev_by_name(char *dev_name)
4949
{
5050
struct cxio_rdev *rdev;
5151

@@ -55,8 +55,7 @@ static inline struct cxio_rdev *cxio_hal_find_rdev_by_name(char *dev_name)
5555
return NULL;
5656
}
5757

58-
static inline struct cxio_rdev *cxio_hal_find_rdev_by_t3cdev(struct t3cdev
59-
*tdev)
58+
static struct cxio_rdev *cxio_hal_find_rdev_by_t3cdev(struct t3cdev *tdev)
6059
{
6160
struct cxio_rdev *rdev;
6261

@@ -118,7 +117,7 @@ int cxio_hal_cq_op(struct cxio_rdev *rdev_p, struct t3_cq *cq,
118117
return 0;
119118
}
120119

121-
static inline int cxio_hal_clear_cq_ctx(struct cxio_rdev *rdev_p, u32 cqid)
120+
static int cxio_hal_clear_cq_ctx(struct cxio_rdev *rdev_p, u32 cqid)
122121
{
123122
struct rdma_cq_setup setup;
124123
setup.id = cqid;
@@ -130,7 +129,7 @@ static inline int cxio_hal_clear_cq_ctx(struct cxio_rdev *rdev_p, u32 cqid)
130129
return (rdev_p->t3cdev_p->ctl(rdev_p->t3cdev_p, RDMA_CQ_SETUP, &setup));
131130
}
132131

133-
int cxio_hal_clear_qp_ctx(struct cxio_rdev *rdev_p, u32 qpid)
132+
static int cxio_hal_clear_qp_ctx(struct cxio_rdev *rdev_p, u32 qpid)
134133
{
135134
u64 sge_cmd;
136135
struct t3_modify_qp_wr *wqe;
@@ -425,7 +424,7 @@ void cxio_flush_hw_cq(struct t3_cq *cq)
425424
}
426425
}
427426

428-
static inline int cqe_completes_wr(struct t3_cqe *cqe, struct t3_wq *wq)
427+
static int cqe_completes_wr(struct t3_cqe *cqe, struct t3_wq *wq)
429428
{
430429
if (CQE_OPCODE(*cqe) == T3_TERMINATE)
431430
return 0;
@@ -760,17 +759,6 @@ static int __cxio_tpt_op(struct cxio_rdev *rdev_p, u32 reset_tpt_entry,
760759
return err;
761760
}
762761

763-
/* IN : stag key, pdid, pbl_size
764-
* Out: stag index, actaul pbl_size, and pbl_addr allocated.
765-
*/
766-
int cxio_allocate_stag(struct cxio_rdev *rdev_p, u32 * stag, u32 pdid,
767-
enum tpt_mem_perm perm, u32 * pbl_size, u32 * pbl_addr)
768-
{
769-
*stag = T3_STAG_UNSET;
770-
return (__cxio_tpt_op(rdev_p, 0, stag, 0, pdid, TPT_NON_SHARED_MR,
771-
perm, 0, 0ULL, 0, 0, NULL, pbl_size, pbl_addr));
772-
}
773-
774762
int cxio_register_phys_mem(struct cxio_rdev *rdev_p, u32 *stag, u32 pdid,
775763
enum tpt_mem_perm perm, u32 zbva, u64 to, u32 len,
776764
u8 page_size, __be64 *pbl, u32 *pbl_size,
@@ -1029,7 +1017,7 @@ void __exit cxio_hal_exit(void)
10291017
cxio_hal_destroy_rhdl_resource();
10301018
}
10311019

1032-
static inline void flush_completed_wrs(struct t3_wq *wq, struct t3_cq *cq)
1020+
static void flush_completed_wrs(struct t3_wq *wq, struct t3_cq *cq)
10331021
{
10341022
struct t3_swsq *sqp;
10351023
__u32 ptr = wq->sq_rptr;
@@ -1058,9 +1046,8 @@ static inline void flush_completed_wrs(struct t3_wq *wq, struct t3_cq *cq)
10581046
break;
10591047
}
10601048

1061-
static inline void create_read_req_cqe(struct t3_wq *wq,
1062-
struct t3_cqe *hw_cqe,
1063-
struct t3_cqe *read_cqe)
1049+
static void create_read_req_cqe(struct t3_wq *wq, struct t3_cqe *hw_cqe,
1050+
struct t3_cqe *read_cqe)
10641051
{
10651052
read_cqe->u.scqe.wrid_hi = wq->oldest_read->sq_wptr;
10661053
read_cqe->len = wq->oldest_read->read_len;
@@ -1073,7 +1060,7 @@ static inline void create_read_req_cqe(struct t3_wq *wq,
10731060
/*
10741061
* Return a ptr to the next read wr in the SWSQ or NULL.
10751062
*/
1076-
static inline void advance_oldest_read(struct t3_wq *wq)
1063+
static void advance_oldest_read(struct t3_wq *wq)
10771064
{
10781065

10791066
u32 rptr = wq->oldest_read - wq->sq + 1;

‎drivers/infiniband/hw/cxgb3/cxio_hal.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ int cxio_rdev_open(struct cxio_rdev *rdev);
143143
void cxio_rdev_close(struct cxio_rdev *rdev);
144144
int cxio_hal_cq_op(struct cxio_rdev *rdev, struct t3_cq *cq,
145145
enum t3_cq_opcode op, u32 credit);
146-
int cxio_hal_clear_qp_ctx(struct cxio_rdev *rdev, u32 qpid);
147146
int cxio_create_cq(struct cxio_rdev *rdev, struct t3_cq *cq);
148147
int cxio_destroy_cq(struct cxio_rdev *rdev, struct t3_cq *cq);
149148
int cxio_resize_cq(struct cxio_rdev *rdev, struct t3_cq *cq);
@@ -154,8 +153,6 @@ int cxio_create_qp(struct cxio_rdev *rdev, u32 kernel_domain, struct t3_wq *wq,
154153
int cxio_destroy_qp(struct cxio_rdev *rdev, struct t3_wq *wq,
155154
struct cxio_ucontext *uctx);
156155
int cxio_peek_cq(struct t3_wq *wr, struct t3_cq *cq, int opcode);
157-
int cxio_allocate_stag(struct cxio_rdev *rdev, u32 * stag, u32 pdid,
158-
enum tpt_mem_perm perm, u32 * pbl_size, u32 * pbl_addr);
159156
int cxio_register_phys_mem(struct cxio_rdev *rdev, u32 * stag, u32 pdid,
160157
enum tpt_mem_perm perm, u32 zbva, u64 to, u32 len,
161158
u8 page_size, __be64 *pbl, u32 *pbl_size,
@@ -171,8 +168,6 @@ int cxio_deallocate_window(struct cxio_rdev *rdev, u32 stag);
171168
int cxio_rdma_init(struct cxio_rdev *rdev, struct t3_rdma_init_attr *attr);
172169
void cxio_register_ev_cb(cxio_hal_ev_callback_func_t ev_cb);
173170
void cxio_unregister_ev_cb(cxio_hal_ev_callback_func_t ev_cb);
174-
u32 cxio_hal_get_rhdl(void);
175-
void cxio_hal_put_rhdl(u32 rhdl);
176171
u32 cxio_hal_get_pdid(struct cxio_hal_resource *rscp);
177172
void cxio_hal_put_pdid(struct cxio_hal_resource *rscp, u32 pdid);
178173
int __init cxio_hal_init(void);

‎drivers/infiniband/hw/cxgb3/cxio_resource.c‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ int cxio_hal_init_resource(struct cxio_rdev *rdev_p,
179179
/*
180180
* returns 0 if no resource available
181181
*/
182-
static inline u32 cxio_hal_get_resource(struct kfifo *fifo)
182+
static u32 cxio_hal_get_resource(struct kfifo *fifo)
183183
{
184184
u32 entry;
185185
if (kfifo_get(fifo, (unsigned char *) &entry, sizeof(u32)))
@@ -188,21 +188,11 @@ static inline u32 cxio_hal_get_resource(struct kfifo *fifo)
188188
return 0; /* fifo emptry */
189189
}
190190

191-
static inline void cxio_hal_put_resource(struct kfifo *fifo, u32 entry)
191+
static void cxio_hal_put_resource(struct kfifo *fifo, u32 entry)
192192
{
193193
BUG_ON(kfifo_put(fifo, (unsigned char *) &entry, sizeof(u32)) == 0);
194194
}
195195

196-
u32 cxio_hal_get_rhdl(void)
197-
{
198-
return cxio_hal_get_resource(rhdl_fifo);
199-
}
200-
201-
void cxio_hal_put_rhdl(u32 rhdl)
202-
{
203-
cxio_hal_put_resource(rhdl_fifo, rhdl);
204-
}
205-
206196
u32 cxio_hal_get_stag(struct cxio_hal_resource *rscp)
207197
{
208198
return cxio_hal_get_resource(rscp->tpt_fifo);

‎drivers/infiniband/hw/cxgb3/iwch_cm.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ static enum iwch_ep_state state_read(struct iwch_ep_common *epc)
209209
return state;
210210
}
211211

212-
static inline void __state_set(struct iwch_ep_common *epc,
213-
enum iwch_ep_state new)
212+
static void __state_set(struct iwch_ep_common *epc, enum iwch_ep_state new)
214213
{
215214
epc->state = new;
216215
}
@@ -1459,7 +1458,7 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
14591458
/*
14601459
* Returns whether an ABORT_REQ_RSS message is a negative advice.
14611460
*/
1462-
static inline int is_neg_adv_abort(unsigned int status)
1461+
static int is_neg_adv_abort(unsigned int status)
14631462
{
14641463
return status == CPL_ERR_RTX_NEG_ADVICE ||
14651464
status == CPL_ERR_PERSIST_NEG_ADVICE;

‎drivers/infiniband/hw/cxgb3/iwch_provider.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ void iwch_qp_rem_ref(struct ib_qp *qp)
948948
wake_up(&(to_iwch_qp(qp)->wait));
949949
}
950950

951-
struct ib_qp *iwch_get_qp(struct ib_device *dev, int qpn)
951+
static struct ib_qp *iwch_get_qp(struct ib_device *dev, int qpn)
952952
{
953953
PDBG("%s ib_dev %p qpn 0x%x\n", __FUNCTION__, dev, qpn);
954954
return (struct ib_qp *)get_qhp(to_iwch_dev(dev), qpn);

‎drivers/infiniband/hw/cxgb3/iwch_provider.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ static inline struct iwch_qp *to_iwch_qp(struct ib_qp *ibqp)
178178

179179
void iwch_qp_add_ref(struct ib_qp *qp);
180180
void iwch_qp_rem_ref(struct ib_qp *qp);
181-
struct ib_qp *iwch_get_qp(struct ib_device *dev, int qpn);
182181

183182
struct iwch_ucontext {
184183
struct ib_ucontext ibucontext;

‎drivers/infiniband/hw/cxgb3/iwch_qp.c‎

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636

3737
#define NO_SUPPORT -1
3838

39-
static inline int iwch_build_rdma_send(union t3_wr *wqe, struct ib_send_wr *wr,
40-
u8 * flit_cnt)
39+
static int iwch_build_rdma_send(union t3_wr *wqe, struct ib_send_wr *wr,
40+
u8 * flit_cnt)
4141
{
4242
int i;
4343
u32 plen;
@@ -96,8 +96,8 @@ static inline int iwch_build_rdma_send(union t3_wr *wqe, struct ib_send_wr *wr,
9696
return 0;
9797
}
9898

99-
static inline int iwch_build_rdma_write(union t3_wr *wqe, struct ib_send_wr *wr,
100-
u8 *flit_cnt)
99+
static int iwch_build_rdma_write(union t3_wr *wqe, struct ib_send_wr *wr,
100+
u8 *flit_cnt)
101101
{
102102
int i;
103103
u32 plen;
@@ -137,8 +137,8 @@ static inline int iwch_build_rdma_write(union t3_wr *wqe, struct ib_send_wr *wr,
137137
return 0;
138138
}
139139

140-
static inline int iwch_build_rdma_read(union t3_wr *wqe, struct ib_send_wr *wr,
141-
u8 *flit_cnt)
140+
static int iwch_build_rdma_read(union t3_wr *wqe, struct ib_send_wr *wr,
141+
u8 *flit_cnt)
142142
{
143143
if (wr->num_sge > 1)
144144
return -EINVAL;
@@ -158,9 +158,8 @@ static inline int iwch_build_rdma_read(union t3_wr *wqe, struct ib_send_wr *wr,
158158
/*
159159
* TBD: this is going to be moved to firmware. Missing pdid/qpid check for now.
160160
*/
161-
static inline int iwch_sgl2pbl_map(struct iwch_dev *rhp,
162-
struct ib_sge *sg_list, u32 num_sgle,
163-
u32 * pbl_addr, u8 * page_size)
161+
static int iwch_sgl2pbl_map(struct iwch_dev *rhp, struct ib_sge *sg_list,
162+
u32 num_sgle, u32 * pbl_addr, u8 * page_size)
164163
{
165164
int i;
166165
struct iwch_mr *mhp;
@@ -206,9 +205,8 @@ static inline int iwch_sgl2pbl_map(struct iwch_dev *rhp,
206205
return 0;
207206
}
208207

209-
static inline int iwch_build_rdma_recv(struct iwch_dev *rhp,
210-
union t3_wr *wqe,
211-
struct ib_recv_wr *wr)
208+
static int iwch_build_rdma_recv(struct iwch_dev *rhp, union t3_wr *wqe,
209+
struct ib_recv_wr *wr)
212210
{
213211
int i, err = 0;
214212
u32 pbl_addr[4];
@@ -473,8 +471,7 @@ int iwch_bind_mw(struct ib_qp *qp,
473471
return err;
474472
}
475473

476-
static inline void build_term_codes(int t3err, u8 *layer_type, u8 *ecode,
477-
int tagged)
474+
static void build_term_codes(int t3err, u8 *layer_type, u8 *ecode, int tagged)
478475
{
479476
switch (t3err) {
480477
case TPT_ERR_STAG:
@@ -672,7 +669,7 @@ static void __flush_qp(struct iwch_qp *qhp, unsigned long *flag)
672669
spin_lock_irqsave(&qhp->lock, *flag);
673670
}
674671

675-
static inline void flush_qp(struct iwch_qp *qhp, unsigned long *flag)
672+
static void flush_qp(struct iwch_qp *qhp, unsigned long *flag)
676673
{
677674
if (t3b_device(qhp->rhp))
678675
cxio_set_wq_in_error(&qhp->wq);
@@ -684,7 +681,7 @@ static inline void flush_qp(struct iwch_qp *qhp, unsigned long *flag)
684681
/*
685682
* Return non zero if at least one RECV was pre-posted.
686683
*/
687-
static inline int rqes_posted(struct iwch_qp *qhp)
684+
static int rqes_posted(struct iwch_qp *qhp)
688685
{
689686
return fw_riwrh_opcode((struct fw_riwrh *)qhp->wq.queue) == T3_WR_RCV;
690687
}

0 commit comments

Comments
 (0)