@@ -266,9 +266,7 @@ event_writer(xdp_md_t* ctx) {
266266 memcpy (trc_elm -> data , ctx -> data , size_to_copy );
267267 bpf_perf_event_output (ctx , & cilium_events , EBPF_MAP_FLAG_CURRENT_CPU , trc_elm , sizeof (struct trace_notify ));
268268 }
269-
270-
271- if (flt_evttype == CILIUM_NOTIFY_DROP ) {
269+ else if (flt_evttype == CILIUM_NOTIFY_DROP ) {
272270 struct drop_notify * drp_elm ;
273271
274272 //Create a Mock Drop Event
@@ -304,10 +302,7 @@ event_writer(xdp_md_t* ctx) {
304302 }
305303 }
306304 }
307-
308- // update_metrics(size_to_copy, METRIC_INGRESS, reason, 0, 0);
309-
310- if (flt_evttype == PKTMON_NOTIFY_DROP ) {
305+ else if (flt_evttype == PKTMON_NOTIFY_DROP ) {
311306 struct pktmon_notify * drp_elm ;
312307
313308 //Create a Mock Drop Event
@@ -324,6 +319,7 @@ event_writer(xdp_md_t* ctx) {
324319 // memcpy(drp_elm->data, ctx->data, size_to_copy);
325320 bpf_perf_event_output (ctx , & cilium_events , EBPF_MAP_FLAG_CURRENT_CPU , drp_elm , sizeof (struct pktmon_notify ));
326321 }
322+ update_metrics (size_to_copy , METRIC_INGRESS , reason , 0 , 0 );
327323
328324 return XDP_PASS ;
329325}
0 commit comments