File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1234,6 +1234,7 @@ static void tx_cyclic_and_rx_process(struct config *cfg,
12341234 struct xdp_desc tx_pkts [BATCH_PKTS_MAX ];
12351235 int batch_nr = cfg -> batch_pkts ;
12361236 int tx_nr ;
1237+ bool first = true;
12371238
12381239 int period = cfg -> interval ;
12391240 int timermode = TIMER_ABSTIME ;
@@ -1283,10 +1284,14 @@ static void tx_cyclic_and_rx_process(struct config *cfg,
12831284
12841285 /* How close is wakeup time to our actual target */
12851286 diff = calcdiff_ns (now , next ); /* Positive num = wokeup after */
1286- if (diff < stat .min )
1287- stat .min = diff ;
1288- if (diff > stat .max )
1289- stat .max = diff ;
1287+ /* Exclude first measurement as no next_adj happened */
1288+ if (!first ) {
1289+ if (diff < stat .min )
1290+ stat .min = diff ;
1291+ if (diff > stat .max )
1292+ stat .max = diff ;
1293+ }
1294+ first = false;
12901295 stat .avg += (double ) diff ;
12911296 stat .prev = stat .curr ;
12921297 stat .curr = diff ;
You can’t perform that action at this time.
0 commit comments