diff --git a/doc/guides/sample_app_ug/cndpfwd.rst b/doc/guides/sample_app_ug/cndpfwd.rst index 1211cf97..936e443a 100644 --- a/doc/guides/sample_app_ug/cndpfwd.rst +++ b/doc/guides/sample_app_ug/cndpfwd.rst @@ -31,10 +31,11 @@ The creation of an AF_XDP socket involves loading of a BPF program which is a pr In order to run the CNDP application in an unprivileged container, the privileged operations are done by a Kubernetes device plugin. The CNDP application talks to the Kubernetes device plugin over a unix domain socket. The path to the unix domain socket created by the device plugin is the value -of the "uds_path" attribute. The "unprivileged" flag should be true if running the CNDP app in an -unprivileged container. The sysctl param ``kernel.unprivileged_bpf_disabled`` should be 0 to perform -unprivileged BPF operations. For more details about the device plugin, please refer to -:ref:`Integration of the K8s device plugin with CNDP `. +of the "uds_path" attribute. The "unprivileged" flag is automatically configured if the "uds_path" +parameter is used. The sysctl param ``kernel.unprivileged_bpf_disabled`` should be 0 to perform +unprivileged BPF operations. Alternatively the "xsk_pin_path" can be used in combination with the +AF_XDP Device Plugin to support unprivileged Pods. For more details about the device plugin, please refer to +:ref:`Integration of the K8s device plugin with CNDP `. Alternatively Running the Application ----------------------- diff --git a/lib/usr/app/jcfg/jcfg.h b/lib/usr/app/jcfg/jcfg.h index 65ad618d..0102e1e1 100644 --- a/lib/usr/app/jcfg/jcfg.h +++ b/lib/usr/app/jcfg/jcfg.h @@ -186,7 +186,6 @@ typedef struct jcfg_lport { #define JCFG_LPORT_BUSY_POLLING_NAME "busy_polling" #define JCFG_LPORT_BUSY_TIMEOUT_NAME "busy_timeout" #define JCFG_LPORT_BUSY_BUDGET_NAME "busy_budget" -#define JCFG_LPORT_UNPRIVILEGED_NAME "unprivileged" #define JCFG_PINNED_XSK_MAP_NAME "xsk_pin_path" #define JCFG_LPORT_FORCE_WAKEUP_NAME "force_wakeup" #define JCFG_LPORT_SKB_MODE_NAME "skb_mode" diff --git a/tools/jsonc_gen_lport_groups.sh b/tools/jsonc_gen_lport_groups.sh index 11aceaa7..12bf2fef 100755 --- a/tools/jsonc_gen_lport_groups.sh +++ b/tools/jsonc_gen_lport_groups.sh @@ -66,9 +66,9 @@ function build_netdevs_by_node local node local dev - for dev in ${CNDP_DEVICES[@]}; do - node=$(cat /sys/class/net/$dev/device/numa_node 2>/dev/null || echo 0) - netdevs_by_node[$node]="${netdevs_by_node[$node]} $dev" + for dev in "${CNDP_DEVICES[@]}"; do + node=$(cat /sys/class/net/"$dev"/device/numa_node 2>/dev/null || echo 0) + netdevs_by_node[node]="${netdevs_by_node[$node]} $dev" done } @@ -77,12 +77,13 @@ function build_netdevs_by_node # function build_lcores_by_node { - local lines=$(lscpu | awk -F: '/NUMA node[0-9] CPU\(s\):/{print $2}' | xargs) + local lines + lines=$(lscpu | awk -F: '/NUMA node[0-9] CPU\(s\):/{print $2}' | xargs) local line local i i=0 - for line in ${lines[@]}; do + for line in "${lines[@]}"; do lcores_by_node[i]=$line i=$((i+1)) done