diff mbox series

[net-next,v3,6/6] bnxt_en: only set dev->queue_mgmt_ops if supported by FW

Message ID 20240808051518.3580248-7-dw@davidwei.uk (mailing list archive)
State Accepted
Commit 97cbf3d0accce0f29db0be3ac1b50d9d561d3206
Delegated to: Netdev Maintainers
Headers show
Series fix bnxt_en queue reset when queue is active | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 29 this patch: 29
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 29 this patch: 29
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 33 this patch: 33
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 2 this patch: 2
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-10--18-00 (tests: 707)

Commit Message

David Wei Aug. 8, 2024, 5:15 a.m. UTC
The queue API calls bnxt_hwrm_vnic_update() to stop/start the flow of
packets, which can only properly flush the pipeline if FW indicates
support.

Add a macro BNXT_SUPPORTS_QUEUE_API that checks for the required flags
and only set queue_mgmt_ops if true.

Signed-off-by: David Wei <dw@davidwei.uk>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++-
 drivers/net/ethernet/broadcom/bnxt/bnxt.h | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Taehee Yoo Aug. 8, 2024, 3:13 p.m. UTC | #1
On Thu, Aug 8, 2024 at 2:16 PM David Wei <dw@davidwei.uk> wrote:
>
Hi David,
Thank you so much for this work!

> The queue API calls bnxt_hwrm_vnic_update() to stop/start the flow of
> packets, which can only properly flush the pipeline if FW indicates
> support.
>
> Add a macro BNXT_SUPPORTS_QUEUE_API that checks for the required flags
> and only set queue_mgmt_ops if true.
>
> Signed-off-by: David Wei <dw@davidwei.uk>
> ---
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++-
> drivers/net/ethernet/broadcom/bnxt/bnxt.h | 3 +++
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 7762fa3b646a..85d4fa8c73ae 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -15717,7 +15717,6 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
> dev->stat_ops = &bnxt_stat_ops;
> dev->watchdog_timeo = BNXT_TX_TIMEOUT;
> dev->ethtool_ops = &bnxt_ethtool_ops;
> - dev->queue_mgmt_ops = &bnxt_queue_mgmt_ops;
> pci_set_drvdata(pdev, dev);
>
> rc = bnxt_alloc_hwrm_resources(bp);
> @@ -15898,6 +15897,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>
> if (BNXT_SUPPORTS_NTUPLE_VNIC(bp))
> bp->rss_cap |= BNXT_RSS_CAP_MULTI_RSS_CTX;
> + if (BNXT_SUPPORTS_QUEUE_API(bp))
> + dev->queue_mgmt_ops = &bnxt_queue_mgmt_ops;
>
> rc = register_netdev(dev);
> if (rc)
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> index a2233b2d9329..62e637c5be31 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> @@ -2451,6 +2451,9 @@ struct bnxt {
> #define BNXT_SUPPORTS_MULTI_RSS_CTX(bp) \
> (BNXT_PF(bp) && BNXT_SUPPORTS_NTUPLE_VNIC(bp) && \
> ((bp)->rss_cap & BNXT_RSS_CAP_MULTI_RSS_CTX))
> +#define BNXT_SUPPORTS_QUEUE_API(bp) \
> + (BNXT_PF(bp) && BNXT_SUPPORTS_NTUPLE_VNIC(bp) && \
> + ((bp)->fw_cap & BNXT_FW_CAP_VNIC_RE_FLUSH))
>
> u32 hwrm_spec_code;
> u16 hwrm_cmd_seq;
> --
> 2.43.5
>
>

What Broadcom NICs support BNXT_SUPPORTS_QUEUE_API?

I have been testing the device memory TCP feature with bnxt_en driver
and I'm using BCM57508, BCM57608, and BCM57412 NICs.
(BCM57508's firmware is too old, but BCM57608's firmware is the
latest, BCM57412 too).
Currently, I can't test the device memory TCP feature because my NICs
don't support BNXT_SUPPORTS_QUEUE_API.
The BCM57608 only supports the BNXT_SUPPORTS_NTUPLE_VNIC, but does not
support the BNXT_SUPPORTS_QUEUE_API.
The BCM57412 doesn't support both of them.
I think at least BCM57508 and BCM57608 should support this because
it's the same or newer product line as BCM57504 as far as I know.
Am I missing something?

Thanks a lot!
Taehee Yoo
David Wei Aug. 8, 2024, 3:42 p.m. UTC | #2
On 2024-08-08 08:13, Taehee Yoo wrote:
> On Thu, Aug 8, 2024 at 2:16 PM David Wei <dw@davidwei.uk> wrote:
>>
> Hi David,
> Thank you so much for this work!
> 
>> The queue API calls bnxt_hwrm_vnic_update() to stop/start the flow of
>> packets, which can only properly flush the pipeline if FW indicates
>> support.
>>
>> Add a macro BNXT_SUPPORTS_QUEUE_API that checks for the required flags
>> and only set queue_mgmt_ops if true.
>>
>> Signed-off-by: David Wei <dw@davidwei.uk>
>> ---
>> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++-
>> drivers/net/ethernet/broadcom/bnxt/bnxt.h | 3 +++
>> 2 files changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
>> index 7762fa3b646a..85d4fa8c73ae 100644
>> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
>> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
>> @@ -15717,7 +15717,6 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>> dev->stat_ops = &bnxt_stat_ops;
>> dev->watchdog_timeo = BNXT_TX_TIMEOUT;
>> dev->ethtool_ops = &bnxt_ethtool_ops;
>> - dev->queue_mgmt_ops = &bnxt_queue_mgmt_ops;
>> pci_set_drvdata(pdev, dev);
>>
>> rc = bnxt_alloc_hwrm_resources(bp);
>> @@ -15898,6 +15897,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>>
>> if (BNXT_SUPPORTS_NTUPLE_VNIC(bp))
>> bp->rss_cap |= BNXT_RSS_CAP_MULTI_RSS_CTX;
>> + if (BNXT_SUPPORTS_QUEUE_API(bp))
>> + dev->queue_mgmt_ops = &bnxt_queue_mgmt_ops;
>>
>> rc = register_netdev(dev);
>> if (rc)
>> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
>> index a2233b2d9329..62e637c5be31 100644
>> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
>> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
>> @@ -2451,6 +2451,9 @@ struct bnxt {
>> #define BNXT_SUPPORTS_MULTI_RSS_CTX(bp) \
>> (BNXT_PF(bp) && BNXT_SUPPORTS_NTUPLE_VNIC(bp) && \
>> ((bp)->rss_cap & BNXT_RSS_CAP_MULTI_RSS_CTX))
>> +#define BNXT_SUPPORTS_QUEUE_API(bp) \
>> + (BNXT_PF(bp) && BNXT_SUPPORTS_NTUPLE_VNIC(bp) && \
>> + ((bp)->fw_cap & BNXT_FW_CAP_VNIC_RE_FLUSH))
>>
>> u32 hwrm_spec_code;
>> u16 hwrm_cmd_seq;
>> --
>> 2.43.5
>>
>>
> 
> What Broadcom NICs support BNXT_SUPPORTS_QUEUE_API?
> 
> I have been testing the device memory TCP feature with bnxt_en driver
> and I'm using BCM57508, BCM57608, and BCM57412 NICs.
> (BCM57508's firmware is too old, but BCM57608's firmware is the
> latest, BCM57412 too).
> Currently, I can't test the device memory TCP feature because my NICs
> don't support BNXT_SUPPORTS_QUEUE_API.
> The BCM57608 only supports the BNXT_SUPPORTS_NTUPLE_VNIC, but does not
> support the BNXT_SUPPORTS_QUEUE_API.
> The BCM57412 doesn't support both of them.
> I think at least BCM57508 and BCM57608 should support this because
> it's the same or newer product line as BCM57504 as far as I know.
> Am I missing something?

The hardware is correct (Thor+) but there needs to be a new FW update
from Broadcom that returns VNIC_QCAPS_RESP_FLAGS_RE_FLUSH_CAP when
queried.

CC: Michael Chan <michael.chan@broadcom.com>

> 
> Thanks a lot!
> Taehee Yoo
Taehee Yoo Aug. 8, 2024, 4:38 p.m. UTC | #3
On Fri, Aug 9, 2024 at 12:42 AM David Wei <dw@davidwei.uk> wrote:
>
> On 2024-08-08 08:13, Taehee Yoo wrote:
> > On Thu, Aug 8, 2024 at 2:16 PM David Wei <dw@davidwei.uk> wrote:
> >>
> > Hi David,
> > Thank you so much for this work!
> >
> >> The queue API calls bnxt_hwrm_vnic_update() to stop/start the flow of
> >> packets, which can only properly flush the pipeline if FW indicates
> >> support.
> >>
> >> Add a macro BNXT_SUPPORTS_QUEUE_API that checks for the required flags
> >> and only set queue_mgmt_ops if true.
> >>
> >> Signed-off-by: David Wei <dw@davidwei.uk>
> >> ---
> >> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++-
> >> drivers/net/ethernet/broadcom/bnxt/bnxt.h | 3 +++
> >> 2 files changed, 5 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> >> index 7762fa3b646a..85d4fa8c73ae 100644
> >> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> >> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> >> @@ -15717,7 +15717,6 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
> >> dev->stat_ops = &bnxt_stat_ops;
> >> dev->watchdog_timeo = BNXT_TX_TIMEOUT;
> >> dev->ethtool_ops = &bnxt_ethtool_ops;
> >> - dev->queue_mgmt_ops = &bnxt_queue_mgmt_ops;
> >> pci_set_drvdata(pdev, dev);
> >>
> >> rc = bnxt_alloc_hwrm_resources(bp);
> >> @@ -15898,6 +15897,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
> >>
> >> if (BNXT_SUPPORTS_NTUPLE_VNIC(bp))
> >> bp->rss_cap |= BNXT_RSS_CAP_MULTI_RSS_CTX;
> >> + if (BNXT_SUPPORTS_QUEUE_API(bp))
> >> + dev->queue_mgmt_ops = &bnxt_queue_mgmt_ops;
> >>
> >> rc = register_netdev(dev);
> >> if (rc)
> >> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> >> index a2233b2d9329..62e637c5be31 100644
> >> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> >> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> >> @@ -2451,6 +2451,9 @@ struct bnxt {
> >> #define BNXT_SUPPORTS_MULTI_RSS_CTX(bp) \
> >> (BNXT_PF(bp) && BNXT_SUPPORTS_NTUPLE_VNIC(bp) && \
> >> ((bp)->rss_cap & BNXT_RSS_CAP_MULTI_RSS_CTX))
> >> +#define BNXT_SUPPORTS_QUEUE_API(bp) \
> >> + (BNXT_PF(bp) && BNXT_SUPPORTS_NTUPLE_VNIC(bp) && \
> >> + ((bp)->fw_cap & BNXT_FW_CAP_VNIC_RE_FLUSH))
> >>
> >> u32 hwrm_spec_code;
> >> u16 hwrm_cmd_seq;
> >> --
> >> 2.43.5
> >>
> >>
> >
> > What Broadcom NICs support BNXT_SUPPORTS_QUEUE_API?
> >
> > I have been testing the device memory TCP feature with bnxt_en driver
> > and I'm using BCM57508, BCM57608, and BCM57412 NICs.
> > (BCM57508's firmware is too old, but BCM57608's firmware is the
> > latest, BCM57412 too).
> > Currently, I can't test the device memory TCP feature because my NICs
> > don't support BNXT_SUPPORTS_QUEUE_API.
> > The BCM57608 only supports the BNXT_SUPPORTS_NTUPLE_VNIC, but does not
> > support the BNXT_SUPPORTS_QUEUE_API.
> > The BCM57412 doesn't support both of them.
> > I think at least BCM57508 and BCM57608 should support this because
> > it's the same or newer product line as BCM57504 as far as I know.
> > Am I missing something?
>
> The hardware is correct (Thor+) but there needs to be a new FW update
> from Broadcom that returns VNIC_QCAPS_RESP_FLAGS_RE_FLUSH_CAP when
> queried.

Thanks a lot for the reply :)

I will try to check the new firmware.

Thanks a lot,
Taehee Yoo

>
> CC: Michael Chan <michael.chan@broadcom.com>
>
> >
> > Thanks a lot!
> > Taehee Yoo
Michael Chan Aug. 8, 2024, 4:52 p.m. UTC | #4
On Thu, Aug 8, 2024 at 8:42 AM David Wei <dw@davidwei.uk> wrote:
>
> On 2024-08-08 08:13, Taehee Yoo wrote:
> > What Broadcom NICs support BNXT_SUPPORTS_QUEUE_API?
> >
> > I have been testing the device memory TCP feature with bnxt_en driver
> > and I'm using BCM57508, BCM57608, and BCM57412 NICs.
> > (BCM57508's firmware is too old, but BCM57608's firmware is the
> > latest, BCM57412 too).
> > Currently, I can't test the device memory TCP feature because my NICs
> > don't support BNXT_SUPPORTS_QUEUE_API.
> > The BCM57608 only supports the BNXT_SUPPORTS_NTUPLE_VNIC, but does not
> > support the BNXT_SUPPORTS_QUEUE_API.
> > The BCM57412 doesn't support both of them.
> > I think at least BCM57508 and BCM57608 should support this because
> > it's the same or newer product line as BCM57504 as far as I know.
> > Am I missing something?
>
> The hardware is correct (Thor+) but there needs to be a new FW update
> from Broadcom that returns VNIC_QCAPS_RESP_FLAGS_RE_FLUSH_CAP when
> queried.
>

BCM5760X and BCM5750X support it but will require a firmware update.
I need to check when the new firmware will go into production.  The
older firmware will work to some extent but our internal testing shows
that the chip can sometimes hang when an RX ring is restarted with
heavy traffic running.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 7762fa3b646a..85d4fa8c73ae 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -15717,7 +15717,6 @@  static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	dev->stat_ops = &bnxt_stat_ops;
 	dev->watchdog_timeo = BNXT_TX_TIMEOUT;
 	dev->ethtool_ops = &bnxt_ethtool_ops;
-	dev->queue_mgmt_ops = &bnxt_queue_mgmt_ops;
 	pci_set_drvdata(pdev, dev);
 
 	rc = bnxt_alloc_hwrm_resources(bp);
@@ -15898,6 +15897,8 @@  static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	if (BNXT_SUPPORTS_NTUPLE_VNIC(bp))
 		bp->rss_cap |= BNXT_RSS_CAP_MULTI_RSS_CTX;
+	if (BNXT_SUPPORTS_QUEUE_API(bp))
+		dev->queue_mgmt_ops = &bnxt_queue_mgmt_ops;
 
 	rc = register_netdev(dev);
 	if (rc)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index a2233b2d9329..62e637c5be31 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -2451,6 +2451,9 @@  struct bnxt {
 #define BNXT_SUPPORTS_MULTI_RSS_CTX(bp)				\
 	(BNXT_PF(bp) && BNXT_SUPPORTS_NTUPLE_VNIC(bp) &&	\
 	 ((bp)->rss_cap & BNXT_RSS_CAP_MULTI_RSS_CTX))
+#define BNXT_SUPPORTS_QUEUE_API(bp)				\
+	(BNXT_PF(bp) && BNXT_SUPPORTS_NTUPLE_VNIC(bp) &&	\
+	 ((bp)->fw_cap & BNXT_FW_CAP_VNIC_RE_FLUSH))
 
 	u32			hwrm_spec_code;
 	u16			hwrm_cmd_seq;