From 1e6aa2e4a0c81c662d4016c9fe6d4ff7777d3dae Mon Sep 17 00:00:00 2001 From: Noor Azura Ahmad Tarmizi Date: Fri, 21 Oct 2022 12:22:21 +0800 Subject: [PATCH] script: Publish data on af_packet when af_xdp is not available in vs1 In current test implementation, vs1 runs AF_PACKET test first before AF_XDP tests. At the end of the AF_XDP test, both calculation result will be shown to the users. However, currently AF_PACKET result will not even be calculated if txrx-tsn prematurely exits in the AF_XDP test phase (due unsupported AF_XDP etc). This change is to support af_packet calculation if the data is available regardless of AF_XDP test execution result. Signed-off-by: Noor Azura Ahmad Tarmizi --- shell/vs1b.sh | 4 ++++ src/txrx.h | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/shell/vs1b.sh b/shell/vs1b.sh index 4fbe163..2e2b168 100755 --- a/shell/vs1b.sh +++ b/shell/vs1b.sh @@ -111,6 +111,10 @@ else if ! ps -p $TXRX_PID > /dev/null; then echo -e "\ntxrx-tsn exited prematurely. vs1b.sh script will be stopped." + stop_if_empty "afpkt-rxtstamps.txt" + calc_rx_u2u "afpkt-rxtstamps.txt" + calc_rx_duploss "afpkt-rxtstamps.txt" $NUMPKTS + save_result_files $(basename $0 .sh) $NUMPKTS $SIZE $INTERVAL $XDP_MODE $PLAT exit 1 fi diff --git a/src/txrx.h b/src/txrx.h index 36fd605..594c7b1 100644 --- a/src/txrx.h +++ b/src/txrx.h @@ -133,11 +133,9 @@ struct user_opt { /* XDP-specific */ #ifdef WITH_XDP struct xsk_info *xsk; //XDP-socket and ring information - #endif - /* x_opt can be defined regardless of if_xdp.h is available or not */ struct xsk_opt x_opt; //XDP-specific mandatory user params + #endif - /* XDP-specific options*/ /* Currently for txrx-afxdp only. */ uint8_t xdp_mode; //XDP mode: skb/nc/zc uint8_t enable_poll; //XDP poll mode when sending/receiving