public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Hariprasad Shenai <hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org,
	leedom-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org,
	nirranjan-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH for-4.1 2/2] iw_cxgb4: support for bar2 qid densities exceeding the page size
Date: Tue, 09 Jun 2015 10:03:14 -0400	[thread overview]
Message-ID: <1433858594.90034.14.camel@redhat.com> (raw)
In-Reply-To: <1433854392-6531-3-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2479 bytes --]

On Tue, 2015-06-09 at 18:23 +0530, Hariprasad Shenai wrote:
> Handle this configuration:
> 
>         Queues Per Page * SGE BAR2 Queue Register Area Size > Page Size
> 
> Use cxgb4_bar2_sge_qregs() to obtain the proper location within the
> bar2 region for a given qid.
> 
> Rework the DB and GTS write functions to make use of this bar2 info.
> 
> Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> Signed-off-by: Hariprasad Shenai <hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
> ---
>  drivers/infiniband/hw/cxgb4/cq.c       | 22 ++++++------
>  drivers/infiniband/hw/cxgb4/device.c   | 16 +++------
>  drivers/infiniband/hw/cxgb4/iw_cxgb4.h |  5 +--
>  drivers/infiniband/hw/cxgb4/qp.c       | 64 ++++++++++++++++++++++------------
>  drivers/infiniband/hw/cxgb4/t4.h       | 60 ++++++++++++++++++++-----------
>  5 files changed, 98 insertions(+), 69 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
> index 68ddb37..8e5bbcb 100644
> --- a/drivers/infiniband/hw/cxgb4/cq.c
> +++ b/drivers/infiniband/hw/cxgb4/cq.c
> @@ -156,19 +156,17 @@ static int create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq,
>  		goto err4;
>  
>  	cq->gen = 1;
> +	cq->gts = rdev->lldi.gts_reg;
>  	cq->rdev = rdev;
> -	if (user) {
> -		u32 off = (cq->cqid << rdev->cqshift) & PAGE_MASK;
>  
> -		cq->ugts = (u64)rdev->bar2_pa + off;
> -	} else if (is_t4(rdev->lldi.adapter_type)) {
> -		cq->gts = rdev->lldi.gts_reg;
> -		cq->qid_mask = -1U;
> -	} else {
> -		u32 off = ((cq->cqid << rdev->cqshift) & PAGE_MASK) + 12;
> -
> -		cq->gts = rdev->bar2_kva + off;
> -		cq->qid_mask = rdev->qpmask;
> +	cq->bar2_va = c4iw_bar2_addrs(rdev, cq->cqid, T4_BAR2_QTYPE_INGRESS,
> +				      &cq->bar2_qid,
> +				      user ? &cq->bar2_pa : NULL);
> +	if (user && !cq->bar2_va) {
> +		pr_warn(MOD "%s: cqid %u not in BAR2 range.\n",
> +			pci_name(rdev->lldi.pdev), cq->cqid);
> +		ret = -EINVAL;
> +		goto err4;
>  	}
>  	return 0;
>  err4:
> @@ -971,7 +969,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries,
>  		insert_mmap(ucontext, mm);
>  
>  		mm2->key = uresp.gts_key;
> -		mm2->addr = chp->cq.ugts;
> +		mm2->addr = (u64)(uintptr_t)chp->cq.bar2_pa;

Why are you using a cast here at all?  bar2_pa is already u64...


-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2015-06-09 14:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-09 12:53 [PATCH for-4.1 0/2] Adds support for user mode bar2 mapping and bar2 qid density Hariprasad Shenai
     [not found] ` <1433854392-6531-1-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2015-06-09 12:53   ` [PATCH for-4.1 1/2] cxgb4: Support for user mode bar2 mappings with T4 Hariprasad Shenai
2015-06-09 12:53   ` [PATCH for-4.1 2/2] iw_cxgb4: support for bar2 qid densities exceeding the page size Hariprasad Shenai
     [not found]     ` <1433854392-6531-3-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2015-06-09 14:03       ` Doug Ledford [this message]
     [not found]         ` <1433858594.90034.14.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-09 14:07           ` Steve Wise
2015-06-09 14:16             ` Doug Ledford
     [not found]               ` <1433859363.90034.19.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-09 14:18                 ` Steve Wise
2015-06-09 14:25                   ` Doug Ledford
2015-06-11  5:01   ` [PATCH for-4.1 0/2] Adds support for user mode bar2 mapping and bar2 qid density Doug Ledford
     [not found]     ` <1433998881.71666.147.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-11 14:08       ` Steve Wise
2015-06-11 14:10         ` Doug Ledford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433858594.90034.14.camel@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
    --cc=leedom-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nirranjan-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
    --cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox