diff mbox series

[net-next,v1,3/3] bnxt_en: only set dev->queue_mgmt_ops if BNXT_SUPPORTS_NTUPLE_VNIC

Message ID 20240729205459.2583533-4-dw@davidwei.uk (mailing list archive)
State Superseded
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: 42 this patch: 42
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: 43 this patch: 43
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: 45 this patch: 45
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 18 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 warning net-next-2024-07-30--03-00 (tests: 675)

Commit Message

David Wei July 29, 2024, 8:54 p.m. UTC
The queue API calls bnxt_hwrm_vnic_update() to stop/start the flow of
packets. It can only be called if BNXT_SUPPORTS_NTUPLE_VNIC(), so key
support for it by only setting queue_mgmt_ops if this is true.

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

Comments

Wojciech Drewek July 30, 2024, 10:33 a.m. UTC | #1
On 29.07.2024 22:54, David Wei wrote:
> The queue API calls bnxt_hwrm_vnic_update() to stop/start the flow of
> packets. It can only be called if BNXT_SUPPORTS_NTUPLE_VNIC(), so key
> support for it by only setting queue_mgmt_ops if this is true.
> 
> Signed-off-by: David Wei <dw@davidwei.uk>
> ---

Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>

>  drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index ce60c9322fe6..2801ae94d87b 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -15713,7 +15713,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);
> @@ -15892,8 +15891,10 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  
>  	INIT_LIST_HEAD(&bp->usr_fltr_list);
>  
> -	if (BNXT_SUPPORTS_NTUPLE_VNIC(bp))
> +	if (BNXT_SUPPORTS_NTUPLE_VNIC(bp)) {
>  		bp->rss_cap |= BNXT_RSS_CAP_MULTI_RSS_CTX;
> +		dev->queue_mgmt_ops = &bnxt_queue_mgmt_ops;
> +	}
>  
>  	rc = register_netdev(dev);
>  	if (rc)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index ce60c9322fe6..2801ae94d87b 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -15713,7 +15713,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);
@@ -15892,8 +15891,10 @@  static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	INIT_LIST_HEAD(&bp->usr_fltr_list);
 
-	if (BNXT_SUPPORTS_NTUPLE_VNIC(bp))
+	if (BNXT_SUPPORTS_NTUPLE_VNIC(bp)) {
 		bp->rss_cap |= BNXT_RSS_CAP_MULTI_RSS_CTX;
+		dev->queue_mgmt_ops = &bnxt_queue_mgmt_ops;
+	}
 
 	rc = register_netdev(dev);
 	if (rc)