Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b540355 authored by Adrian Bunk's avatar Adrian Bunk Committed by Roland Dreier
Browse files

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: default avatarAdrian Bunk <bunk@stusta.de>
Acked-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 1836854f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -8,5 +8,4 @@ iw_cxgb3-y := iwch_cm.o iwch_ev.o iwch_cq.o iwch_qp.o iwch_mem.o \

ifdef CONFIG_INFINIBAND_CXGB3_DEBUG
EXTRA_CFLAGS += -DDEBUG
iw_cxgb3-y += cxio_dbg.o
endif
+9 −22
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@
static LIST_HEAD(rdev_list);
static cxio_hal_ev_callback_func_t cxio_ev_cb = NULL;

static inline struct cxio_rdev *cxio_hal_find_rdev_by_name(char *dev_name)
static struct cxio_rdev *cxio_hal_find_rdev_by_name(char *dev_name)
{
	struct cxio_rdev *rdev;

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

static inline struct cxio_rdev *cxio_hal_find_rdev_by_t3cdev(struct t3cdev
							     *tdev)
static struct cxio_rdev *cxio_hal_find_rdev_by_t3cdev(struct t3cdev *tdev)
{
	struct cxio_rdev *rdev;

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

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

int cxio_hal_clear_qp_ctx(struct cxio_rdev *rdev_p, u32 qpid)
static int cxio_hal_clear_qp_ctx(struct cxio_rdev *rdev_p, u32 qpid)
{
	u64 sge_cmd;
	struct t3_modify_qp_wr *wqe;
@@ -425,7 +424,7 @@ void cxio_flush_hw_cq(struct t3_cq *cq)
	}
}

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

/* IN : stag key, pdid, pbl_size
 * Out: stag index, actaul pbl_size, and pbl_addr allocated.
 */
int cxio_allocate_stag(struct cxio_rdev *rdev_p, u32 * stag, u32 pdid,
		       enum tpt_mem_perm perm, u32 * pbl_size, u32 * pbl_addr)
{
	*stag = T3_STAG_UNSET;
	return (__cxio_tpt_op(rdev_p, 0, stag, 0, pdid, TPT_NON_SHARED_MR,
			      perm, 0, 0ULL, 0, 0, NULL, pbl_size, pbl_addr));
}

int cxio_register_phys_mem(struct cxio_rdev *rdev_p, u32 *stag, u32 pdid,
			   enum tpt_mem_perm perm, u32 zbva, u64 to, u32 len,
			   u8 page_size, __be64 *pbl, u32 *pbl_size,
@@ -1029,7 +1017,7 @@ void __exit cxio_hal_exit(void)
	cxio_hal_destroy_rhdl_resource();
}

static inline void flush_completed_wrs(struct t3_wq *wq, struct t3_cq *cq)
static void flush_completed_wrs(struct t3_wq *wq, struct t3_cq *cq)
{
	struct t3_swsq *sqp;
	__u32 ptr = wq->sq_rptr;
@@ -1058,8 +1046,7 @@ static inline void flush_completed_wrs(struct t3_wq *wq, struct t3_cq *cq)
			break;
}

static inline void create_read_req_cqe(struct t3_wq *wq,
				       struct t3_cqe *hw_cqe,
static void create_read_req_cqe(struct t3_wq *wq, struct t3_cqe *hw_cqe,
				struct t3_cqe *read_cqe)
{
	read_cqe->u.scqe.wrid_hi = wq->oldest_read->sq_wptr;
@@ -1073,7 +1060,7 @@ static inline void create_read_req_cqe(struct t3_wq *wq,
/*
 * Return a ptr to the next read wr in the SWSQ or NULL.
 */
static inline void advance_oldest_read(struct t3_wq *wq)
static void advance_oldest_read(struct t3_wq *wq)
{

	u32 rptr = wq->oldest_read - wq->sq + 1;
+0 −5
Original line number Diff line number Diff line
@@ -143,7 +143,6 @@ int cxio_rdev_open(struct cxio_rdev *rdev);
void cxio_rdev_close(struct cxio_rdev *rdev);
int cxio_hal_cq_op(struct cxio_rdev *rdev, struct t3_cq *cq,
		   enum t3_cq_opcode op, u32 credit);
int cxio_hal_clear_qp_ctx(struct cxio_rdev *rdev, u32 qpid);
int cxio_create_cq(struct cxio_rdev *rdev, struct t3_cq *cq);
int cxio_destroy_cq(struct cxio_rdev *rdev, struct t3_cq *cq);
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,
int cxio_destroy_qp(struct cxio_rdev *rdev, struct t3_wq *wq,
		    struct cxio_ucontext *uctx);
int cxio_peek_cq(struct t3_wq *wr, struct t3_cq *cq, int opcode);
int cxio_allocate_stag(struct cxio_rdev *rdev, u32 * stag, u32 pdid,
		       enum tpt_mem_perm perm, u32 * pbl_size, u32 * pbl_addr);
int cxio_register_phys_mem(struct cxio_rdev *rdev, u32 * stag, u32 pdid,
			   enum tpt_mem_perm perm, u32 zbva, u64 to, u32 len,
			   u8 page_size, __be64 *pbl, u32 *pbl_size,
@@ -171,8 +168,6 @@ int cxio_deallocate_window(struct cxio_rdev *rdev, u32 stag);
int cxio_rdma_init(struct cxio_rdev *rdev, struct t3_rdma_init_attr *attr);
void cxio_register_ev_cb(cxio_hal_ev_callback_func_t ev_cb);
void cxio_unregister_ev_cb(cxio_hal_ev_callback_func_t ev_cb);
u32 cxio_hal_get_rhdl(void);
void cxio_hal_put_rhdl(u32 rhdl);
u32 cxio_hal_get_pdid(struct cxio_hal_resource *rscp);
void cxio_hal_put_pdid(struct cxio_hal_resource *rscp, u32 pdid);
int __init cxio_hal_init(void);
+2 −12
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ int cxio_hal_init_resource(struct cxio_rdev *rdev_p,
/*
 * returns 0 if no resource available
 */
static inline u32 cxio_hal_get_resource(struct kfifo *fifo)
static u32 cxio_hal_get_resource(struct kfifo *fifo)
{
	u32 entry;
	if (kfifo_get(fifo, (unsigned char *) &entry, sizeof(u32)))
@@ -188,21 +188,11 @@ static inline u32 cxio_hal_get_resource(struct kfifo *fifo)
		return 0;	/* fifo emptry */
}

static inline void cxio_hal_put_resource(struct kfifo *fifo, u32 entry)
static void cxio_hal_put_resource(struct kfifo *fifo, u32 entry)
{
	BUG_ON(kfifo_put(fifo, (unsigned char *) &entry, sizeof(u32)) == 0);
}

u32 cxio_hal_get_rhdl(void)
{
	return cxio_hal_get_resource(rhdl_fifo);
}

void cxio_hal_put_rhdl(u32 rhdl)
{
	cxio_hal_put_resource(rhdl_fifo, rhdl);
}

u32 cxio_hal_get_stag(struct cxio_hal_resource *rscp)
{
	return cxio_hal_get_resource(rscp->tpt_fifo);
+2 −3
Original line number Diff line number Diff line
@@ -209,8 +209,7 @@ static enum iwch_ep_state state_read(struct iwch_ep_common *epc)
	return state;
}

static inline void __state_set(struct iwch_ep_common *epc,
			       enum iwch_ep_state new)
static void __state_set(struct iwch_ep_common *epc, enum iwch_ep_state new)
{
	epc->state = new;
}
@@ -1459,7 +1458,7 @@ static int peer_close(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
/*
 * Returns whether an ABORT_REQ_RSS message is a negative advice.
 */
static inline int is_neg_adv_abort(unsigned int status)
static int is_neg_adv_abort(unsigned int status)
{
	return status == CPL_ERR_RTX_NEG_ADVICE ||
	       status == CPL_ERR_PERSIST_NEG_ADVICE;
Loading