Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192463
b: refs/heads/master
c: cfdda9d
h: refs/heads/master
i:
  192461: 335de57
  192459: 15215f5
  192455: 0448056
  192447: 62b0433
v: v3
  • Loading branch information
Steve Wise authored and Roland Dreier committed Apr 21, 2010
1 parent 7f46846 commit ac76be3
Show file tree
Hide file tree
Showing 22 changed files with 9,525 additions and 77 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 617c9a7e398878d036a3aa9a063ccba145854b45
refs/heads/master: cfdda9d764362ab77b11a410bb928400e6520d57
1 change: 1 addition & 0 deletions trunk/drivers/infiniband/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ source "drivers/infiniband/hw/ipath/Kconfig"
source "drivers/infiniband/hw/ehca/Kconfig"
source "drivers/infiniband/hw/amso1100/Kconfig"
source "drivers/infiniband/hw/cxgb3/Kconfig"
source "drivers/infiniband/hw/cxgb4/Kconfig"
source "drivers/infiniband/hw/mlx4/Kconfig"
source "drivers/infiniband/hw/nes/Kconfig"

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/infiniband/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ obj-$(CONFIG_INFINIBAND_IPATH) += hw/ipath/
obj-$(CONFIG_INFINIBAND_EHCA) += hw/ehca/
obj-$(CONFIG_INFINIBAND_AMSO1100) += hw/amso1100/
obj-$(CONFIG_INFINIBAND_CXGB3) += hw/cxgb3/
obj-$(CONFIG_INFINIBAND_CXGB4) += hw/cxgb4/
obj-$(CONFIG_MLX4_INFINIBAND) += hw/mlx4/
obj-$(CONFIG_INFINIBAND_NES) += hw/nes/
obj-$(CONFIG_INFINIBAND_IPOIB) += ulp/ipoib/
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/infiniband/hw/cxgb3/cxio_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ int cxio_create_cq(struct cxio_rdev *rdev_p, struct t3_cq *cq, int kernel)
kfree(cq->sw_queue);
return -ENOMEM;
}
dma_unmap_addr_set(cq, mapping, cq->dma_addr);
pci_unmap_addr_set(cq, mapping, cq->dma_addr);
memset(cq->queue, 0, size);
setup.id = cq->cqid;
setup.base_addr = (u64) (cq->dma_addr);
Expand Down Expand Up @@ -297,7 +297,7 @@ int cxio_create_qp(struct cxio_rdev *rdev_p, u32 kernel_domain,
goto err4;

memset(wq->queue, 0, depth * sizeof(union t3_wr));
dma_unmap_addr_set(wq, mapping, wq->dma_addr);
pci_unmap_addr_set(wq, mapping, wq->dma_addr);
wq->doorbell = (void __iomem *)rdev_p->rnic_info.kdb_addr;
if (!kernel_domain)
wq->udb = (u64)rdev_p->rnic_info.udbell_physbase +
Expand Down Expand Up @@ -325,7 +325,7 @@ int cxio_destroy_cq(struct cxio_rdev *rdev_p, struct t3_cq *cq)
dma_free_coherent(&(rdev_p->rnic_info.pdev->dev),
(1UL << (cq->size_log2))
* sizeof(struct t3_cqe), cq->queue,
dma_unmap_addr(cq, mapping));
pci_unmap_addr(cq, mapping));
cxio_hal_put_cqid(rdev_p->rscp, cq->cqid);
return err;
}
Expand All @@ -336,7 +336,7 @@ int cxio_destroy_qp(struct cxio_rdev *rdev_p, struct t3_wq *wq,
dma_free_coherent(&(rdev_p->rnic_info.pdev->dev),
(1UL << (wq->size_log2))
* sizeof(union t3_wr), wq->queue,
dma_unmap_addr(wq, mapping));
pci_unmap_addr(wq, mapping));
kfree(wq->sq);
cxio_hal_rqtpool_free(rdev_p, wq->rq_addr, (1UL << wq->rq_size_log2));
kfree(wq->rq);
Expand Down Expand Up @@ -537,7 +537,7 @@ static int cxio_hal_init_ctrl_qp(struct cxio_rdev *rdev_p)
err = -ENOMEM;
goto err;
}
dma_unmap_addr_set(&rdev_p->ctrl_qp, mapping,
pci_unmap_addr_set(&rdev_p->ctrl_qp, mapping,
rdev_p->ctrl_qp.dma_addr);
rdev_p->ctrl_qp.doorbell = (void __iomem *)rdev_p->rnic_info.kdb_addr;
memset(rdev_p->ctrl_qp.workq, 0,
Expand Down Expand Up @@ -583,7 +583,7 @@ static int cxio_hal_destroy_ctrl_qp(struct cxio_rdev *rdev_p)
dma_free_coherent(&(rdev_p->rnic_info.pdev->dev),
(1UL << T3_CTRL_QP_SIZE_LOG2)
* sizeof(union t3_wr), rdev_p->ctrl_qp.workq,
dma_unmap_addr(&rdev_p->ctrl_qp, mapping));
pci_unmap_addr(&rdev_p->ctrl_qp, mapping));
return cxio_hal_clear_qp_ctx(rdev_p, T3_CTRL_QP_ID);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/cxgb3/cxio_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct cxio_hal_ctrl_qp {
wait_queue_head_t waitq;/* wait for RspQ/CQE msg */
union t3_wr *workq; /* the work request queue */
dma_addr_t dma_addr; /* pci bus address of the workq */
DEFINE_DMA_UNMAP_ADDR(mapping);
DECLARE_PCI_UNMAP_ADDR(mapping)
void __iomem *doorbell;
};

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/infiniband/hw/cxgb3/cxio_wr.h
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ struct t3_swrq {
struct t3_wq {
union t3_wr *queue; /* DMA accessable memory */
dma_addr_t dma_addr; /* DMA address for HW */
DEFINE_DMA_UNMAP_ADDR(mapping); /* unmap kruft */
DECLARE_PCI_UNMAP_ADDR(mapping) /* unmap kruft */
u32 error; /* 1 once we go to ERROR */
u32 qpid;
u32 wptr; /* idx to next available WR slot */
Expand All @@ -718,7 +718,7 @@ struct t3_cq {
u32 wptr;
u32 size_log2;
dma_addr_t dma_addr;
DEFINE_DMA_UNMAP_ADDR(mapping);
DECLARE_PCI_UNMAP_ADDR(mapping)
struct t3_cqe *queue;
struct t3_cqe *sw_queue;
u32 sw_rptr;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/infiniband/hw/cxgb3/iwch.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ MODULE_DESCRIPTION("Chelsio T3 RDMA Driver");
MODULE_LICENSE("Dual BSD/GPL");
MODULE_VERSION(DRV_VERSION);

cxgb3_cpl_handler_func t3c_handlers[NUM_CPL_CMDS];

static void open_rnic_dev(struct t3cdev *);
static void close_rnic_dev(struct t3cdev *);
static void iwch_event_handler(struct t3cdev *, u32, u32);
Expand Down
133 changes: 66 additions & 67 deletions trunk/drivers/infiniband/hw/cxgb3/iwch_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ static unsigned int cong_flavor = 1;
module_param(cong_flavor, uint, 0644);
MODULE_PARM_DESC(cong_flavor, "TCP Congestion control flavor (default=1)");

static void process_work(struct work_struct *work);
static struct workqueue_struct *workq;
static DECLARE_WORK(skb_work, process_work);

static struct sk_buff_head rxq;
static cxgb3_cpl_handler_func work_handlers[NUM_CPL_CMDS];

static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp);
static void ep_timeout(unsigned long arg);
Expand Down Expand Up @@ -148,7 +151,7 @@ int iwch_l2t_send(struct t3cdev *tdev, struct sk_buff *skb, struct l2t_entry *l2
return -EIO;
}
error = l2t_send(tdev, skb, l2e);
if (error < 0)
if (error)
kfree_skb(skb);
return error;
}
Expand All @@ -164,7 +167,7 @@ int iwch_cxgb3_ofld_send(struct t3cdev *tdev, struct sk_buff *skb)
return -EIO;
}
error = cxgb3_ofld_send(tdev, skb);
if (error < 0)
if (error)
kfree_skb(skb);
return error;
}
Expand Down Expand Up @@ -299,6 +302,27 @@ static void release_ep_resources(struct iwch_ep *ep)
put_ep(&ep->com);
}

static void process_work(struct work_struct *work)
{
struct sk_buff *skb = NULL;
void *ep;
struct t3cdev *tdev;
int ret;

while ((skb = skb_dequeue(&rxq))) {
ep = *((void **) (skb->cb));
tdev = *((struct t3cdev **) (skb->cb + sizeof(void *)));
ret = work_handlers[G_OPCODE(ntohl((__force __be32)skb->csum))](tdev, skb, ep);
if (ret & CPL_RET_BUF_DONE)
kfree_skb(skb);

/*
* ep was referenced in sched(), and is freed here.
*/
put_ep((struct iwch_ep_common *)ep);
}
}

static int status2errno(int status)
{
switch (status) {
Expand Down Expand Up @@ -2133,49 +2157,7 @@ int iwch_ep_redirect(void *ctx, struct dst_entry *old, struct dst_entry *new,

/*
* All the CM events are handled on a work queue to have a safe context.
* These are the real handlers that are called from the work queue.
*/
static const cxgb3_cpl_handler_func work_handlers[NUM_CPL_CMDS] = {
[CPL_ACT_ESTABLISH] = act_establish,
[CPL_ACT_OPEN_RPL] = act_open_rpl,
[CPL_RX_DATA] = rx_data,
[CPL_TX_DMA_ACK] = tx_ack,
[CPL_ABORT_RPL_RSS] = abort_rpl,
[CPL_ABORT_RPL] = abort_rpl,
[CPL_PASS_OPEN_RPL] = pass_open_rpl,
[CPL_CLOSE_LISTSRV_RPL] = close_listsrv_rpl,
[CPL_PASS_ACCEPT_REQ] = pass_accept_req,
[CPL_PASS_ESTABLISH] = pass_establish,
[CPL_PEER_CLOSE] = peer_close,
[CPL_ABORT_REQ_RSS] = peer_abort,
[CPL_CLOSE_CON_RPL] = close_con_rpl,
[CPL_RDMA_TERMINATE] = terminate,
[CPL_RDMA_EC_STATUS] = ec_status,
};

static void process_work(struct work_struct *work)
{
struct sk_buff *skb = NULL;
void *ep;
struct t3cdev *tdev;
int ret;

while ((skb = skb_dequeue(&rxq))) {
ep = *((void **) (skb->cb));
tdev = *((struct t3cdev **) (skb->cb + sizeof(void *)));
ret = work_handlers[G_OPCODE(ntohl((__force __be32)skb->csum))](tdev, skb, ep);
if (ret & CPL_RET_BUF_DONE)
kfree_skb(skb);

/*
* ep was referenced in sched(), and is freed here.
*/
put_ep((struct iwch_ep_common *)ep);
}
}

static DECLARE_WORK(skb_work, process_work);

static int sched(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
{
struct iwch_ep_common *epc = ctx;
Expand Down Expand Up @@ -2207,29 +2189,6 @@ static int set_tcb_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
return CPL_RET_BUF_DONE;
}

/*
* All upcalls from the T3 Core go to sched() to schedule the
* processing on a work queue.
*/
cxgb3_cpl_handler_func t3c_handlers[NUM_CPL_CMDS] = {
[CPL_ACT_ESTABLISH] = sched,
[CPL_ACT_OPEN_RPL] = sched,
[CPL_RX_DATA] = sched,
[CPL_TX_DMA_ACK] = sched,
[CPL_ABORT_RPL_RSS] = sched,
[CPL_ABORT_RPL] = sched,
[CPL_PASS_OPEN_RPL] = sched,
[CPL_CLOSE_LISTSRV_RPL] = sched,
[CPL_PASS_ACCEPT_REQ] = sched,
[CPL_PASS_ESTABLISH] = sched,
[CPL_PEER_CLOSE] = sched,
[CPL_CLOSE_CON_RPL] = sched,
[CPL_ABORT_REQ_RSS] = sched,
[CPL_RDMA_TERMINATE] = sched,
[CPL_RDMA_EC_STATUS] = sched,
[CPL_SET_TCB_RPL] = set_tcb_rpl,
};

int __init iwch_cm_init(void)
{
skb_queue_head_init(&rxq);
Expand All @@ -2238,6 +2197,46 @@ int __init iwch_cm_init(void)
if (!workq)
return -ENOMEM;

/*
* All upcalls from the T3 Core go to sched() to
* schedule the processing on a work queue.
*/
t3c_handlers[CPL_ACT_ESTABLISH] = sched;
t3c_handlers[CPL_ACT_OPEN_RPL] = sched;
t3c_handlers[CPL_RX_DATA] = sched;
t3c_handlers[CPL_TX_DMA_ACK] = sched;
t3c_handlers[CPL_ABORT_RPL_RSS] = sched;
t3c_handlers[CPL_ABORT_RPL] = sched;
t3c_handlers[CPL_PASS_OPEN_RPL] = sched;
t3c_handlers[CPL_CLOSE_LISTSRV_RPL] = sched;
t3c_handlers[CPL_PASS_ACCEPT_REQ] = sched;
t3c_handlers[CPL_PASS_ESTABLISH] = sched;
t3c_handlers[CPL_PEER_CLOSE] = sched;
t3c_handlers[CPL_CLOSE_CON_RPL] = sched;
t3c_handlers[CPL_ABORT_REQ_RSS] = sched;
t3c_handlers[CPL_RDMA_TERMINATE] = sched;
t3c_handlers[CPL_RDMA_EC_STATUS] = sched;
t3c_handlers[CPL_SET_TCB_RPL] = set_tcb_rpl;

/*
* These are the real handlers that are called from a
* work queue.
*/
work_handlers[CPL_ACT_ESTABLISH] = act_establish;
work_handlers[CPL_ACT_OPEN_RPL] = act_open_rpl;
work_handlers[CPL_RX_DATA] = rx_data;
work_handlers[CPL_TX_DMA_ACK] = tx_ack;
work_handlers[CPL_ABORT_RPL_RSS] = abort_rpl;
work_handlers[CPL_ABORT_RPL] = abort_rpl;
work_handlers[CPL_PASS_OPEN_RPL] = pass_open_rpl;
work_handlers[CPL_CLOSE_LISTSRV_RPL] = close_listsrv_rpl;
work_handlers[CPL_PASS_ACCEPT_REQ] = pass_accept_req;
work_handlers[CPL_PASS_ESTABLISH] = pass_establish;
work_handlers[CPL_PEER_CLOSE] = peer_close;
work_handlers[CPL_ABORT_REQ_RSS] = peer_abort;
work_handlers[CPL_CLOSE_CON_RPL] = close_con_rpl;
work_handlers[CPL_RDMA_TERMINATE] = terminate;
work_handlers[CPL_RDMA_EC_STATUS] = ec_status;
return 0;
}

Expand Down
18 changes: 18 additions & 0 deletions trunk/drivers/infiniband/hw/cxgb4/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
config INFINIBAND_CXGB4
tristate "Chelsio T4 RDMA Driver"
depends on CHELSIO_T4 && INET
select GENERIC_ALLOCATOR
---help---
This is an iWARP/RDMA driver for the Chelsio T4 1GbE and
10GbE adapters.

For general information about Chelsio and our products, visit
our website at <http://www.chelsio.com>.

For customer support, please visit our customer support page at
<http://www.chelsio.com/support.htm>.

Please send feedback to <linux-bugs@chelsio.com>.

To compile this driver as a module, choose M here: the module
will be called iw_cxgb4.
5 changes: 5 additions & 0 deletions trunk/drivers/infiniband/hw/cxgb4/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
EXTRA_CFLAGS += -Idrivers/net/cxgb4

obj-$(CONFIG_INFINIBAND_CXGB4) += iw_cxgb4.o

iw_cxgb4-y := device.o cm.o provider.o mem.o cq.o qp.o resource.o ev.o
Loading

0 comments on commit ac76be3

Please sign in to comment.