Browse Source

i40e: flower: check if TC offload is enabled on a netdev

Since TC block changes drivers are required to check if
the TC hw offload flag is set on the interface themselves.

Fixes: 2f4b411a3d67 ("i40e: Enable cloud filters via tc-flower")
Fixes: 44ae12a768b7 ("net: sched: move the can_offload check from binding phase to rule insertion phase")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Amritha Nambiar <amritha.nambiar@intel.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski 7 years ago
parent
commit
b7051cb8da
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/net/ethernet/intel/i40e/i40e_main.c

+ 2 - 0
drivers/net/ethernet/intel/i40e/i40e_main.c

@@ -7505,6 +7505,8 @@ static int i40e_setup_tc_cls_flower(struct i40e_netdev_priv *np,
 {
 {
 	struct i40e_vsi *vsi = np->vsi;
 	struct i40e_vsi *vsi = np->vsi;
 
 
+	if (!tc_can_offload(vsi->netdev))
+		return -EOPNOTSUPP;
 	if (cls_flower->common.chain_index)
 	if (cls_flower->common.chain_index)
 		return -EOPNOTSUPP;
 		return -EOPNOTSUPP;