summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipfix-export/flow_api.c
diff options
context:
space:
mode:
authorPaul Atkins <patkins@graphiant.com>2021-09-27 21:30:13 +0100
committerNeale Ranns <neale@graphiant.com>2021-11-22 09:30:09 +0000
commit19a5f23b23e4eec54d99f105725ddc4df7421a5c (patch)
tree57c37b8de8d7391d4f47efc857f875bbeb68b709 /src/vnet/ipfix-export/flow_api.c
parent0352ea0c779ddcb636325406695ffc659a6e21db (diff)
ipfix-export: Add APIs to get/send buffers
The ipfix exporter should be doing most of the work of building packets and sending them rather than leaving every client of the exporter to do all the work themselves. Start to move towards that by adding APIs to get and send buffers. Store the state of this in new per thread data on the report so that we can send with minimal use of atomics. We do need an atomic for the sequence number in the packet though as that contains the number of data_records sent for the 'stream', not just for a single core. As the state is stored on the flow_report_t the caller needs to know which report they are using, so add a field to the args struct used to create the report that is used to pass back the report index on success. Type: improvement Signed-off-by: Paul Atkins <patkins@graphiant.com> Change-Id: I222b98a3f0326b3b71b11e0866a8c9736bed6dc1
Diffstat (limited to 'src/vnet/ipfix-export/flow_api.c')
-rw-r--r--src/vnet/ipfix-export/flow_api.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vnet/ipfix-export/flow_api.c b/src/vnet/ipfix-export/flow_api.c
index c64f5508487..62dc703d9a0 100644
--- a/src/vnet/ipfix-export/flow_api.c
+++ b/src/vnet/ipfix-export/flow_api.c
@@ -160,6 +160,11 @@ vl_api_set_ipfix_exporter_t_internal (
if (path_mtu < 68)
return VNET_API_ERROR_INVALID_VALUE;
+ /* Calculate how much header data we need. */
+ exp->all_headers_size = sizeof (ip4_header_t) + sizeof (udp_header_t) +
+ sizeof (ipfix_message_header_t) +
+ sizeof (ipfix_set_header_t);
+
/* Reset report streams if we are reconfiguring IP addresses */
if (exp->ipfix_collector.as_u32 != collector.as_u32 ||
exp->src_address.as_u32 != src.as_u32 ||