Commit 051947b3 authored by Kees Cook's avatar Kees Cook Committed by Doug Ledford

RDMA/cxgb3: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly. Also removes an unused timer.

Cc: Steve Wise <swise@chelsio.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: linux-rdma@vger.kernel.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 8064135e
...@@ -107,7 +107,7 @@ static struct workqueue_struct *workq; ...@@ -107,7 +107,7 @@ static struct workqueue_struct *workq;
static struct sk_buff_head rxq; static struct sk_buff_head rxq;
static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp); static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp);
static void ep_timeout(unsigned long arg); static void ep_timeout(struct timer_list *t);
static void connect_reply_upcall(struct iwch_ep *ep, int status); static void connect_reply_upcall(struct iwch_ep *ep, int status);
static void start_ep_timer(struct iwch_ep *ep) static void start_ep_timer(struct iwch_ep *ep)
...@@ -119,8 +119,6 @@ static void start_ep_timer(struct iwch_ep *ep) ...@@ -119,8 +119,6 @@ static void start_ep_timer(struct iwch_ep *ep)
} else } else
get_ep(&ep->com); get_ep(&ep->com);
ep->timer.expires = jiffies + ep_timeout_secs * HZ; ep->timer.expires = jiffies + ep_timeout_secs * HZ;
ep->timer.data = (unsigned long)ep;
ep->timer.function = ep_timeout;
add_timer(&ep->timer); add_timer(&ep->timer);
} }
...@@ -1399,7 +1397,7 @@ static int pass_accept_req(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) ...@@ -1399,7 +1397,7 @@ static int pass_accept_req(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
child_ep->l2t = l2t; child_ep->l2t = l2t;
child_ep->dst = dst; child_ep->dst = dst;
child_ep->hwtid = hwtid; child_ep->hwtid = hwtid;
init_timer(&child_ep->timer); timer_setup(&child_ep->timer, ep_timeout, 0);
cxgb3_insert_tid(tdev, &t3c_client, child_ep, hwtid); cxgb3_insert_tid(tdev, &t3c_client, child_ep, hwtid);
accept_cr(child_ep, req->peer_ip, skb); accept_cr(child_ep, req->peer_ip, skb);
goto out; goto out;
...@@ -1719,9 +1717,9 @@ static int ec_status(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) ...@@ -1719,9 +1717,9 @@ static int ec_status(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
return CPL_RET_BUF_DONE; return CPL_RET_BUF_DONE;
} }
static void ep_timeout(unsigned long arg) static void ep_timeout(struct timer_list *t)
{ {
struct iwch_ep *ep = (struct iwch_ep *)arg; struct iwch_ep *ep = from_timer(ep, t, timer);
struct iwch_qp_attributes attrs; struct iwch_qp_attributes attrs;
unsigned long flags; unsigned long flags;
int abort = 1; int abort = 1;
...@@ -1899,7 +1897,7 @@ int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) ...@@ -1899,7 +1897,7 @@ int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
} }
init_timer(&ep->timer); timer_setup(&ep->timer, ep_timeout, 0);
ep->plen = conn_param->private_data_len; ep->plen = conn_param->private_data_len;
if (ep->plen) if (ep->plen)
memcpy(ep->mpa_pkt + sizeof(struct mpa_message), memcpy(ep->mpa_pkt + sizeof(struct mpa_message),
......
...@@ -969,7 +969,6 @@ static struct ib_qp *iwch_create_qp(struct ib_pd *pd, ...@@ -969,7 +969,6 @@ static struct ib_qp *iwch_create_qp(struct ib_pd *pd,
insert_mmap(ucontext, mm2); insert_mmap(ucontext, mm2);
} }
qhp->ibqp.qp_num = qhp->wq.qpid; qhp->ibqp.qp_num = qhp->wq.qpid;
init_timer(&(qhp->timer));
pr_debug("%s sq_num_entries %d, rq_num_entries %d qpid 0x%0x qhp %p dma_addr 0x%llx size %d rq_addr 0x%x\n", pr_debug("%s sq_num_entries %d, rq_num_entries %d qpid 0x%0x qhp %p dma_addr 0x%llx size %d rq_addr 0x%x\n",
__func__, qhp->attr.sq_num_entries, qhp->attr.rq_num_entries, __func__, qhp->attr.sq_num_entries, qhp->attr.rq_num_entries,
qhp->wq.qpid, qhp, (unsigned long long)qhp->wq.dma_addr, qhp->wq.qpid, qhp, (unsigned long long)qhp->wq.dma_addr,
......
...@@ -168,7 +168,6 @@ struct iwch_qp { ...@@ -168,7 +168,6 @@ struct iwch_qp {
atomic_t refcnt; atomic_t refcnt;
wait_queue_head_t wait; wait_queue_head_t wait;
enum IWCH_QP_FLAGS flags; enum IWCH_QP_FLAGS flags;
struct timer_list timer;
}; };
static inline int qp_quiesced(struct iwch_qp *qhp) static inline int qp_quiesced(struct iwch_qp *qhp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment