Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44ae12a7 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

net: sched: move the can_offload check from binding phase to rule insertion phase



This restores the original behaviour before the block callbacks were
introduced. Allow the drivers to do binding of block always, no matter
if the NETIF_F_HW_TC feature is on or off. Move the check to the block
callback which is called for rule insertion.

Reported-by: default avatarAlexander Duyck <alexander.duyck@gmail.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0b5a89ca
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7347,7 +7347,7 @@ static int bnxt_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
{
	struct bnxt *bp = cb_priv;

	if (!bnxt_tc_flower_enabled(bp))
	if (!bnxt_tc_flower_enabled(bp) || !tc_can_offload(bp->dev))
		return -EOPNOTSUPP;

	switch (type) {
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ static int bnxt_vf_rep_setup_tc_block_cb(enum tc_setup_type type,
	struct bnxt *bp = vf_rep->bp;
	int vf_fid = bp->pf.vf[vf_rep->vf_idx].fw_fid;

	if (!bnxt_tc_flower_enabled(vf_rep->bp))
	if (!bnxt_tc_flower_enabled(vf_rep->bp) || !tc_can_offload(bp->dev))
		return -EOPNOTSUPP;

	switch (type) {
+3 −0
Original line number Diff line number Diff line
@@ -2943,6 +2943,9 @@ static int cxgb_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
		return -EINVAL;
	}

	if (!tc_can_offload(dev))
		return -EOPNOTSUPP;

	switch (type) {
	case TC_SETUP_CLSU32:
		return cxgb_setup_tc_cls_u32(dev, type_data);
+3 −0
Original line number Diff line number Diff line
@@ -9386,6 +9386,9 @@ static int ixgbe_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
{
	struct ixgbe_adapter *adapter = cb_priv;

	if (!tc_can_offload(adapter->netdev))
		return -EOPNOTSUPP;

	switch (type) {
	case TC_SETUP_CLSU32:
		return ixgbe_setup_tc_cls_u32(adapter, type_data);
+3 −0
Original line number Diff line number Diff line
@@ -3106,6 +3106,9 @@ int mlx5e_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
{
	struct mlx5e_priv *priv = cb_priv;

	if (!tc_can_offload(priv->netdev))
		return -EOPNOTSUPP;

	switch (type) {
	case TC_SETUP_CLSFLOWER:
		return mlx5e_setup_tc_cls_flower(priv, type_data);
Loading