From: Selvin Xavier <selvin.xavier@broadcom.com> To: Jason Gunthorpe <jgg@ziepe.ca> Cc: Parav Pandit <parav@mellanox.com>, Yi Zhang <yi.zhang@redhat.com>, Daniel Jurgens <danielj@mellanox.com>, "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>, Devesh Sharma <devesh.sharma@broadcom.com>, "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org> Subject: Re: regression: nvme rdma with bnxt_re0 broken Date: Fri, 12 Jul 2019 21:59:38 +0530 [thread overview] Message-ID: <CA+sbYW0F6Vgpa5SQX+9ge4EwWrMkJ4kQ-psEq11S00=-L_mVhg@mail.gmail.com> (raw) In-Reply-To: <20190712154044.GJ27512@ziepe.ca> On Fri, Jul 12, 2019 at 9:10 PM Jason Gunthorpe <jgg@ziepe.ca> wrote: > > On Fri, Jul 12, 2019 at 12:52:24PM +0000, Parav Pandit wrote: > > > > > > > From: Yi Zhang <yi.zhang@redhat.com> > > > Sent: Friday, July 12, 2019 5:11 PM > > > To: Parav Pandit <parav@mellanox.com>; Selvin Xavier > > > <selvin.xavier@broadcom.com> > > > Cc: Daniel Jurgens <danielj@mellanox.com>; linux-rdma@vger.kernel.org; > > > Devesh Sharma <devesh.sharma@broadcom.com>; linux- > > > nvme@lists.infradead.org > > > Subject: Re: regression: nvme rdma with bnxt_re0 broken > > > > > > Hi Parav > > > The nvme connect still failed[1], I've paste all the dmesg log to[2], pls check it. > > > > > > > > > [1] > > > [root@rdma-perf-07 ~]$ nvme connect -t rdma -a 172.31.40.125 -s 4420 -n > > > testnqn > > > Failed to write to /dev/nvme-fabrics: Connection reset by peer > > > [2] > > > https://pastebin.com/ipvak0Sp > > > > > > > I think vlan_id is not initialized to 0xffff due to which ipv4 entry addition also failed with my patch. > > This is probably solves it. Not sure. I am not much familiar with it. > > > > Selvin, > > Can you please take a look? > > > > From 7b55e1d4500259cf7c02fb4d9fbbeb5ad1cfc623 Mon Sep 17 00:00:00 2001 > > From: Parav Pandit <parav@mellanox.com> > > Date: Fri, 12 Jul 2019 04:34:52 -0500 > > Subject: [PATCH v1] IB/bnxt_re: Honor vlan_id in GID entry comparison > > > > GID entry consist of GID, vlan, netdev and smac. > > Extend GID duplicate check companions to consider vlan_id as well > > to support IPv6 VLAN based link local addresses. > > > > GID deletion based on only GID comparision is not correct. > > It needs further fixes. > > > > Fixes: 823b23da7113 ("IB/core: Allow vlan link local address based RoCE GIDs") > > Change-Id: I2e026ec8065c8425ba24fad8525323d112a2f4e4 > > Signed-off-by: Parav Pandit <parav@mellanox.com> > > drivers/infiniband/hw/bnxt_re/qplib_res.c | 5 +++++ > > drivers/infiniband/hw/bnxt_re/qplib_sp.c | 7 ++++++- > > drivers/infiniband/hw/bnxt_re/qplib_sp.h | 1 + > > 3 files changed, 12 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c > > index 37928b1111df..216648b640ce 100644 > > +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c > > @@ -488,6 +488,8 @@ static int bnxt_qplib_alloc_sgid_tbl(struct bnxt_qplib_res *res, > > struct bnxt_qplib_sgid_tbl *sgid_tbl, > > u16 max) > > { > > + u16 i; > > + > > sgid_tbl->tbl = kcalloc(max, sizeof(struct bnxt_qplib_gid), GFP_KERNEL); > > if (!sgid_tbl->tbl) > > return -ENOMEM; > > @@ -500,6 +502,9 @@ static int bnxt_qplib_alloc_sgid_tbl(struct bnxt_qplib_res *res, > > if (!sgid_tbl->ctx) > > goto out_free2; > > > > + for (i = 0; i < max; i++) > > + sgid_tbl->tbl[i].vlan_id = 0xffff; > > + > > sgid_tbl->vlan = kcalloc(max, sizeof(u8), GFP_KERNEL); > > if (!sgid_tbl->vlan) > > goto out_free3; > > diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c > > index 48793d3512ac..0d90be88685f 100644 > > +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c > > @@ -236,6 +236,9 @@ int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, > > return -ENOMEM; > > } > > for (index = 0; index < sgid_tbl->max; index++) { > > + /* FIXME: GID delete should happen based on index > > + * and refcount > > + */ > > if (!memcmp(&sgid_tbl->tbl[index], gid, sizeof(*gid))) > > break; > > } > > @@ -296,7 +299,8 @@ int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, > > } > > free_idx = sgid_tbl->max; > > for (i = 0; i < sgid_tbl->max; i++) { > > - if (!memcmp(&sgid_tbl->tbl[i], gid, sizeof(*gid))) { > > + if (!memcmp(&sgid_tbl->tbl[i], gid, sizeof(*gid)) && > > + sgid_tbl->tbl[i].vlan_id == vlan_id) { > > dev_dbg(&res->pdev->dev, > > "SGID entry already exist in entry %d!\n", i); > > bnxt guys: please just delete this duplicate detection code from the > driver. Every GID provided from the core must be programmed into the > given gid table index. Jason, This check is required in bnxt_re because the HW need only one entry in its table for RoCE V1 and RoCE v2 Gids. Sending the second add_gid for RoCE V2 (with the same gid as RoCE v1) to the HW returns failure. So driver handles this using a ref count. During delete_gid, the entry in the HW is deleted only if the refcount is zero. Thanks, Selvin > > Jason
WARNING: multiple messages have this Message-ID (diff)
From: selvin.xavier@broadcom.com (Selvin Xavier) Subject: regression: nvme rdma with bnxt_re0 broken Date: Fri, 12 Jul 2019 21:59:38 +0530 [thread overview] Message-ID: <CA+sbYW0F6Vgpa5SQX+9ge4EwWrMkJ4kQ-psEq11S00=-L_mVhg@mail.gmail.com> (raw) In-Reply-To: <20190712154044.GJ27512@ziepe.ca> On Fri, Jul 12, 2019@9:10 PM Jason Gunthorpe <jgg@ziepe.ca> wrote: > > On Fri, Jul 12, 2019@12:52:24PM +0000, Parav Pandit wrote: > > > > > > > From: Yi Zhang <yi.zhang at redhat.com> > > > Sent: Friday, July 12, 2019 5:11 PM > > > To: Parav Pandit <parav at mellanox.com>; Selvin Xavier > > > <selvin.xavier at broadcom.com> > > > Cc: Daniel Jurgens <danielj at mellanox.com>; linux-rdma at vger.kernel.org; > > > Devesh Sharma <devesh.sharma at broadcom.com>; linux- > > > nvme at lists.infradead.org > > > Subject: Re: regression: nvme rdma with bnxt_re0 broken > > > > > > Hi Parav > > > The nvme connect still failed[1], I've paste all the dmesg log to[2], pls check it. > > > > > > > > > [1] > > > [root at rdma-perf-07 ~]$ nvme connect -t rdma -a 172.31.40.125 -s 4420 -n > > > testnqn > > > Failed to write to /dev/nvme-fabrics: Connection reset by peer > > > [2] > > > https://pastebin.com/ipvak0Sp > > > > > > > I think vlan_id is not initialized to 0xffff due to which ipv4 entry addition also failed with my patch. > > This is probably solves it. Not sure. I am not much familiar with it. > > > > Selvin, > > Can you please take a look? > > > > From 7b55e1d4500259cf7c02fb4d9fbbeb5ad1cfc623 Mon Sep 17 00:00:00 2001 > > From: Parav Pandit <parav at mellanox.com> > > Date: Fri, 12 Jul 2019 04:34:52 -0500 > > Subject: [PATCH v1] IB/bnxt_re: Honor vlan_id in GID entry comparison > > > > GID entry consist of GID, vlan, netdev and smac. > > Extend GID duplicate check companions to consider vlan_id as well > > to support IPv6 VLAN based link local addresses. > > > > GID deletion based on only GID comparision is not correct. > > It needs further fixes. > > > > Fixes: 823b23da7113 ("IB/core: Allow vlan link local address based RoCE GIDs") > > Change-Id: I2e026ec8065c8425ba24fad8525323d112a2f4e4 > > Signed-off-by: Parav Pandit <parav at mellanox.com> > > drivers/infiniband/hw/bnxt_re/qplib_res.c | 5 +++++ > > drivers/infiniband/hw/bnxt_re/qplib_sp.c | 7 ++++++- > > drivers/infiniband/hw/bnxt_re/qplib_sp.h | 1 + > > 3 files changed, 12 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c > > index 37928b1111df..216648b640ce 100644 > > +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c > > @@ -488,6 +488,8 @@ static int bnxt_qplib_alloc_sgid_tbl(struct bnxt_qplib_res *res, > > struct bnxt_qplib_sgid_tbl *sgid_tbl, > > u16 max) > > { > > + u16 i; > > + > > sgid_tbl->tbl = kcalloc(max, sizeof(struct bnxt_qplib_gid), GFP_KERNEL); > > if (!sgid_tbl->tbl) > > return -ENOMEM; > > @@ -500,6 +502,9 @@ static int bnxt_qplib_alloc_sgid_tbl(struct bnxt_qplib_res *res, > > if (!sgid_tbl->ctx) > > goto out_free2; > > > > + for (i = 0; i < max; i++) > > + sgid_tbl->tbl[i].vlan_id = 0xffff; > > + > > sgid_tbl->vlan = kcalloc(max, sizeof(u8), GFP_KERNEL); > > if (!sgid_tbl->vlan) > > goto out_free3; > > diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c > > index 48793d3512ac..0d90be88685f 100644 > > +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c > > @@ -236,6 +236,9 @@ int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, > > return -ENOMEM; > > } > > for (index = 0; index < sgid_tbl->max; index++) { > > + /* FIXME: GID delete should happen based on index > > + * and refcount > > + */ > > if (!memcmp(&sgid_tbl->tbl[index], gid, sizeof(*gid))) > > break; > > } > > @@ -296,7 +299,8 @@ int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, > > } > > free_idx = sgid_tbl->max; > > for (i = 0; i < sgid_tbl->max; i++) { > > - if (!memcmp(&sgid_tbl->tbl[i], gid, sizeof(*gid))) { > > + if (!memcmp(&sgid_tbl->tbl[i], gid, sizeof(*gid)) && > > + sgid_tbl->tbl[i].vlan_id == vlan_id) { > > dev_dbg(&res->pdev->dev, > > "SGID entry already exist in entry %d!\n", i); > > bnxt guys: please just delete this duplicate detection code from the > driver. Every GID provided from the core must be programmed into the > given gid table index. Jason, This check is required in bnxt_re because the HW need only one entry in its table for RoCE V1 and RoCE v2 Gids. Sending the second add_gid for RoCE V2 (with the same gid as RoCE v1) to the HW returns failure. So driver handles this using a ref count. During delete_gid, the entry in the HW is deleted only if the refcount is zero. Thanks, Selvin > > Jason
next prev parent reply other threads:[~2019-07-12 16:29 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <1310083272.27124086.1562836112586.JavaMail.zimbra@redhat.com> 2019-07-11 9:47 ` regression: nvme rdma with bnxt_re0 broken Yi Zhang 2019-07-11 12:54 ` Parav Pandit 2019-07-11 16:18 ` Parav Pandit 2019-07-11 16:18 ` Parav Pandit 2019-07-12 1:53 ` Yi Zhang 2019-07-12 1:53 ` Yi Zhang 2019-07-12 2:49 ` Parav Pandit 2019-07-12 2:49 ` Parav Pandit 2019-07-12 3:45 ` Selvin Xavier 2019-07-12 3:45 ` Selvin Xavier 2019-07-12 9:28 ` Parav Pandit 2019-07-12 9:28 ` Parav Pandit 2019-07-12 9:39 ` Parav Pandit 2019-07-12 9:39 ` Parav Pandit 2019-07-12 9:49 ` Parav Pandit 2019-07-12 9:49 ` Parav Pandit 2019-07-12 11:41 ` Yi Zhang 2019-07-12 11:41 ` Yi Zhang 2019-07-12 12:52 ` Parav Pandit 2019-07-12 12:52 ` Parav Pandit 2019-07-12 15:40 ` Jason Gunthorpe 2019-07-12 15:40 ` Jason Gunthorpe 2019-07-12 16:29 ` Selvin Xavier [this message] 2019-07-12 16:29 ` Selvin Xavier 2019-07-12 17:42 ` Jason Gunthorpe 2019-07-12 17:42 ` Jason Gunthorpe 2019-07-13 7:51 ` Selvin Xavier 2019-07-13 7:51 ` Selvin Xavier 2019-07-13 12:12 ` Jason Gunthorpe 2019-07-13 12:12 ` Jason Gunthorpe 2019-07-12 16:18 ` Selvin Xavier 2019-07-12 16:18 ` Selvin Xavier 2019-07-13 7:56 ` Yi Zhang 2019-07-13 7:56 ` Yi Zhang 2019-07-13 16:00 ` Selvin Xavier 2019-07-13 16:00 ` Selvin Xavier 2019-07-11 16:13 ` Sagi Grimberg 2019-07-11 16:13 ` Sagi Grimberg
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='CA+sbYW0F6Vgpa5SQX+9ge4EwWrMkJ4kQ-psEq11S00=-L_mVhg@mail.gmail.com' \ --to=selvin.xavier@broadcom.com \ --cc=danielj@mellanox.com \ --cc=devesh.sharma@broadcom.com \ --cc=jgg@ziepe.ca \ --cc=linux-nvme@lists.infradead.org \ --cc=linux-rdma@vger.kernel.org \ --cc=parav@mellanox.com \ --cc=yi.zhang@redhat.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.