2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

odp-execute: Add function pointer for pop_vlan action.

This commit removes the pop_vlan action from the large switch
and creates a separate function for batched processing. A function
pointer is also added to call the new batched function for the pop_vlan
action.

Signed-off-by: Emma Finn <emma.finn@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
This commit is contained in:
Emma Finn
2022-07-15 10:16:15 +00:00
committed by Ian Stokes
parent 95e4a35b0a
commit 70b559e97b
3 changed files with 44 additions and 7 deletions

View File

@@ -834,6 +834,29 @@ requires_datapath_assistance(const struct nlattr *a)
return false;
}
static void
action_pop_vlan(struct dp_packet_batch *batch,
const struct nlattr *a OVS_UNUSED)
{
struct dp_packet *packet;
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
eth_pop_vlan(packet);
}
}
/* Implementation of the scalar actions impl init function. Build up the
* array of func ptrs here. */
int
odp_action_scalar_init(struct odp_execute_action_impl *self)
{
/* Set function pointers for actions that can be applied directly, these
* are identified by OVS_ACTION_ATTR_*. */
self->funcs[OVS_ACTION_ATTR_POP_VLAN] = action_pop_vlan;
return 0;
}
/* The active function pointers on the datapath. ISA optimized implementations
* are enabled by plugging them into this static arary, which is consulted when
* applying actions on the datapath. */
@@ -985,12 +1008,6 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal,
break;
}
case OVS_ACTION_ATTR_POP_VLAN:
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
eth_pop_vlan(packet);
}
break;
case OVS_ACTION_ATTR_PUSH_MPLS: {
const struct ovs_action_push_mpls *mpls = nl_attr_get(a);
@@ -1141,6 +1158,8 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal,
case OVS_ACTION_ATTR_CT:
case OVS_ACTION_ATTR_UNSPEC:
case __OVS_ACTION_ATTR_MAX:
/* The following actions are handled by the scalar implementation. */
case OVS_ACTION_ATTR_POP_VLAN:
OVS_NOT_REACHED();
}