]> git.baikalelectronics.ru Git - kernel.git/commitdiff
i40e: Fix adding ADQ filter to TC0
authorGrzegorz Szczurek <grzegorzx.szczurek@intel.com>
Fri, 29 Apr 2022 12:27:08 +0000 (14:27 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 9 Jun 2022 15:53:43 +0000 (08:53 -0700)
Procedure of configure tc flower filters erroneously allows to create
filters on TC0 where unfiltered packets are also directed by default.
Issue was caused by insufficient checks of hw_tc parameter specifying
the hardware traffic class to pass matching packets to.

Fix checking hw_tc parameter which blocks creation of filters on TC0.

Fixes: e17fea180694 ("i40e: Enable cloud filters via tc-flower")
Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: Bharathi Sreenivas <bharathi.sreenivas@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 332a608dbaa68c48a9c5a6dd5ceaa734bf30d411..72576bb3e94d45e93158415d8840654e3e86f45d 100644 (file)
@@ -8542,6 +8542,11 @@ static int i40e_configure_clsflower(struct i40e_vsi *vsi,
                return -EOPNOTSUPP;
        }
 
+       if (!tc) {
+               dev_err(&pf->pdev->dev, "Unable to add filter because of invalid destination");
+               return -EINVAL;
+       }
+
        if (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state) ||
            test_bit(__I40E_RESET_INTR_RECEIVED, pf->state))
                return -EBUSY;