aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2007-02-21 05:52:49 -0500
committerRoland Dreier <rolandd@cisco.com>2007-02-23 16:10:43 -0500
commit2b540355cd2f46c5445030995e72c4b4fb2b775e (patch)
tree242a6e63bc0644dae6bb4a413d737d776f88a9d6 /drivers
parent1836854f25b1bc63766bff06aeeb83d2a602b050 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/cxgb3/Makefile1
-rw-r--r--drivers/infiniband/hw/cxgb3/cxio_hal.c31
-rw-r--r--drivers/infiniband/hw/cxgb3/cxio_hal.h5
-rw-r--r--drivers/infiniband/hw/cxgb3/cxio_resource.c14
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_cm.c5
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_provider.c2
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_provider.h1
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_qp.c29
8 files changed, 27 insertions, 61 deletions
diff --git a/drivers/infiniband/hw/cxgb3/Makefile b/drivers/infiniband/hw/cxgb3/Makefile
index 0e110f32f128..36b98989b15e 100644
--- a/drivers/infiniband/hw/cxgb3/Makefile
+++ b/drivers/infiniband/hw/cxgb3/Makefile
@@ -8,5 +8,4 @@ iw_cxgb3-y := iwch_cm.o iwch_ev.o iwch_cq.o iwch_qp.o iwch_mem.o \
8 8
9ifdef CONFIG_INFINIBAND_CXGB3_DEBUG 9ifdef CONFIG_INFINIBAND_CXGB3_DEBUG
10EXTRA_CFLAGS += -DDEBUG 10EXTRA_CFLAGS += -DDEBUG
11iw_cxgb3-y += cxio_dbg.o
12endif 11endif
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c
index 114ac3b775dc..d737c738d876 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.c
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c
@@ -45,7 +45,7 @@
45static LIST_HEAD(rdev_list); 45static LIST_HEAD(rdev_list);
46static cxio_hal_ev_callback_func_t cxio_ev_cb = NULL; 46static cxio_hal_ev_callback_func_t cxio_ev_cb = NULL;
47 47
48static inline struct cxio_rdev *cxio_hal_find_rdev_by_name(char *dev_name) 48static struct cxio_rdev *cxio_hal_find_rdev_by_name(char *dev_name)
49{ 49{
50 struct cxio_rdev *rdev; 50 struct cxio_rdev *rdev;
51 51
@@ -55,8 +55,7 @@ static inline struct cxio_rdev *cxio_hal_find_rdev_by_name(char *dev_name)
55 return NULL; 55 return NULL;
56} 56}
57 57
58static inline struct cxio_rdev *cxio_hal_find_rdev_by_t3cdev(struct t3cdev 58static struct cxio_rdev *cxio_hal_find_rdev_by_t3cdev(struct t3cdev *tdev)
59 *tdev)
60{ 59{
61 struct cxio_rdev *rdev; 60 struct cxio_rdev *rdev;
62 61
@@ -118,7 +117,7 @@ int cxio_hal_cq_op(struct cxio_rdev *rdev_p, struct t3_cq *cq,
118 return 0; 117 return 0;
119} 118}
120 119
121static inline int cxio_hal_clear_cq_ctx(struct cxio_rdev *rdev_p, u32 cqid) 120static int cxio_hal_clear_cq_ctx(struct cxio_rdev *rdev_p, u32 cqid)
122{ 121{
123 struct rdma_cq_setup setup; 122 struct rdma_cq_setup setup;
124 setup.id = cqid; 123 setup.id = cqid;
@@ -130,7 +129,7 @@ static inline int cxio_hal_clear_cq_ctx(struct cxio_rdev *rdev_p, u32 cqid)
130 return (rdev_p->t3cdev_p->ctl(rdev_p->t3cdev_p, RDMA_CQ_SETUP, &setup)); 129 return (rdev_p->t3cdev_p->ctl(rdev_p->t3cdev_p, RDMA_CQ_SETUP, &setup));
131} 130}
132 131
133int cxio_hal_clear_qp_ctx(struct cxio_rdev *rdev_p, u32 qpid) 132static int cxio_hal_clear_qp_ctx(struct cxio_rdev *rdev_p, u32 qpid)
134{ 133{
135 u64 sge_cmd; 134 u64 sge_cmd;
136 struct t3_modify_qp_wr *wqe; 135 struct t3_modify_qp_wr *wqe;
@@ -425,7 +424,7 @@ void cxio_flush_hw_cq(struct t3_cq *cq)
425 } 424 }
426} 425}
427 426
428static inline int cqe_completes_wr(struct t3_cqe *cqe, struct t3_wq *wq) 427static int cqe_completes_wr(struct t3_cqe *cqe, struct t3_wq *wq)
429{ 428{
430 if (CQE_OPCODE(*cqe) == T3_TERMINATE) 429 if (CQE_OPCODE(*cqe) == T3_TERMINATE)
431 return 0; 430 return 0;
@@ -760,17 +759,6 @@ ret:
760 return err; 759 return err;
761} 760}
762 761
763/* IN : stag key, pdid, pbl_size
764 * Out: stag index, actaul pbl_size, and pbl_addr allocated.
765 */
766int 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
774int cxio_register_phys_mem(struct cxio_rdev *rdev_p, u32 *stag, u32 pdid, 762int cxio_register_phys_mem(struct cxio_rdev *rdev_p, u32 *stag, u32 pdid,
775 enum tpt_mem_perm perm, u32 zbva, u64 to, u32 len, 763 enum tpt_mem_perm perm, u32 zbva, u64 to, u32 len,
776 u8 page_size, __be64 *pbl, u32 *pbl_size, 764 u8 page_size, __be64 *pbl, u32 *pbl_size,
@@ -1029,7 +1017,7 @@ void __exit cxio_hal_exit(void)
1029 cxio_hal_destroy_rhdl_resource(); 1017 cxio_hal_destroy_rhdl_resource();
1030} 1018}
1031 1019
1032static inline void flush_completed_wrs(struct t3_wq *wq, struct t3_cq *cq) 1020static void flush_completed_wrs(struct t3_wq *wq, struct t3_cq *cq)
1033{ 1021{
1034 struct t3_swsq *sqp; 1022 struct t3_swsq *sqp;
1035 __u32 ptr = wq->sq_rptr; 1023 __u32 ptr = wq->sq_rptr;
@@ -1058,9 +1046,8 @@ static inline void flush_completed_wrs(struct t3_wq *wq, struct t3_cq *cq)
1058 break; 1046 break;
1059} 1047}
1060 1048
1061static inline void create_read_req_cqe(struct t3_wq *wq, 1049static void create_read_req_cqe(struct t3_wq *wq, struct t3_cqe *hw_cqe,
1062 struct t3_cqe *hw_cqe, 1050 struct t3_cqe *read_cqe)
1063 struct t3_cqe *read_cqe)
1064{ 1051{
1065 read_cqe->u.scqe.wrid_hi = wq->oldest_read->sq_wptr; 1052 read_cqe->u.scqe.wrid_hi = wq->oldest_read->sq_wptr;
1066 read_cqe->len = wq->oldest_read->read_len; 1053 read_cqe->len = wq->oldest_read->read_len;
@@ -1073,7 +1060,7 @@ static inline void create_read_req_cqe(struct t3_wq *wq,
1073/* 1060/*
1074 * Return a ptr to the next read wr in the SWSQ or NULL. 1061 * Return a ptr to the next read wr in the SWSQ or NULL.
1075 */ 1062 */
1076static inline void advance_oldest_read(struct t3_wq *wq) 1063static void advance_oldest_read(struct t3_wq *wq)
1077{ 1064{
1078 1065
1079 u32 rptr = wq->oldest_read - wq->sq + 1; 1066 u32 rptr = wq->oldest_read - wq->sq + 1;
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.h b/drivers/infiniband/hw/cxgb3/cxio_hal.h
index 8ab04a7c6f6e..99543d634704 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.h
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.h
@@ -143,7 +143,6 @@ int cxio_rdev_open(struct cxio_rdev *rdev);
143void cxio_rdev_close(struct cxio_rdev *rdev); 143void cxio_rdev_close(struct cxio_rdev *rdev);
144int cxio_hal_cq_op(struct cxio_rdev *rdev, struct t3_cq *cq, 144int cxio_hal_cq_op(struct cxio_rdev *rdev, struct t3_cq *cq,
145 enum t3_cq_opcode op, u32 credit); 145 enum t3_cq_opcode op, u32 credit);
146int cxio_hal_clear_qp_ctx(struct cxio_rdev *rdev, u32 qpid);
147int cxio_create_cq(struct cxio_rdev *rdev, struct t3_cq *cq); 146int cxio_create_cq(struct cxio_rdev *rdev, struct t3_cq *cq);
148int cxio_destroy_cq(struct cxio_rdev *rdev, struct t3_cq *cq); 147int cxio_destroy_cq(struct cxio_rdev *rdev, struct t3_cq *cq);
149int cxio_resize_cq(struct cxio_rdev *rdev, struct t3_cq *cq); 148int 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,
154int cxio_destroy_qp(struct cxio_rdev *rdev, struct t3_wq *wq, 153int cxio_destroy_qp(struct cxio_rdev *rdev, struct t3_wq *wq,
155 struct cxio_ucontext *uctx); 154 struct cxio_ucontext *uctx);
156int cxio_peek_cq(struct t3_wq *wr, struct t3_cq *cq, int opcode); 155int cxio_peek_cq(struct t3_wq *wr, struct t3_cq *cq, int opcode);
157int cxio_allocate_stag(struct cxio_rdev *rdev, u32 * stag, u32 pdid,
158 enum tpt_mem_perm perm, u32 * pbl_size, u32 * pbl_addr);
159int cxio_register_phys_mem(struct cxio_rdev *rdev, u32 * stag, u32 pdid, 156int cxio_register_phys_mem(struct cxio_rdev *rdev, u32 * stag, u32 pdid,
160 enum tpt_mem_perm perm, u32 zbva, u64 to, u32 len, 157 enum tpt_mem_perm perm, u32 zbva, u64 to, u32 len,
161 u8 page_size, __be64 *pbl, u32 *pbl_size, 158 u8 page_size, __be64 *pbl, u32 *pbl_size,
@@ -171,8 +168,6 @@ int cxio_deallocate_window(struct cxio_rdev *rdev, u32 stag);
171int cxio_rdma_init(struct cxio_rdev *rdev, struct t3_rdma_init_attr *attr); 168int cxio_rdma_init(struct cxio_rdev *rdev, struct t3_rdma_init_attr *attr);
172void cxio_register_ev_cb(cxio_hal_ev_callback_func_t ev_cb); 169void cxio_register_ev_cb(cxio_hal_ev_callback_func_t ev_cb);
173void cxio_unregister_ev_cb(cxio_hal_ev_callback_func_t ev_cb); 170void cxio_unregister_ev_cb(cxio_hal_ev_callback_func_t ev_cb);
174u32 cxio_hal_get_rhdl(void);
175void cxio_hal_put_rhdl(u32 rhdl);
176u32 cxio_hal_get_pdid(struct cxio_hal_resource *rscp); 171u32 cxio_hal_get_pdid(struct cxio_hal_resource *rscp);
177void cxio_hal_put_pdid(struct cxio_hal_resource *rscp, u32 pdid); 172void cxio_hal_put_pdid(struct cxio_hal_resource *rscp, u32 pdid);
178int __init cxio_hal_init(void); 173int __init cxio_hal_init(void);
diff --git a/drivers/infiniband/hw/cxgb3/cxio_resource.c b/drivers/infiniband/hw/cxgb3/cxio_resource.c
index 65bf577311aa..d3095ae5bc2e 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_resource.c
+++ b/drivers/infiniband/hw/cxgb3/cxio_resource.c
@@ -179,7 +179,7 @@ tpt_err:
179/* 179/*
180 * returns 0 if no resource available 180 * returns 0 if no resource available
181 */ 181 */
182static inline u32 cxio_hal_get_resource(struct kfifo *fifo) 182static u32 cxio_hal_get_resource(struct kfifo *fifo)
183{ 183{
184 u32 entry; 184 u32 entry;
185 if (kfifo_get(fifo, (unsigned char *) &entry, sizeof(u32))) 185 if (kfifo_get(fifo, (unsigned char *) &entry, sizeof(u32)))
@@ -188,21 +188,11 @@ static inline u32 cxio_hal_get_resource(struct kfifo *fifo)
188 return 0; /* fifo emptry */ 188 return 0; /* fifo emptry */
189} 189}
190 190
191static inline void cxio_hal_put_resource(struct kfifo *fifo, u32 entry) 191static void cxio_hal_put_resource(struct kfifo *fifo, u32 entry)
192{ 192{
193 BUG_ON(kfifo_put(fifo, (unsigned char *) &entry, sizeof(u32)) == 0); 193 BUG_ON(kfifo_put(fifo, (unsigned char *) &entry, sizeof(u32)) == 0);
194} 194}
195 195
196u32 cxio_hal_get_rhdl(void)
197{
198 return cxio_hal_get_resource(rhdl_fifo);
199}
200
201void cxio_hal_put_rhdl(u32 rhdl)
202{
203 cxio_hal_put_resource(rhdl_fifo, rhdl);
204}
205
206u32 cxio_hal_get_stag(struct cxio_hal_resource *rscp) 196u32 cxio_hal_get_stag(struct cxio_hal_resource *rscp)
207{ 197{
208 return cxio_hal_get_resource(rscp->tpt_fifo); 198 return cxio_hal_get_resource(rscp->tpt_fifo);
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index e5442e34b788..b9274e1b3170 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -209,8 +209,7 @@ static enum iwch_ep_state state_read(struct iwch_ep_common *epc)
209 return state; 209 return state;
210} 210}
211 211
212static inline void __state_set(struct iwch_ep_common *epc, 212static void __state_set(struct iwch_ep_common *epc, enum iwch_ep_state new)
213 enum iwch_ep_state new)
214{ 213{
215 epc->state = new; 214 epc->state = new;
216} 215}
@@ -1459,7 +1458,7 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
1459/* 1458/*
1460 * Returns whether an ABORT_REQ_RSS message is a negative advice. 1459 * Returns whether an ABORT_REQ_RSS message is a negative advice.
1461 */ 1460 */
1462static inline int is_neg_adv_abort(unsigned int status) 1461static int is_neg_adv_abort(unsigned int status)
1463{ 1462{
1464 return status == CPL_ERR_RTX_NEG_ADVICE || 1463 return status == CPL_ERR_RTX_NEG_ADVICE ||
1465 status == CPL_ERR_PERSIST_NEG_ADVICE; 1464 status == CPL_ERR_PERSIST_NEG_ADVICE;
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index 2aef122f9955..9947a144a929 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -948,7 +948,7 @@ void iwch_qp_rem_ref(struct ib_qp *qp)
948 wake_up(&(to_iwch_qp(qp)->wait)); 948 wake_up(&(to_iwch_qp(qp)->wait));
949} 949}
950 950
951struct ib_qp *iwch_get_qp(struct ib_device *dev, int qpn) 951static struct ib_qp *iwch_get_qp(struct ib_device *dev, int qpn)
952{ 952{
953 PDBG("%s ib_dev %p qpn 0x%x\n", __FUNCTION__, dev, qpn); 953 PDBG("%s ib_dev %p qpn 0x%x\n", __FUNCTION__, dev, qpn);
954 return (struct ib_qp *)get_qhp(to_iwch_dev(dev), qpn); 954 return (struct ib_qp *)get_qhp(to_iwch_dev(dev), qpn);
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.h b/drivers/infiniband/hw/cxgb3/iwch_provider.h
index 2af3e93b607f..de0fe1b93a0c 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.h
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.h
@@ -178,7 +178,6 @@ static inline struct iwch_qp *to_iwch_qp(struct ib_qp *ibqp)
178 178
179void iwch_qp_add_ref(struct ib_qp *qp); 179void iwch_qp_add_ref(struct ib_qp *qp);
180void iwch_qp_rem_ref(struct ib_qp *qp); 180void iwch_qp_rem_ref(struct ib_qp *qp);
181struct ib_qp *iwch_get_qp(struct ib_device *dev, int qpn);
182 181
183struct iwch_ucontext { 182struct iwch_ucontext {
184 struct ib_ucontext ibucontext; 183 struct ib_ucontext ibucontext;
diff --git a/drivers/infiniband/hw/cxgb3/iwch_qp.c b/drivers/infiniband/hw/cxgb3/iwch_qp.c
index 4dda2f6da2de..9ea00cc4a5f8 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_qp.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_qp.c
@@ -36,8 +36,8 @@
36 36
37#define NO_SUPPORT -1 37#define NO_SUPPORT -1
38 38
39static inline int iwch_build_rdma_send(union t3_wr *wqe, struct ib_send_wr *wr, 39static int iwch_build_rdma_send(union t3_wr *wqe, struct ib_send_wr *wr,
40 u8 * flit_cnt) 40 u8 * flit_cnt)
41{ 41{
42 int i; 42 int i;
43 u32 plen; 43 u32 plen;
@@ -96,8 +96,8 @@ static inline int iwch_build_rdma_send(union t3_wr *wqe, struct ib_send_wr *wr,
96 return 0; 96 return 0;
97} 97}
98 98
99static inline int iwch_build_rdma_write(union t3_wr *wqe, struct ib_send_wr *wr, 99static int iwch_build_rdma_write(union t3_wr *wqe, struct ib_send_wr *wr,
100 u8 *flit_cnt) 100 u8 *flit_cnt)
101{ 101{
102 int i; 102 int i;
103 u32 plen; 103 u32 plen;
@@ -137,8 +137,8 @@ static inline int iwch_build_rdma_write(union t3_wr *wqe, struct ib_send_wr *wr,
137 return 0; 137 return 0;
138} 138}
139 139
140static inline int iwch_build_rdma_read(union t3_wr *wqe, struct ib_send_wr *wr, 140static int iwch_build_rdma_read(union t3_wr *wqe, struct ib_send_wr *wr,
141 u8 *flit_cnt) 141 u8 *flit_cnt)
142{ 142{
143 if (wr->num_sge > 1) 143 if (wr->num_sge > 1)
144 return -EINVAL; 144 return -EINVAL;
@@ -158,9 +158,8 @@ static inline int iwch_build_rdma_read(union t3_wr *wqe, struct ib_send_wr *wr,
158/* 158/*
159 * TBD: this is going to be moved to firmware. Missing pdid/qpid check for now. 159 * TBD: this is going to be moved to firmware. Missing pdid/qpid check for now.
160 */ 160 */
161static inline int iwch_sgl2pbl_map(struct iwch_dev *rhp, 161static int iwch_sgl2pbl_map(struct iwch_dev *rhp, struct ib_sge *sg_list,
162 struct ib_sge *sg_list, u32 num_sgle, 162 u32 num_sgle, u32 * pbl_addr, u8 * page_size)
163 u32 * pbl_addr, u8 * page_size)
164{ 163{
165 int i; 164 int i;
166 struct iwch_mr *mhp; 165 struct iwch_mr *mhp;
@@ -206,9 +205,8 @@ static inline int iwch_sgl2pbl_map(struct iwch_dev *rhp,
206 return 0; 205 return 0;
207} 206}
208 207
209static inline int iwch_build_rdma_recv(struct iwch_dev *rhp, 208static int iwch_build_rdma_recv(struct iwch_dev *rhp, union t3_wr *wqe,
210 union t3_wr *wqe, 209 struct ib_recv_wr *wr)
211 struct ib_recv_wr *wr)
212{ 210{
213 int i, err = 0; 211 int i, err = 0;
214 u32 pbl_addr[4]; 212 u32 pbl_addr[4];
@@ -473,8 +471,7 @@ int iwch_bind_mw(struct ib_qp *qp,
473 return err; 471 return err;
474} 472}
475 473
476static inline void build_term_codes(int t3err, u8 *layer_type, u8 *ecode, 474static void build_term_codes(int t3err, u8 *layer_type, u8 *ecode, int tagged)
477 int tagged)
478{ 475{
479 switch (t3err) { 476 switch (t3err) {
480 case TPT_ERR_STAG: 477 case TPT_ERR_STAG:
@@ -672,7 +669,7 @@ static void __flush_qp(struct iwch_qp *qhp, unsigned long *flag)
672 spin_lock_irqsave(&qhp->lock, *flag); 669 spin_lock_irqsave(&qhp->lock, *flag);
673} 670}
674 671
675static inline void flush_qp(struct iwch_qp *qhp, unsigned long *flag) 672static void flush_qp(struct iwch_qp *qhp, unsigned long *flag)
676{ 673{
677 if (t3b_device(qhp->rhp)) 674 if (t3b_device(qhp->rhp))
678 cxio_set_wq_in_error(&qhp->wq); 675 cxio_set_wq_in_error(&qhp->wq);
@@ -684,7 +681,7 @@ static inline void flush_qp(struct iwch_qp *qhp, unsigned long *flag)
684/* 681/*
685 * Return non zero if at least one RECV was pre-posted. 682 * Return non zero if at least one RECV was pre-posted.
686 */ 683 */
687static inline int rqes_posted(struct iwch_qp *qhp) 684static int rqes_posted(struct iwch_qp *qhp)
688{ 685{
689 return fw_riwrh_opcode((struct fw_riwrh *)qhp->wq.queue) == T3_WR_RCV; 686 return fw_riwrh_opcode((struct fw_riwrh *)qhp->wq.queue) == T3_WR_RCV;
690} 687}