net: bnxt: don't complain if TC flower can't be supported
authorJakub Kicinski <kuba@kernel.org>
Fri, 17 Jul 2020 20:59:58 +0000 (13:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 18 Jul 2020 01:26:20 +0000 (18:26 -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>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c

index 0911eb3b8007936d6a2789b21395f289e956cf7e..a7e5ebe2d68a7a20527f201aed4fab7e046a7512 100644 (file)
@@ -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);
index e82e5cf64d615e90ec75c5b5c8dfaee23468ee4c..5e4429b14b8ca6378c2bbd1e43f0036bc35589ca 100644 (file)
@@ -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)