From 5f60030721a4068bf0dbb586500d837b0186036b Mon Sep 17 00:00:00 2001 From: Christian Deacon Date: Wed, 26 Feb 2025 20:41:42 -0500 Subject: [PATCH] Update help menu. --- README.md | 2 +- src/loader/utils/cmdline.c | 2 +- src/loader/utils/helpers.c | 22 +++++++++++++++------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c7a453e..de21ba3 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ Additionally, there are command line overrides for base config options. | -u, --update-time | `-u 30` | Overrides the config's update time value. | | -n, --no-stats | `-n 1` | Overrides the config's no stats value. | | --stats-ps | `--stats-ps 1` | Overrides the config's stats per second value. | -| --stdout-update-time | `--stdout-update-time 500` | Overrides the config's stdout update time value. | +| --stdout-ut | `--stdout-ut 500` | Overrides the config's stdout update time value. | ### Offload Information Offloading your XDP/BPF program to your system's NIC allows for the fastest packet processing you can achieve due to the NIC dropping the packets with its hardware. However, for one, there are **not** many NIC manufacturers that do support this feature **and** you're limited to the NIC's memory/processing (e.g. your BPF map sizes will be extremely limited). Additionally, there are usually stricter BPF verifier limitations for offloaded BPF programs, but you may try reaching out to the NIC's manufacturer to see if they will give you a special version of their NIC driver raising these limitations (this is what I did with one manufacturer I used). diff --git a/src/loader/utils/cmdline.c b/src/loader/utils/cmdline.c index d5ee674..3e8561b 100644 --- a/src/loader/utils/cmdline.c +++ b/src/loader/utils/cmdline.c @@ -15,7 +15,7 @@ const struct option opts[] = { "update-time", required_argument, NULL, 'u' }, { "no-stats", required_argument, NULL, 'n' }, { "stats-ps", required_argument, NULL, 1 }, - { "stdout-update-time", required_argument, NULL, 2 }, + { "stdout-ut", required_argument, NULL, 2 }, { NULL, 0, NULL, 0 } }; diff --git a/src/loader/utils/helpers.c b/src/loader/utils/helpers.c index e2f1d80..f4d4963 100644 --- a/src/loader/utils/helpers.c +++ b/src/loader/utils/helpers.c @@ -7,13 +7,21 @@ */ void PrintHelpMenu() { - fprintf(stdout, "Usage:\n" \ - "--config -c => Config file location (default is /etc/xdpfw/xdpfw.conf).\n" \ - "--offload -o => Tries to load the XDP program in hardware/offload mode.\n" \ - "--skb -s => Force the XDP program to load with SKB mode instead of DRV.\n" \ - "--time -t => How long to run the program for in seconds before exiting. 0 or not set = infinite.\n" \ - "--list -l => Print config details including filters (this will exit program after done).\n" \ - "--help -h => Print help menu.\n"); + printf("Usage: xdpfw [OPTIONS]\n\n"); + + printf(" -c, --config Config file location (default: /etc/xdpfw/xdpfw.conf).\n"); + printf(" -o, --offload Load the XDP program in hardware/offload mode.\n"); + printf(" -s, --skb Force the XDP program to load with SKB mode instead of DRV.\n"); + printf(" -t, --time Duration to run the program (seconds). 0 or unset = infinite.\n"); + printf(" -l, --list Print config details including filters (exits after execution).\n"); + printf(" -h, --help Show this help message.\n\n"); + printf(" -v, --verbose Override config's verbose value.\n"); + printf(" --log-file Override config's log file value.\n"); + printf(" -i, --interface Override config's interface value.\n"); + printf(" -u, --update-time Override config's update time value.\n"); + printf(" -n, --no-stats Override config's no stats value.\n"); + printf(" --stats-ps Override config's stats per second value.\n"); + printf(" --stdout-ut Override config's stdout update time value.\n"); } /**