Skip to content

Commit

Permalink
resolve several TODO items
Browse files Browse the repository at this point in the history
  • Loading branch information
sflow committed Oct 3, 2024
1 parent 285d8a0 commit 64d65a3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 1 addition & 4 deletions sflow/sflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ read_worker_fifos(sflow_main_t *smp) {
u32 psample_send = 0, psample_send_fail = 0;
for(u32 thread_index = 0; thread_index < smp->total_threads; thread_index++) {
sflow_per_thread_data_t *sfwk = vec_elt_at_index(smp->per_thread_data, thread_index);
// TODO: dequeue and write multiple samples at a time
sflow_sample_t sample;
if(sflow_fifo_dequeue(&sfwk->fifo, &sample)) {
if(sample.header_bytes > smp->headerB) {
Expand Down Expand Up @@ -529,7 +528,7 @@ int sflow_enable_disable (sflow_main_t * smp, u32 sw_if_index, int enable_disabl
sw->sup_sw_if_index,
sw->hw_if_index);
#if 0
// TODO: do we report MTU with counters sample?
// TODO: should we report interface MTU with counters sample?
for(int ii = 0; ii < VNET_N_MTU; ii++)
clib_warning("mtu[%u]=%u\n", ii, sw->mtu[ii]);
#endif
Expand All @@ -541,15 +540,13 @@ int sflow_enable_disable (sflow_main_t * smp, u32 sw_if_index, int enable_disabl
sflow_per_interface_data_t *sfif = vec_elt_at_index(smp->per_interface_data, sw->hw_if_index);
if(enable_disable == sfif->sflow_enabled) {
// redundant enable or disable
// TODO: decide which error for (a) redundant enable and (b) redundant disable
return VNET_API_ERROR_VALUE_EXIST;
}
else {
// OK, turn it on/off
sfif->sw_if_index = sw_if_index;
sfif->hw_if_index = sw->hw_if_index;
sfif->polled = 0;
// TODO: send vapi request to learn sfif->linux_if_index here?
sfif->sflow_enabled = enable_disable;
vnet_feature_enable_disable ("device-input", "sflow", sw_if_index, enable_disable, 0, 0);
smp->interfacesEnabled += (enable_disable) ? 1 : -1;
Expand Down
1 change: 0 additions & 1 deletion sflow/sflow_usersock.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ extern "C" {
// clib_warning("usersock_open: bind failed: %s\n", strerror(errno));
setNonBlocking(nl_sock);
setCloseOnExec(nl_sock);
// TODO: join multicast channel? with setsockopt() ?
return nl_sock;
}

Expand Down

0 comments on commit 64d65a3

Please sign in to comment.