RDMA/vmw_pvrdma updates for 4.11
Subsystems (2)
cover RDMA/vmw_pvrdma updates for 4.11
Hi Doug,
Here are some minor updates we had for the VMware PVRDMA driver. These apply cleanly to your k.o/for-4.11 branch.
Thanks,
Adit
Adit Ranadive (2):
RDMA/vmw_pvrdma: Cleanup unused variables
RDMA/vmw_pvrdma: Dont hardcode QP header page
Aditya Sarwade (1):
RDMA/vmw_pvrdma: Activate device on ethernet link up
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h | 3 ++ drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h | 2 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 17 ++++++--- drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 42 ++++++++++------------- 4 files changed, 35 insertions(+), 29 deletions(-)
Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/3 RDMA/vmw_pvrdma: Cleanup unused variables
In reply to a message not in the archiveRemoved the unused nreq and redundant index variables. Moved hardcoded async and cq ring pages number to macro.
--- drivers/infiniband/hw/vmw_pvrdma/pvrdma.h | 2 ++ drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 4 ++-- drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 33 ++++++++++---------------- 3 files changed, 17 insertions(+), 22 deletions(-)
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h +2 -0
@@ -69,6 +69,8 @@*/ #define PCI_DEVICE_ID_VMWARE_PVRDMA 0x0820 +#define PVRDMA_NUM_RING_PAGES 4 +struct pvrdma_dev ;struct pvrdma_page_dir {
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +2 -2
@@ -857,7 +857,7 @@ static int pvrdma_pci_probe(struct pci_dev *pdev, dev->dsr->resp_slot_dma = (u64 )slot_dma;/* Async event ring */ - dev->dsr->async_ring_pages.num_pages =4 ; + dev->dsr->async_ring_pages.num_pages =PVRDMA_NUM_RING_PAGES ; ret =pvrdma_page_dir_init (dev, &dev->async_pdir, dev->dsr->async_ring_pages.num_pages, true);if (ret)
@@ -866,7 +866,7 @@ static int pvrdma_pci_probe(struct pci_dev *pdev, dev->dsr->async_ring_pages.pdir_dma = dev->async_pdir.dir_dma;/* CQ notification ring */ - dev->dsr->cq_ring_pages.num_pages =4 ; + dev->dsr->cq_ring_pages.num_pages =PVRDMA_NUM_RING_PAGES ; ret =pvrdma_page_dir_init (dev, &dev->cq_pdir, dev->dsr->cq_ring_pages.num_pages, true);if (ret)
drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c +13 -20
@@ -554,13 +554,13 @@ int pvrdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,return ret; } -static inline void *get_sq_wqe (struct pvrdma_qp *qp,int n) +static inline void *get_sq_wqe (struct pvrdma_qp *qp,unsigned int n) {return pvrdma_page_dir_get_ptr (&qp->pdir, qp->sq.offset + n * qp->sq.wqe_size); } -static inline void *get_rq_wqe (struct pvrdma_qp *qp,int n) +static inline void *get_rq_wqe (struct pvrdma_qp *qp,unsigned int n) {return pvrdma_page_dir_get_ptr (&qp->pdir, qp->rq.offset + n * qp->rq.wqe_size);
@@ -598,9 +598,7 @@ int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,unsigned long flags;struct pvrdma_sq_wqe_hdr *wqe_hdr;struct pvrdma_sge *sge; -int i, index; -int nreq; -int ret; +int i, ret;/* * In states lower than RTS, we can fail immediately. In other states,
@@ -613,9 +611,8 @@ int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,spin_lock_irqsave (&qp->sq.lock, flags); - index =pvrdma_idx (&qp->sq.ring->prod_tail, qp->sq.wqe_cnt); -for (nreq =0 ; wr; nreq++, wr = wr->next) { -unsigned int tail; +while (wr) { +unsigned int tail =0 ;if (unlikely (!pvrdma_idx_ring_has_space ( qp->sq.ring, qp->sq.wqe_cnt, &tail))) {
@@ -680,7 +677,7 @@ int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, } } - wqe_hdr = (struct pvrdma_sq_wqe_hdr *)get_sq_wqe (qp, index); + wqe_hdr = (struct pvrdma_sq_wqe_hdr *)get_sq_wqe (qp, tail);memset (wqe_hdr,0 ,sizeof (*wqe_hdr)); wqe_hdr->wr_id = wr->wr_id; wqe_hdr->num_sge = wr->num_sge;
@@ -771,12 +768,11 @@ int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,/* Make sure wqe is written before index update */ smp_wmb (); - index++; -if (unlikely (index >= qp->sq.wqe_cnt)) - index =0 ;/* Update shared sq ring */ pvrdma_idx_ring_inc (&qp->sq.ring->prod_tail, qp->sq.wqe_cnt); + + wr = wr->next; } ret =0 ;
@@ -806,7 +802,6 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,struct pvrdma_qp *qp =to_vqp (ibqp);struct pvrdma_rq_wqe_hdr *wqe_hdr;struct pvrdma_sge *sge; -int index, nreq;int ret =0 ;int i;
@@ -821,9 +816,8 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,spin_lock_irqsave (&qp->rq.lock, flags); - index =pvrdma_idx (&qp->rq.ring->prod_tail, qp->rq.wqe_cnt); -for (nreq =0 ; wr; nreq++, wr = wr->next) { -unsigned int tail; +while (wr) { +unsigned int tail =0 ;if (unlikely (wr->num_sge > qp->rq.max_sg || wr->num_sge <0 )) {
@@ -843,7 +837,7 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, goto out; } - wqe_hdr = (struct pvrdma_rq_wqe_hdr *)get_rq_wqe (qp, index); + wqe_hdr = (struct pvrdma_rq_wqe_hdr *)get_rq_wqe (qp, tail); wqe_hdr->wr_id = wr->wr_id; wqe_hdr->num_sge = wr->num_sge; wqe_hdr->total_len =0 ;
@@ -859,12 +853,11 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,/* Make sure wqe is written before index update */ smp_wmb (); - index++; -if (unlikely (index >= qp->rq.wqe_cnt)) - index =0 ;/* Update shared rq ring */ pvrdma_idx_ring_inc (&qp->rq.ring->prod_tail, qp->rq.wqe_cnt); + + wr = wr->next; }spin_unlock_irqrestore (&qp->rq.lock, flags);
Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/3 RDMA/vmw_pvrdma: Dont hardcode QP header page
In reply to a message not in the archiveMoved the header page count to a macro.
--- drivers/infiniband/hw/vmw_pvrdma/pvrdma.h | 1 + drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h +1 -0
@@ -70,6 +70,7 @@#define PCI_DEVICE_ID_VMWARE_PVRDMA 0x0820#define PVRDMA_NUM_RING_PAGES 4 +#define PVRDMA_QP_NUM_HEADER_PAGES 1struct pvrdma_dev ;
drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c +5 -4
@@ -170,8 +170,9 @@ static int pvrdma_set_sq_size(struct pvrdma_dev *dev, struct ib_qp_cap *req_cap,sizeof (struct pvrdma_sge ) * qp->sq.max_sg);/* Note: one extra page for the header. */ - qp->npages_send =1 + (qp->sq.wqe_cnt * qp->sq.wqe_size + -PAGE_SIZE -1 ) /PAGE_SIZE ; + qp->npages_send =PVRDMA_QP_NUM_HEADER_PAGES + + (qp->sq.wqe_cnt * qp->sq.wqe_size +PAGE_SIZE -1 ) / +PAGE_SIZE ;return 0 ; }
@@ -288,7 +289,7 @@ struct ib_qp *pvrdma_create_qp(struct ib_pd *pd, qp->npages = qp->npages_send + qp->npages_recv;/* Skip header page. */ - qp->sq.offset =PAGE_SIZE ; + qp->sq.offset =PVRDMA_QP_NUM_HEADER_PAGES *PAGE_SIZE ;/* Recv queue pages are after send pages. */ qp->rq.offset = qp->npages_send *PAGE_SIZE ;
@@ -341,7 +342,7 @@ struct ib_qp *pvrdma_create_qp(struct ib_pd *pd, cmd->qp_type =ib_qp_type_to_pvrdma (init_attr->qp_type); cmd->access_flags =IB_ACCESS_LOCAL_WRITE ; cmd->total_chunks = qp->npages; - cmd->send_chunks = qp->npages_send -1 ; + cmd->send_chunks = qp->npages_send -PVRDMA_QP_NUM_HEADER_PAGES ; cmd->pdir_dma = qp->pdir.dir_dma; dev_dbg(&dev->pdev->dev, "create queuepair with %d, %d, %d, %d\n",
Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/3 RDMA/vmw_pvrdma: Activate device on ethernet link up
In reply to a message not in the archiveFrom: Aditya Sarwade <[email protected]>
Restore device state when ethernet link changes to active.
--- drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h | 2 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-)
drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h +1 -1
@@ -132,7 +132,7 @@ enum pvrdma_pci_resource {enum pvrdma_device_ctl {PVRDMA_DEVICE_CTL_ACTIVATE ,/* Activate device. */ -PVRDMA_DEVICE_CTL_QUIESCE ,/* Quiesce device. */ +PVRDMA_DEVICE_CTL_UNQUIESCE ,/* Unquiesce device. */ PVRDMA_DEVICE_CTL_RESET ,/* Reset device. */ };
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +11 -2
@@ -56,7 +56,7 @@#include "pvrdma.h" #define DRV_NAME "vmw_pvrdma" -#define DRV_VERSION "1.0.0.0-k" +#define DRV_VERSION "1.0.1.0-k"static DEFINE_MUTEX (pvrdma_device_list_lock);static LIST_HEAD (pvrdma_device_list);
@@ -659,7 +659,16 @@ static void pvrdma_netdevice_event_handle(struct pvrdma_dev *dev,pvrdma_dispatch_event (dev,1 ,IB_EVENT_PORT_ERR );break ;case NETDEV_UP : -pvrdma_dispatch_event (dev,1 ,IB_EVENT_PORT_ACTIVE ); +pvrdma_write_reg (dev,PVRDMA_REG_CTL , +PVRDMA_DEVICE_CTL_UNQUIESCE ); + +mb (); + +if (pvrdma_read_reg (dev,PVRDMA_REG_ERR )) +dev_err (&dev->pdev->dev, +"failed to activate device during link up\n" ); +else +pvrdma_dispatch_event (dev,1 ,IB_EVENT_PORT_ACTIVE );break ;default : dev_dbg(&dev->pdev->dev, "ignore netdevice event %ld on %s\n",
Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Boyer, Andrew
Tested-byRe: [PATCH 2/3] RDMA/vmw_pvrdma: Dont hardcode QP header page
In reply to a message not in the archiveQuoted 9 lines · On 2/22/17, 8:22 PM, "[email protected]…
Moved the header page count to a macro.
Reported-by Yuval Shaia <[email protected]>Signed-off-by Adit Ranadive <[email protected]>Reviewed-by Aditya Sarwade <[email protected]>---
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h| 1 +drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c| 9 +++++----2 files changed, 6 insertions(+), 4 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Boyer, Andrew
Tested-byRe: [PATCH 1/3] RDMA/vmw_pvrdma: Cleanup unused variables
In reply to a message not in the archiveQuoted 6 lines · On 2/22/17, 8:22 PM, "[email protected]…
Removed the unused nreq and redundant index variables. Moved hardcoded async and cq ring pages number to macro.
Reported-by Yuval Shaia <[email protected]>Signed-off-by Adit Ranadive <[email protected]>Reviewed-by Aditya Sarwade <[email protected]>
Quoted 6 lines
---
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h | 2 ++ drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 4 ++-- drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 33 ++++++++++---------------- 3 files changed, 17 insertions(+), 22 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 16 lines · Adit Ranadive
Hi Doug,
Here are some minor updates we had for the VMware PVRDMA driver. These
apply cleanly to your k.o/for-4.11 branch.Thanks,
AditAdit Ranadive (2):
RDMA/vmw_pvrdma: Cleanup unused variables
RDMA/vmw_pvrdma: Dont hardcode QP header pageAditya Sarwade (1):
RDMA/vmw_pvrdma: Activate device on ethernet link up
Quoted 6 lines
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h | 3 ++
drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h| 2 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 17 ++++++--- drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 42 ++++++++++---
----------4 files changed, 35 insertions(+), 29 deletions(-)
Thanks, series applied for -rc.
Signature · 9 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html