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

Commit 5cbe9102 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'flow_offload-hardware-priority-fixes'



Pablo Neira Ayuso says:

====================
flow_offload hardware priority fixes

This patchset contains two updates for the flow_offload users:

1) Pass the major tc priority to drivers so they do not have to
   lshift it. This is a preparation patch for the fix coming in
   patch #2.

2) Set the hardware priority from the netfilter basechain priority,
   some drivers break when using the existing hardware priority
   number that is set to zero.

v5: fix patch 2/2 to address a clang warning and to simplify
    the priority mapping.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 44ef3a03 3bc158f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3167,7 +3167,7 @@ mlx5e_flow_esw_attr_init(struct mlx5_esw_flow_attr *esw_attr,

	esw_attr->parse_attr = parse_attr;
	esw_attr->chain = f->common.chain_index;
	esw_attr->prio = TC_H_MAJ(f->common.prio) >> 16;
	esw_attr->prio = f->common.prio;

	esw_attr->in_rep = in_rep;
	esw_attr->in_mdev = in_mdev;
+1 −1
Original line number Diff line number Diff line
@@ -471,7 +471,7 @@ int mlxsw_sp_acl_rulei_commit(struct mlxsw_sp_acl_rule_info *rulei)
void mlxsw_sp_acl_rulei_priority(struct mlxsw_sp_acl_rule_info *rulei,
				 unsigned int priority)
{
	rulei->priority = priority >> 16;
	rulei->priority = priority;
}

void mlxsw_sp_acl_rulei_keymask_u32(struct mlxsw_sp_acl_rule_info *rulei,
+3 −9
Original line number Diff line number Diff line
@@ -13,12 +13,6 @@ struct ocelot_port_block {
	struct ocelot_port *port;
};

static u16 get_prio(u32 prio)
{
	/* prio starts from 0x1000 while the ids starts from 0 */
	return prio >> 16;
}

static int ocelot_flower_parse_action(struct flow_cls_offload *f,
				      struct ocelot_ace_rule *rule)
{
@@ -168,7 +162,7 @@ static int ocelot_flower_parse(struct flow_cls_offload *f,
	}

finished_key_parsing:
	ocelot_rule->prio = get_prio(f->common.prio);
	ocelot_rule->prio = f->common.prio;
	ocelot_rule->id = f->cookie;
	return ocelot_flower_parse_action(f, ocelot_rule);
}
@@ -218,7 +212,7 @@ static int ocelot_flower_destroy(struct flow_cls_offload *f,
	struct ocelot_ace_rule rule;
	int ret;

	rule.prio = get_prio(f->common.prio);
	rule.prio = f->common.prio;
	rule.port = port_block->port;
	rule.id = f->cookie;

@@ -236,7 +230,7 @@ static int ocelot_flower_stats_update(struct flow_cls_offload *f,
	struct ocelot_ace_rule rule;
	int ret;

	rule.prio = get_prio(f->common.prio);
	rule.prio = f->common.prio;
	rule.port = port_block->port;
	rule.id = f->cookie;
	ret = ocelot_ace_rule_stats_update(&rule);
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ nfp_flower_install_rate_limiter(struct nfp_app *app, struct net_device *netdev,
		return -EOPNOTSUPP;
	}

	if (flow->common.prio != (1 << 16)) {
	if (flow->common.prio != 1) {
		NL_SET_ERR_MSG_MOD(extack, "unsupported offload: qos rate limit offload requires highest priority");
		return -EOPNOTSUPP;
	}
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ static int tc_fill_entry(struct stmmac_priv *priv,
	struct stmmac_tc_entry *entry, *frag = NULL;
	struct tc_u32_sel *sel = cls->knode.sel;
	u32 off, data, mask, real_off, rem;
	u32 prio = cls->common.prio;
	u32 prio = cls->common.prio << 16;
	int ret;

	/* Only 1 match per entry */
Loading