Commit 5a995900 authored by Baowen Zheng's avatar Baowen Zheng Committed by David S. Miller
Browse files

flow_offload: add index to flow_action_entry structure



Add index to flow_action_entry structure and delete index from police and
gate child structure.

We make this change to offload tc action for driver to identify a tc
action.

Signed-off-by: default avatarBaowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 144d4c9e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1745,7 +1745,7 @@ static void vsc9959_psfp_sfi_table_del(struct ocelot *ocelot, u32 index)
static void vsc9959_psfp_parse_gate(const struct flow_action_entry *entry,
				    struct felix_stream_gate *sgi)
{
	sgi->index = entry->gate.index;
	sgi->index = entry->hw_index;
	sgi->ipv_valid = (entry->gate.prio < 0) ? 0 : 1;
	sgi->init_ipv = (sgi->ipv_valid) ? entry->gate.prio : 0;
	sgi->basetime = entry->gate.basetime;
@@ -1947,7 +1947,7 @@ static int vsc9959_psfp_filter_add(struct ocelot *ocelot, int port,
			kfree(sgi);
			break;
		case FLOW_ACTION_POLICE:
			index = a->police.index + VSC9959_PSFP_POLICER_BASE;
			index = a->hw_index + VSC9959_PSFP_POLICER_BASE;
			if (index > VSC9959_PSFP_POLICER_MAX) {
				ret = -EINVAL;
				goto err;
+1 −1
Original line number Diff line number Diff line
@@ -379,7 +379,7 @@ int sja1105_cls_flower_add(struct dsa_switch *ds, int port,
			vl_rule = true;

			rc = sja1105_vl_gate(priv, port, extack, cookie,
					     &key, act->gate.index,
					     &key, act->hw_index,
					     act->gate.prio,
					     act->gate.basetime,
					     act->gate.cycletime,
+3 −3
Original line number Diff line number Diff line
@@ -1182,7 +1182,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv,
	}

	/* parsing gate action */
	if (entryg->gate.index >= priv->psfp_cap.max_psfp_gate) {
	if (entryg->hw_index >= priv->psfp_cap.max_psfp_gate) {
		NL_SET_ERR_MSG_MOD(extack, "No Stream Gate resource!");
		err = -ENOSPC;
		goto free_filter;
@@ -1202,7 +1202,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv,
	}

	refcount_set(&sgi->refcount, 1);
	sgi->index = entryg->gate.index;
	sgi->index = entryg->hw_index;
	sgi->init_ipv = entryg->gate.prio;
	sgi->basetime = entryg->gate.basetime;
	sgi->cycletime = entryg->gate.cycletime;
@@ -1244,7 +1244,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv,
			refcount_set(&fmi->refcount, 1);
			fmi->cir = entryp->police.rate_bytes_ps;
			fmi->cbs = entryp->police.burst;
			fmi->index = entryp->police.index;
			fmi->index = entryp->hw_index;
			filter->flags |= ENETC_PSFP_FLAGS_FMI;
			filter->fmi_index = fmi->index;
			sfi->meter_id = fmi->index;
+1 −1
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
			 */
			burst = roundup_pow_of_two(act->police.burst);
			err = mlxsw_sp_acl_rulei_act_police(mlxsw_sp, rulei,
							    act->police.index,
							    act->hw_index,
							    act->police.rate_bytes_ps,
							    burst, extack);
			if (err)
+1 −1
Original line number Diff line number Diff line
@@ -303,7 +303,7 @@ static int ocelot_flower_parse_action(struct ocelot *ocelot, int port,
			}
			filter->action.police_ena = true;

			pol_ix = a->police.index + ocelot->vcap_pol.base;
			pol_ix = a->hw_index + ocelot->vcap_pol.base;
			pol_max = ocelot->vcap_pol.max;

			if (ocelot->vcap_pol.max2 && pol_ix > pol_max) {
Loading