Commit 963cab50 authored by Hariprasad S's avatar Hariprasad S Committed by Doug Ledford

iw_cxgb4: Adds support for T6 adapter

Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 27999805
This diff is collapsed.
...@@ -962,12 +962,12 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop) ...@@ -962,12 +962,12 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop)
devp->rdev.lldi.sge_egrstatuspagesize; devp->rdev.lldi.sge_egrstatuspagesize;
/* /*
* For T5 devices, we map all of BAR2 with WC. * For T5/T6 devices, we map all of BAR2 with WC.
* For T4 devices with onchip qp mem, we map only that part * For T4 devices with onchip qp mem, we map only that part
* of BAR2 with WC. * of BAR2 with WC.
*/ */
devp->rdev.bar2_pa = pci_resource_start(devp->rdev.lldi.pdev, 2); devp->rdev.bar2_pa = pci_resource_start(devp->rdev.lldi.pdev, 2);
if (is_t5(devp->rdev.lldi.adapter_type)) { if (!is_t4(devp->rdev.lldi.adapter_type)) {
devp->rdev.bar2_kva = ioremap_wc(devp->rdev.bar2_pa, devp->rdev.bar2_kva = ioremap_wc(devp->rdev.bar2_pa,
pci_resource_len(devp->rdev.lldi.pdev, 2)); pci_resource_len(devp->rdev.lldi.pdev, 2));
if (!devp->rdev.bar2_kva) { if (!devp->rdev.bar2_kva) {
...@@ -1267,11 +1267,9 @@ static int enable_qp_db(int id, void *p, void *data) ...@@ -1267,11 +1267,9 @@ static int enable_qp_db(int id, void *p, void *data)
static void resume_rc_qp(struct c4iw_qp *qp) static void resume_rc_qp(struct c4iw_qp *qp)
{ {
spin_lock(&qp->lock); spin_lock(&qp->lock);
t4_ring_sq_db(&qp->wq, qp->wq.sq.wq_pidx_inc, t4_ring_sq_db(&qp->wq, qp->wq.sq.wq_pidx_inc, NULL);
is_t5(qp->rhp->rdev.lldi.adapter_type), NULL);
qp->wq.sq.wq_pidx_inc = 0; qp->wq.sq.wq_pidx_inc = 0;
t4_ring_rq_db(&qp->wq, qp->wq.rq.wq_pidx_inc, t4_ring_rq_db(&qp->wq, qp->wq.rq.wq_pidx_inc, NULL);
is_t5(qp->rhp->rdev.lldi.adapter_type), NULL);
qp->wq.rq.wq_pidx_inc = 0; qp->wq.rq.wq_pidx_inc = 0;
spin_unlock(&qp->lock); spin_unlock(&qp->lock);
} }
......
...@@ -209,7 +209,7 @@ static int c4iw_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) ...@@ -209,7 +209,7 @@ static int c4iw_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
if (addr >= rdev->oc_mw_pa) if (addr >= rdev->oc_mw_pa)
vma->vm_page_prot = t4_pgprot_wc(vma->vm_page_prot); vma->vm_page_prot = t4_pgprot_wc(vma->vm_page_prot);
else { else {
if (is_t5(rdev->lldi.adapter_type)) if (!is_t4(rdev->lldi.adapter_type))
vma->vm_page_prot = vma->vm_page_prot =
t4_pgprot_wc(vma->vm_page_prot); t4_pgprot_wc(vma->vm_page_prot);
else else
......
...@@ -712,8 +712,7 @@ static int ring_kernel_sq_db(struct c4iw_qp *qhp, u16 inc) ...@@ -712,8 +712,7 @@ static int ring_kernel_sq_db(struct c4iw_qp *qhp, u16 inc)
spin_lock_irqsave(&qhp->rhp->lock, flags); spin_lock_irqsave(&qhp->rhp->lock, flags);
spin_lock(&qhp->lock); spin_lock(&qhp->lock);
if (qhp->rhp->db_state == NORMAL) if (qhp->rhp->db_state == NORMAL)
t4_ring_sq_db(&qhp->wq, inc, t4_ring_sq_db(&qhp->wq, inc, NULL);
is_t5(qhp->rhp->rdev.lldi.adapter_type), NULL);
else { else {
add_to_fc_list(&qhp->rhp->db_fc_list, &qhp->db_fc_entry); add_to_fc_list(&qhp->rhp->db_fc_list, &qhp->db_fc_entry);
qhp->wq.sq.wq_pidx_inc += inc; qhp->wq.sq.wq_pidx_inc += inc;
...@@ -730,8 +729,7 @@ static int ring_kernel_rq_db(struct c4iw_qp *qhp, u16 inc) ...@@ -730,8 +729,7 @@ static int ring_kernel_rq_db(struct c4iw_qp *qhp, u16 inc)
spin_lock_irqsave(&qhp->rhp->lock, flags); spin_lock_irqsave(&qhp->rhp->lock, flags);
spin_lock(&qhp->lock); spin_lock(&qhp->lock);
if (qhp->rhp->db_state == NORMAL) if (qhp->rhp->db_state == NORMAL)
t4_ring_rq_db(&qhp->wq, inc, t4_ring_rq_db(&qhp->wq, inc, NULL);
is_t5(qhp->rhp->rdev.lldi.adapter_type), NULL);
else { else {
add_to_fc_list(&qhp->rhp->db_fc_list, &qhp->db_fc_entry); add_to_fc_list(&qhp->rhp->db_fc_list, &qhp->db_fc_entry);
qhp->wq.rq.wq_pidx_inc += inc; qhp->wq.rq.wq_pidx_inc += inc;
...@@ -817,7 +815,7 @@ int c4iw_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, ...@@ -817,7 +815,7 @@ int c4iw_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
fw_opcode = FW_RI_FR_NSMR_WR; fw_opcode = FW_RI_FR_NSMR_WR;
swsqe->opcode = FW_RI_FAST_REGISTER; swsqe->opcode = FW_RI_FAST_REGISTER;
err = build_fastreg(&qhp->wq.sq, wqe, wr, &len16, err = build_fastreg(&qhp->wq.sq, wqe, wr, &len16,
is_t5( !is_t4(
qhp->rhp->rdev.lldi.adapter_type) ? qhp->rhp->rdev.lldi.adapter_type) ?
1 : 0); 1 : 0);
break; break;
...@@ -860,8 +858,7 @@ int c4iw_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, ...@@ -860,8 +858,7 @@ int c4iw_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
idx += DIV_ROUND_UP(len16*16, T4_EQ_ENTRY_SIZE); idx += DIV_ROUND_UP(len16*16, T4_EQ_ENTRY_SIZE);
} }
if (!qhp->rhp->rdev.status_page->db_off) { if (!qhp->rhp->rdev.status_page->db_off) {
t4_ring_sq_db(&qhp->wq, idx, t4_ring_sq_db(&qhp->wq, idx, wqe);
is_t5(qhp->rhp->rdev.lldi.adapter_type), wqe);
spin_unlock_irqrestore(&qhp->lock, flag); spin_unlock_irqrestore(&qhp->lock, flag);
} else { } else {
spin_unlock_irqrestore(&qhp->lock, flag); spin_unlock_irqrestore(&qhp->lock, flag);
...@@ -934,8 +931,7 @@ int c4iw_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr, ...@@ -934,8 +931,7 @@ int c4iw_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,
num_wrs--; num_wrs--;
} }
if (!qhp->rhp->rdev.status_page->db_off) { if (!qhp->rhp->rdev.status_page->db_off) {
t4_ring_rq_db(&qhp->wq, idx, t4_ring_rq_db(&qhp->wq, idx, wqe);
is_t5(qhp->rhp->rdev.lldi.adapter_type), wqe);
spin_unlock_irqrestore(&qhp->lock, flag); spin_unlock_irqrestore(&qhp->lock, flag);
} else { } else {
spin_unlock_irqrestore(&qhp->lock, flag); spin_unlock_irqrestore(&qhp->lock, flag);
...@@ -1875,7 +1871,7 @@ int c4iw_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, ...@@ -1875,7 +1871,7 @@ int c4iw_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
attrs.rq_db_inc = attr->rq_psn; attrs.rq_db_inc = attr->rq_psn;
mask |= (attr_mask & IB_QP_SQ_PSN) ? C4IW_QP_ATTR_SQ_DB : 0; mask |= (attr_mask & IB_QP_SQ_PSN) ? C4IW_QP_ATTR_SQ_DB : 0;
mask |= (attr_mask & IB_QP_RQ_PSN) ? C4IW_QP_ATTR_RQ_DB : 0; mask |= (attr_mask & IB_QP_RQ_PSN) ? C4IW_QP_ATTR_RQ_DB : 0;
if (is_t5(to_c4iw_qp(ibqp)->rhp->rdev.lldi.adapter_type) && if (!is_t4(to_c4iw_qp(ibqp)->rhp->rdev.lldi.adapter_type) &&
(mask & (C4IW_QP_ATTR_SQ_DB|C4IW_QP_ATTR_RQ_DB))) (mask & (C4IW_QP_ATTR_SQ_DB|C4IW_QP_ATTR_RQ_DB)))
return -EINVAL; return -EINVAL;
......
...@@ -455,8 +455,7 @@ static inline void pio_copy(u64 __iomem *dst, u64 *src) ...@@ -455,8 +455,7 @@ static inline void pio_copy(u64 __iomem *dst, u64 *src)
} }
} }
static inline void t4_ring_sq_db(struct t4_wq *wq, u16 inc, u8 t5, static inline void t4_ring_sq_db(struct t4_wq *wq, u16 inc, union t4_wr *wqe)
union t4_wr *wqe)
{ {
/* Flush host queue memory writes. */ /* Flush host queue memory writes. */
...@@ -482,7 +481,7 @@ static inline void t4_ring_sq_db(struct t4_wq *wq, u16 inc, u8 t5, ...@@ -482,7 +481,7 @@ static inline void t4_ring_sq_db(struct t4_wq *wq, u16 inc, u8 t5,
writel(QID_V(wq->sq.qid) | PIDX_V(inc), wq->db); writel(QID_V(wq->sq.qid) | PIDX_V(inc), wq->db);
} }
static inline void t4_ring_rq_db(struct t4_wq *wq, u16 inc, u8 t5, static inline void t4_ring_rq_db(struct t4_wq *wq, u16 inc,
union t4_recv_wr *wqe) union t4_recv_wr *wqe)
{ {
......
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