* Re: [PATCH net-next 3/7] qed: Add support for RoCE hw init
[not found] <1475348401-31392-4-git-send-email-Yuval.Mintz@caviumnetworks.com>
@ 2022-10-07 15:48 ` Bjorn Helgaas
2022-10-10 21:44 ` Bjorn Helgaas
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2022-10-07 15:48 UTC (permalink / raw)
To: Yuval Mintz
Cc: netdev, davem, linux-rdma, Ram.Amrani, Michal.Kalderon,
Ariel.Elior, dledford, Manish Chopra, linux-pci
[+cc Manish, linux-pci]
On Sat, Oct 01, 2016 at 09:59:57PM +0300, Yuval Mintz wrote:
> From: Ram Amrani <Ram.Amrani@caviumnetworks.com>
>
> This adds the backbone required for the various HW initalizations
> which are necessary for the qedr driver - FW notification, resource
> initializations, etc.
> ...
> diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c b/drivers/net/ethernet/qlogic/qed/qed_roce.c
> ...
> + /* Check atomic operations support in PCI configuration space. */
> + pci_read_config_dword(cdev->pdev,
> + cdev->pdev->pcie_cap + PCI_EXP_DEVCTL2,
> + &pci_status_control);
> +
> + if (pci_status_control & PCI_EXP_DEVCTL2_LTR_EN)
> + SET_FIELD(dev->dev_caps, QED_RDMA_DEV_CAP_ATOMIC_OP, 1);
I don't understand this.
1) PCI_EXP_DEVCTL2 is a 16-bit register ("word"), not a 32-bit one
("dword").
2) QED_RDMA_DEV_CAP_ATOMIC_OP is set here but is not read anywhere
in this patch. Is it used by the qed device itself?
3) PCI_EXP_DEVCTL2_LTR_EN is for Latency Tolerance Reporting and is
not related to atomic ops. I don't know what
QED_RDMA_DEV_CAP_ATOMIC_OP means, but possibly one of these was
intended instead?
- PCI_EXP_DEVCAP2_ATOMIC_COMP32 means the device supports 32-bit
AtomicOps as a completer.
- PCI_EXP_DEVCAP2_ATOMIC_COMP64 means the device supports 64-bit
AtomicOps as a completer.
- PCI_EXP_DEVCAP2_ATOMIC_COMP128 means the device supports 128-bit
AtomicOps as a completer.
- PCI_EXP_DEVCTL2_ATOMIC_REQ means the device is allowed to
initiate AtomicOps.
(This code is now in qed_rdma.c)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next 3/7] qed: Add support for RoCE hw init
2022-10-07 15:48 ` [PATCH net-next 3/7] qed: Add support for RoCE hw init Bjorn Helgaas
@ 2022-10-10 21:44 ` Bjorn Helgaas
2022-10-18 10:10 ` Michal Kalderon
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2022-10-10 21:44 UTC (permalink / raw)
To: Ariel Elior, Manish Chopra
Cc: netdev, davem, linux-rdma, Ram.Amrani, Michal.Kalderon, dledford,
linux-pci, Yuval Mintz
[ping, updated Ariel's address]
On Fri, Oct 07, 2022 at 10:48:32AM -0500, Bjorn Helgaas wrote:
> On Sat, Oct 01, 2016 at 09:59:57PM +0300, Yuval Mintz wrote:
> > From: Ram Amrani <Ram.Amrani@caviumnetworks.com>
> >
> > This adds the backbone required for the various HW initalizations
> > which are necessary for the qedr driver - FW notification, resource
> > initializations, etc.
> > ...
>
> > diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c b/drivers/net/ethernet/qlogic/qed/qed_roce.c
> > ...
> > + /* Check atomic operations support in PCI configuration space. */
> > + pci_read_config_dword(cdev->pdev,
> > + cdev->pdev->pcie_cap + PCI_EXP_DEVCTL2,
> > + &pci_status_control);
> > +
> > + if (pci_status_control & PCI_EXP_DEVCTL2_LTR_EN)
> > + SET_FIELD(dev->dev_caps, QED_RDMA_DEV_CAP_ATOMIC_OP, 1);
>
> I don't understand this.
>
> 1) PCI_EXP_DEVCTL2 is a 16-bit register ("word"), not a 32-bit one
> ("dword").
>
> 2) QED_RDMA_DEV_CAP_ATOMIC_OP is set here but is not read anywhere
> in this patch. Is it used by the qed device itself?
>
> 3) PCI_EXP_DEVCTL2_LTR_EN is for Latency Tolerance Reporting and is
> not related to atomic ops. I don't know what
> QED_RDMA_DEV_CAP_ATOMIC_OP means, but possibly one of these was
> intended instead?
>
> - PCI_EXP_DEVCAP2_ATOMIC_COMP32 means the device supports 32-bit
> AtomicOps as a completer.
> - PCI_EXP_DEVCAP2_ATOMIC_COMP64 means the device supports 64-bit
> AtomicOps as a completer.
> - PCI_EXP_DEVCAP2_ATOMIC_COMP128 means the device supports 128-bit
> AtomicOps as a completer.
> - PCI_EXP_DEVCTL2_ATOMIC_REQ means the device is allowed to
> initiate AtomicOps.
>
> (This code is now in qed_rdma.c)
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH net-next 3/7] qed: Add support for RoCE hw init
2022-10-10 21:44 ` Bjorn Helgaas
@ 2022-10-18 10:10 ` Michal Kalderon
0 siblings, 0 replies; 3+ messages in thread
From: Michal Kalderon @ 2022-10-18 10:10 UTC (permalink / raw)
To: Bjorn Helgaas, Ariel Elior, Manish Chopra
Cc: netdev@vger.kernel.org, davem@davemloft.net,
linux-rdma@vger.kernel.org, dledford@redhat.com,
linux-pci@vger.kernel.org
> From: Bjorn Helgaas <helgaas@kernel.org>
> Sent: Tuesday, October 11, 2022 12:45 AM
>
> [ping, updated Ariel's address]
>
> On Fri, Oct 07, 2022 at 10:48:32AM -0500, Bjorn Helgaas wrote:
> > On Sat, Oct 01, 2016 at 09:59:57PM +0300, Yuval Mintz wrote:
> > > From: Ram Amrani <Ram.Amrani@caviumnetworks.com>
> > >
> > > This adds the backbone required for the various HW initalizations
> > > which are necessary for the qedr driver - FW notification, resource
> > > initializations, etc.
> > > ...
> >
> > > diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c
> b/drivers/net/ethernet/qlogic/qed/qed_roce.c
> > > ...
> > > + /* Check atomic operations support in PCI configuration space. */
> > > + pci_read_config_dword(cdev->pdev,
> > > + cdev->pdev->pcie_cap + PCI_EXP_DEVCTL2,
> > > + &pci_status_control);
> > > +
> > > + if (pci_status_control & PCI_EXP_DEVCTL2_LTR_EN)
> > > + SET_FIELD(dev->dev_caps,
> QED_RDMA_DEV_CAP_ATOMIC_OP, 1);
> >
> > I don't understand this.
> >
> > 1) PCI_EXP_DEVCTL2 is a 16-bit register ("word"), not a 32-bit one
> > ("dword").
> >
> > 2) QED_RDMA_DEV_CAP_ATOMIC_OP is set here but is not read
> anywhere
> > in this patch. Is it used by the qed device itself?
> >
> > 3) PCI_EXP_DEVCTL2_LTR_EN is for Latency Tolerance Reporting and is
> > not related to atomic ops. I don't know what
> > QED_RDMA_DEV_CAP_ATOMIC_OP means, but possibly one of these
> was
> > intended instead?
> >
> > - PCI_EXP_DEVCAP2_ATOMIC_COMP32 means the device supports 32-
> bit
> > AtomicOps as a completer.
> > - PCI_EXP_DEVCAP2_ATOMIC_COMP64 means the device supports 64-
> bit
> > AtomicOps as a completer.
> > - PCI_EXP_DEVCAP2_ATOMIC_COMP128 means the device supports
> 128-bit
> > AtomicOps as a completer.
> > - PCI_EXP_DEVCTL2_ATOMIC_REQ means the device is allowed to
> > initiate AtomicOps.
> >
> > (This code is now in qed_rdma.c)
Thanks for looking into this.
This seems like redundant code and left-overs for supporting the atomic operation verb.
Atomic support is handled by: qedr_pci_set_atomic and introduced with a proper implementation by commit-SHA 20c3ff6114b0c
This code in qed_rdma.c can safely be removed.
Thanks,
Michal
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-18 10:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1475348401-31392-4-git-send-email-Yuval.Mintz@caviumnetworks.com>
2022-10-07 15:48 ` [PATCH net-next 3/7] qed: Add support for RoCE hw init Bjorn Helgaas
2022-10-10 21:44 ` Bjorn Helgaas
2022-10-18 10:10 ` Michal Kalderon
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).