Repository navigation
Let the F-Stack tools find a vdev / file_prefix stack by itself (#419) - #1097
Merged
Merged
Conversation
… by itself (issue F-Stack#419): every DPDK primary records its EAL runtime directory in /var/run/ff_primary.conf (pid, start time, runtime_dir), and ff_ipc_init() falls back to that record after FF_FILE_PREFIX and the resident slim primary's record, before the EAL default. Before this, a [vdevN] config ran the stack under --file-prefix=container while the tools attached to rte and failed with "mp_socket ... Connection refused". The record is checked like the slim one (live pid with the same start time, a direct child of /var/run/dpdk/); the file_prefix naming is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes the tools side of #419. With a
[vdevN]config (e.g. F-Stack on top of OVS-DPDK vhost-user) the stack runs with--file-prefix=container, and with[dpdk] file_prefix=<v>with--file-prefix=container-<v>. Unlessgraceful_reload=1, the tools (ifconfig,sysctl,netstat,top, ...) attach as a DPDK secondary under the default prefixrte, so they fail with:or, when another DPDK primary (such as OVS) owns
rte, attach to that process instead. The only way round it was to know the naming rule and setFF_FILE_PREFIXby hand.Change
lib/ff_dpdk_if.c: afterrte_eal_init(), a primary writes/var/run/ff_primary.conf(pid,start_time,runtime_dir), in the same format as the resident slim primary's record. Written through a tmp file +rename(); best effort, a failure never stops the stack.tools/compat/ff_ipc.c: the prefix lookup is nowFF_FILE_PREFIX>/var/run/ff_slim_primary.conf>/var/run/ff_primary.conf>rte. The new record goes through the existingff_ipc_record_prefix()checks: the pid is alive with the same start time, and the directory is a direct child of/var/run/dpdk/.tools/README.md: documents the lookup order.The
file_prefix/containernaming is unchanged, so existing deployments, scripts and hugepage file names stay the same.Testing
TencentOS 4.4, kernel 6.6, DPDK 24.11.6, 2 MB hugepages.
dpdk-testpmd --file-prefix=ovs419 --vdev net_vhost0,iface=/tmp/vhost-419.sockstood in for OVS, andhelloworldused[vdev0] path=/tmp/vhost-419.sockwith nofile_prefix, so the stack ran undercontainer.ifconfig, vdev and no file_prefixConnection refused(reproduces #419)f-stack-0, inet 192.168.1.2sysctl,netstat -anFF_FILE_PREFIX=rte/=containerfile_prefix=t419(container-t419)lib (
-Werror), tools and example build cleanly. Not covered:tests/unit(no cmocka on the host), the data path over vhost-user, several stacks on one host, and graceful_reload.Notes
FF_FILE_PREFIXis still needed to pick another one (documented in tools/README.md).🤖 Generated with Claude Code