diff options
-rw-r--r-- | vnet/vnet/buffer.h | 2 | ||||
-rw-r--r-- | vnet/vnet/interface_output.c | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/vnet/vnet/buffer.h b/vnet/vnet/buffer.h index 7153f354..05064227 100644 --- a/vnet/vnet/buffer.h +++ b/vnet/vnet/buffer.h @@ -61,6 +61,8 @@ #define ETH_BUFFER_VLAN_BITS (ETH_BUFFER_VLAN_1_DEEP | \ ETH_BUFFER_VLAN_2_DEEP) +#define LOG2_BUFFER_OUTPUT_FEAT_DONE LOG2_VLIB_BUFFER_FLAG_USER(5) +#define BUFFER_OUTPUT_FEAT_DONE (1 << LOG2_BUFFER_OUTPUT_FEAT_DONE) #define foreach_buffer_opaque_union_subtype \ _(ethernet) \ diff --git a/vnet/vnet/interface_output.c b/vnet/vnet/interface_output.c index a8dd451f..04c1b7f5 100644 --- a/vnet/vnet/interface_output.c +++ b/vnet/vnet/interface_output.c @@ -495,9 +495,10 @@ vnet_interface_output_node_no_flatten (vlib_main_t * vm, n_packets += 2; if (PREDICT_FALSE(si->output_feature_bitmap && - vnet_buffer(b0)->output_features.bitmap != (1 << INTF_OUTPUT_FEAT_DONE))) + ((b0->flags & BUFFER_OUTPUT_FEAT_DONE) == 0))) { u32 next0; + b0->flags |= BUFFER_OUTPUT_FEAT_DONE; vnet_buffer(b0)->output_features.bitmap = si->output_feature_bitmap; count_trailing_zeros(next0, vnet_buffer(b0)->output_features.bitmap); vnet_buffer(b0)->output_features.bitmap &= ~(1 << next0); @@ -521,9 +522,10 @@ vnet_interface_output_node_no_flatten (vlib_main_t * vm, } if (PREDICT_FALSE(si->output_feature_bitmap && - vnet_buffer(b1)->output_features.bitmap != (1 << INTF_OUTPUT_FEAT_DONE))) + ((b1->flags & BUFFER_OUTPUT_FEAT_DONE) == 0))) { u32 next1; + b1->flags |= BUFFER_OUTPUT_FEAT_DONE; vnet_buffer(b1)->output_features.bitmap = si->output_feature_bitmap; count_trailing_zeros(next1, vnet_buffer(b1)->output_features.bitmap); vnet_buffer(b1)->output_features.bitmap &= ~(1 << next1); @@ -573,9 +575,10 @@ vnet_interface_output_node_no_flatten (vlib_main_t * vm, n_packets += 1; if (PREDICT_FALSE(si->output_feature_bitmap && - vnet_buffer(b0)->output_features.bitmap != (1 << INTF_OUTPUT_FEAT_DONE))) + ((b0->flags & BUFFER_OUTPUT_FEAT_DONE) == 0))) { u32 next0; + b0->flags |= BUFFER_OUTPUT_FEAT_DONE; vnet_buffer(b0)->output_features.bitmap = si->output_feature_bitmap; count_trailing_zeros(next0, vnet_buffer(b0)->output_features.bitmap); vnet_buffer(b0)->output_features.bitmap &= ~(1 << next0); |