From d4f7472b563b71050d1c21f5b89e33a0fc81cb60 Mon Sep 17 00:00:00 2001 From: Neil McKee Date: Tue, 8 Oct 2024 16:34:04 -0700 Subject: [PATCH] Add TODO comment about marking buffer as sampled for tracing purposes --- sflow/node.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sflow/node.c b/sflow/node.c index 04df492..71ba095 100644 --- a/sflow/node.c +++ b/sflow/node.c @@ -120,6 +120,11 @@ VLIB_NODE_FN (sflow_node) (vlib_main_t * vm, .header_bytes = hdr }; + // TODO: what bit in the buffer can we set right here to indicate + // that this packet was sampled (and perhaps another bit to say if it + // was dropped or sucessfully enqueued)? That way we can check it + // below if the packet is traced, and indicate that in the trace output. + // TODO: we end up copying the header twice here. Consider allowing the // enqueue to be just a little more complex. Like this: // if(!sflow_fifo_enqueue(&sfwk->fifo, &sample, en, hdr). @@ -298,7 +303,7 @@ VLIB_NODE_FN (sflow_node) (vlib_main_t * vm, en0 = vlib_buffer_get_current (b0); - // Are we supposed to tweak this buffer metadata? + // TODO: Are we supposed to tweak this buffer metadata? // clib_warning("TX ifIndex currently=%u", vnet_buffer(b0)->sw_if_index[VLIB_TX]); // vnet_buffer(b0)->sw_if_index[VLIB_TX] = ~0; // sw_if_index0;