All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: bnxt: don't complain if TC flower can't be supported
@ 2020-07-17 20:59 Jakub Kicinski
  2020-07-17 22:05 ` Michael Chan
  2020-07-18  1:26 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-07-17 20:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, kernel-team, michael.chan, Jakub Kicinski

The fact that NETIF_F_HW_TC is not set should be a sufficient
indication to the user that TC offloads are not supported.
No need to bother users of older firmware versions with
pointless warnings on every boot.

Also, since the support is optional, bnxt_init_tc() should not
return an error in case FW is old, similarly to how error
is not returned when CONFIG_BNXT_FLOWER_OFFLOAD is not set.

With that we can add an error message to the caller, to warn
about actual unexpected failures.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c    | 5 ++++-
 drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 7 ++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 0911eb3b8007..a7e5ebe2d68a 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -12086,7 +12086,10 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 				goto init_err_pci_clean;
 			}
 		}
-		bnxt_init_tc(bp);
+		rc = bnxt_init_tc(bp);
+		if (rc)
+			netdev_err(dev, "Failed to initialize TC flower offload, err = %d.\n",
+				   rc);
 	}
 
 	bnxt_dl_register(bp);
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
index e82e5cf64d61..5e4429b14b8c 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
@@ -2000,11 +2000,8 @@ int bnxt_init_tc(struct bnxt *bp)
 	struct bnxt_tc_info *tc_info;
 	int rc;
 
-	if (bp->hwrm_spec_code < 0x10803) {
-		netdev_warn(bp->dev,
-			    "Firmware does not support TC flower offload.\n");
-		return -ENOTSUPP;
-	}
+	if (bp->hwrm_spec_code < 0x10803)
+		return 0;
 
 	tc_info = kzalloc(sizeof(*tc_info), GFP_KERNEL);
 	if (!tc_info)
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: bnxt: don't complain if TC flower can't be supported
  2020-07-17 20:59 [PATCH net-next] net: bnxt: don't complain if TC flower can't be supported Jakub Kicinski
@ 2020-07-17 22:05 ` Michael Chan
  2020-07-18  1:26 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Chan @ 2020-07-17 22:05 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: David Miller, Netdev, Kernel Team

On Fri, Jul 17, 2020 at 2:00 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> The fact that NETIF_F_HW_TC is not set should be a sufficient
> indication to the user that TC offloads are not supported.
> No need to bother users of older firmware versions with
> pointless warnings on every boot.
>
> Also, since the support is optional, bnxt_init_tc() should not
> return an error in case FW is old, similarly to how error
> is not returned when CONFIG_BNXT_FLOWER_OFFLOAD is not set.
>
> With that we can add an error message to the caller, to warn
> about actual unexpected failures.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Reviewed-by: Michael Chan <michael.chan@broadcom.com>

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: bnxt: don't complain if TC flower can't be supported
  2020-07-17 20:59 [PATCH net-next] net: bnxt: don't complain if TC flower can't be supported Jakub Kicinski
  2020-07-17 22:05 ` Michael Chan
@ 2020-07-18  1:26 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-07-18  1:26 UTC (permalink / raw)
  To: kuba; +Cc: netdev, kernel-team, michael.chan

From: Jakub Kicinski <kuba@kernel.org>
Date: Fri, 17 Jul 2020 13:59:58 -0700

> The fact that NETIF_F_HW_TC is not set should be a sufficient
> indication to the user that TC offloads are not supported.
> No need to bother users of older firmware versions with
> pointless warnings on every boot.
> 
> Also, since the support is optional, bnxt_init_tc() should not
> return an error in case FW is old, similarly to how error
> is not returned when CONFIG_BNXT_FLOWER_OFFLOAD is not set.
> 
> With that we can add an error message to the caller, to warn
> about actual unexpected failures.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Applied, thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-18  1:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17 20:59 [PATCH net-next] net: bnxt: don't complain if TC flower can't be supported Jakub Kicinski
2020-07-17 22:05 ` Michael Chan
2020-07-18  1:26 ` David Miller

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.