Closed sflow closed 2 months ago
I can confirm this does happen. If we:
sflow enable-disable TenGigabitEthernet130/0/0
sflow enable-disable TenGigabitEthernet130/0/0
sflow enable-disable TenGigabitEthernet130/0/0
sflow enable-disable TenGigabitEthernet130/0/0
We will receive 4x the samples on the PSAMPLE netlink channel.
One way to detect this is to mark an interface as enabled (see #3 for more on this) and if it's enabled, refused to add the feature again on https://github.com/sflow/vpp-sflow/blame/main/sflow/sflow.c#L322
I believe this issue is addressed by the latest commit, which introduces per-interface data in sflow-main and uses it to gate the enable_disable config changes. https://github.com/sflow/vpp-sflow/commit/26840826dd6320316bd2f6e500892f6b2c28ef25
Confirmed - we only call vnet_feature_enable_disable()
at most once now per interface.
We need to make sure that enabling sFlow on an interface twice does not insert the sampling node into the graph twice.