mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
dp-packet: Add index to DP_PACKET_BATCH_FOR_EACH to prevent shadowing.
Signed-off-by: Justin Pettit <jpettit@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -737,7 +737,7 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal,
|
||||
struct flow flow;
|
||||
uint32_t hash;
|
||||
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
|
||||
/* RSS hash can be used here instead of 5tuple for
|
||||
* performance reasons. */
|
||||
if (dp_packet_rss_valid(packet)) {
|
||||
@@ -759,14 +759,14 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal,
|
||||
case OVS_ACTION_ATTR_PUSH_VLAN: {
|
||||
const struct ovs_action_push_vlan *vlan = nl_attr_get(a);
|
||||
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
|
||||
eth_push_vlan(packet, vlan->vlan_tpid, vlan->vlan_tci);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case OVS_ACTION_ATTR_POP_VLAN:
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
|
||||
eth_pop_vlan(packet);
|
||||
}
|
||||
break;
|
||||
@@ -774,32 +774,32 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal,
|
||||
case OVS_ACTION_ATTR_PUSH_MPLS: {
|
||||
const struct ovs_action_push_mpls *mpls = nl_attr_get(a);
|
||||
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
|
||||
push_mpls(packet, mpls->mpls_ethertype, mpls->mpls_lse);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case OVS_ACTION_ATTR_POP_MPLS:
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
|
||||
pop_mpls(packet, nl_attr_get_be16(a));
|
||||
}
|
||||
break;
|
||||
|
||||
case OVS_ACTION_ATTR_SET:
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
|
||||
odp_execute_set_action(packet, nl_attr_get(a));
|
||||
}
|
||||
break;
|
||||
|
||||
case OVS_ACTION_ATTR_SET_MASKED:
|
||||
DP_PACKET_BATCH_FOR_EACH(packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH(i, packet, batch) {
|
||||
odp_execute_masked_set_action(packet, nl_attr_get(a));
|
||||
}
|
||||
break;
|
||||
|
||||
case OVS_ACTION_ATTR_SAMPLE:
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
|
||||
odp_execute_sample(dp, packet, steal && last_action, a,
|
||||
dp_execute_action);
|
||||
}
|
||||
@@ -816,7 +816,7 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal,
|
||||
nl_attr_get_unspec(a, sizeof *trunc);
|
||||
|
||||
batch->trunc = true;
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
|
||||
dp_packet_set_cutlen(packet, trunc->max_len);
|
||||
}
|
||||
break;
|
||||
@@ -837,7 +837,7 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal,
|
||||
case OVS_ACTION_ATTR_PUSH_ETH: {
|
||||
const struct ovs_action_push_eth *eth = nl_attr_get(a);
|
||||
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
|
||||
push_eth(packet, ð->addresses.eth_dst,
|
||||
ð->addresses.eth_src);
|
||||
}
|
||||
@@ -845,7 +845,7 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal,
|
||||
}
|
||||
|
||||
case OVS_ACTION_ATTR_POP_ETH:
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
|
||||
pop_eth(packet);
|
||||
}
|
||||
break;
|
||||
@@ -855,7 +855,7 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal,
|
||||
struct nsh_hdr *nsh_hdr = ALIGNED_CAST(struct nsh_hdr *, buffer);
|
||||
nsh_reset_ver_flags_ttl_len(nsh_hdr);
|
||||
odp_nsh_hdr_from_attr(nl_attr_get(a), nsh_hdr, NSH_HDR_MAX_LEN);
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
|
||||
push_nsh(packet, nsh_hdr);
|
||||
}
|
||||
break;
|
||||
@@ -874,7 +874,7 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal,
|
||||
break;
|
||||
}
|
||||
case OVS_ACTION_ATTR_CT_CLEAR:
|
||||
DP_PACKET_BATCH_FOR_EACH (packet, batch) {
|
||||
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
|
||||
conntrack_clear(packet);
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user