aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-05-17 12:02:07 +0200
committerFlorin Coras <florin.coras@gmail.com>2016-05-17 18:34:09 +0000
commit2df2e999fb9408f041dcf300df0983b7ebe5433e (patch)
tree42d4b5d48690dcb10aa125031d305cc51617cc43
parent9341a1f8500b8f6712b5dd671b976ecbf6803c2c (diff)
Fix output feature issue where opque field is already used by previous node
Change-Id: I1470993668fa8c740229149bbb227bd1e410d5ab Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r--vnet/vnet/buffer.h2
-rw-r--r--vnet/vnet/interface_output.c9
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);