u32 fq_index;
u32 fq_feature_index;
- // reference count for enabling/disabling feature
- u32 feature_use_refcount;
+ // reference count for enabling/disabling feature - per interface
+ u32 *feature_use_refcount_per_intf;
} ip4_sv_reass_main_t;
rm->fq_feature_index =
vlib_frame_queue_main_init (ip4_sv_reass_node_feature.index, 0);
+ rm->feature_use_refcount_per_intf = NULL;
+
return error;
}
ip4_sv_reass_enable_disable_with_refcnt (u32 sw_if_index, int is_enable)
{
ip4_sv_reass_main_t *rm = &ip4_sv_reass_main;
+ vec_validate (rm->feature_use_refcount_per_intf, sw_if_index);
if (is_enable)
{
- if (!rm->feature_use_refcount)
+ if (!rm->feature_use_refcount_per_intf[sw_if_index])
{
- ++rm->feature_use_refcount;
+ ++rm->feature_use_refcount_per_intf[sw_if_index];
return vnet_feature_enable_disable ("ip4-unicast",
"ip4-sv-reassembly-feature",
sw_if_index, 1, 0, 0);
}
- ++rm->feature_use_refcount;
+ ++rm->feature_use_refcount_per_intf[sw_if_index];
}
else
{
- --rm->feature_use_refcount;
- if (!rm->feature_use_refcount)
+ --rm->feature_use_refcount_per_intf[sw_if_index];
+ if (!rm->feature_use_refcount_per_intf[sw_if_index])
return vnet_feature_enable_disable ("ip4-unicast",
"ip4-sv-reassembly-feature",
sw_if_index, 0, 0, 0);
u32 fq_index;
u32 fq_feature_index;
- // reference count for enabling/disabling feature
- u32 feature_use_refcount;
+ // reference count for enabling/disabling feature - per interface
+ u32 *feature_use_refcount_per_intf;
} ip6_sv_reass_main_t;
extern ip6_sv_reass_main_t ip6_sv_reass_main;
rm->fq_feature_index =
vlib_frame_queue_main_init (ip6_sv_reass_node_feature.index, 0);
+ rm->feature_use_refcount_per_intf = NULL;
+
return error;
}
ip6_sv_reass_enable_disable_with_refcnt (u32 sw_if_index, int is_enable)
{
ip6_sv_reass_main_t *rm = &ip6_sv_reass_main;
+ vec_validate (rm->feature_use_refcount_per_intf, sw_if_index);
if (is_enable)
{
- if (!rm->feature_use_refcount)
+ if (!rm->feature_use_refcount_per_intf[sw_if_index])
{
- ++rm->feature_use_refcount;
+ ++rm->feature_use_refcount_per_intf[sw_if_index];
return vnet_feature_enable_disable ("ip6-unicast",
"ip6-sv-reassembly-feature",
sw_if_index, 1, 0, 0);
}
- ++rm->feature_use_refcount;
+ ++rm->feature_use_refcount_per_intf[sw_if_index];
}
else
{
- --rm->feature_use_refcount;
- if (!rm->feature_use_refcount)
+ --rm->feature_use_refcount_per_intf[sw_if_index];
+ if (!rm->feature_use_refcount_per_intf[sw_if_index])
return vnet_feature_enable_disable ("ip6-unicast",
"ip6-sv-reassembly-feature",
sw_if_index, 0, 0, 0);