From: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
To: Hariprasad Shenai <hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org,
nirranjan-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH for-4.6] iw_cxgb4: Fix bar2 virtual address calculation for T4 adapters
Date: Mon, 4 Apr 2016 20:32:48 +0300 [thread overview]
Message-ID: <20160404173248.GG5264@leon.nu> (raw)
In-Reply-To: <1459747840-9583-1-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
On Mon, Apr 04, 2016 at 11:00:40AM +0530, Hariprasad Shenai wrote:
> For T4, kernel mode qps don't use the user doorbell. User mode qps during
> flow control db ringing are forced into kernel, where user doorbell is
> treated as kernel doorbell and proper bar2 offset in bar2 virtual space is
> calculated, which incase of T4 is a bogus address, causing a kernel panic
> due to illegal write during doorbell ringing.
> In case of T4, kernel mode qp bar2 virtual address should be 0. Added T4
> check during bar2 virtual address calculation to return 0. Fixed Bar2
> range checks based on bar2 physical address.
>
> Based on original work by Bharat Potnuri <bharat-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
>
> Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> Signed-off-by: Hariprasad Shenai <hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
A very minor nitpicks:
1. Please add IB or RDMA into the subject, so we will be able to see it
clearly in git log (iw_cxgb4 -> IB/iw_cxgb4).
2. Please add kernel panic observed, so it will be documented for other
users who can potentially experience this failure without your fix.
3. Please add Fixes annotation there the issue was introduced.
> ---
> drivers/infiniband/hw/cxgb4/cq.c | 2 +-
> drivers/infiniband/hw/cxgb4/qp.c | 6 +++++-
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
> index b4eeb783573c..b0b955724458 100644
> --- a/drivers/infiniband/hw/cxgb4/cq.c
> +++ b/drivers/infiniband/hw/cxgb4/cq.c
> @@ -162,7 +162,7 @@ static int create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq,
> 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) {
> + if (user && !cq->bar2_pa) {
> pr_warn(MOD "%s: cqid %u not in BAR2 range.\n",
> pci_name(rdev->lldi.pdev), cq->cqid);
> ret = -EINVAL;
> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
> index e17fb5d5e033..48ca455d057b 100644
> --- a/drivers/infiniband/hw/cxgb4/qp.c
> +++ b/drivers/infiniband/hw/cxgb4/qp.c
> @@ -185,6 +185,10 @@ void __iomem *c4iw_bar2_addrs(struct c4iw_rdev *rdev, unsigned int qid,
>
> if (pbar2_pa)
> *pbar2_pa = (rdev->bar2_pa + bar2_qoffset) & PAGE_MASK;
> +
> + if (is_t4(rdev->lldi.adapter_type))
> + return NULL;
> +
> return rdev->bar2_kva + bar2_qoffset;
> }
>
> @@ -270,7 +274,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq,
> /*
> * User mode must have bar2 access.
> */
> - if (user && (!wq->sq.bar2_va || !wq->rq.bar2_va)) {
> + if (user && (!wq->sq.bar2_pa || !wq->rq.bar2_pa)) {
> pr_warn(MOD "%s: sqid %u or rqid %u not in BAR2 range.\n",
> pci_name(rdev->lldi.pdev), wq->sq.qid, wq->rq.qid);
> goto free_dma;
> --
> 2.3.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-04-04 17:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 5:30 [PATCH for-4.6] iw_cxgb4: Fix bar2 virtual address calculation for T4 adapters Hariprasad Shenai
[not found] ` <1459747840-9583-1-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-04-04 17:32 ` Leon Romanovsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-04-05 4:53 Hariprasad Shenai
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=20160404173248.GG5264@leon.nu \
--to=leon-2ukjvaziz/y@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=hariprasad-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;
as well as URLs for NNTP newsgroup(s).