if (vlan_idx >= MLX5_FS_VLAN_DEPTH) {
NL_SET_ERR_MSG_MOD(extack, "Total vlans used is greater than supported"); return -EOPNOTSUPP;
}
if (!mlx5_eswitch_vlan_actions_supported(priv->mdev, vlan_idx)) {
NL_SET_ERR_MSG_MOD(extack, "firmware vlan actions is not supported"); return -EOPNOTSUPP;
}
switch (act->id) { case FLOW_ACTION_VLAN_POP: if (vlan_idx)
*action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_POP_2; else
*action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_POP; break; case FLOW_ACTION_VLAN_PUSH:
attr->vlan_vid[vlan_idx] = act->vlan.vid;
attr->vlan_prio[vlan_idx] = act->vlan.prio;
attr->vlan_proto[vlan_idx] = act->vlan.proto; if (!attr->vlan_proto[vlan_idx])
attr->vlan_proto[vlan_idx] = htons(ETH_P_8021Q);
if (vlan_idx)
*action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2; else
*action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH; break; case FLOW_ACTION_VLAN_POP_ETH:
parse_state->eth_pop = true; break; case FLOW_ACTION_VLAN_PUSH_ETH: if (!flow_flag_test(parse_state->flow, L3_TO_L2_DECAP)) return -EOPNOTSUPP;
parse_state->eth_push = true;
memcpy(attr->eth.h_dest, act->vlan_push_eth.dst, ETH_ALEN);
memcpy(attr->eth.h_source, act->vlan_push_eth.src, ETH_ALEN); break; default:
NL_SET_ERR_MSG_MOD(extack, "Unexpected action id for VLAN"); return -EINVAL;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.