DPDK patches and discussions
 help / color / mirror / Atom feed
* [RFC 0/4] move unix domain sockets from /tmp to /run/dpdk
@ 2025-12-31 18:56 Stephen Hemminger
  2025-12-31 18:56 ` [RFC 1/4] net/af_xdp: replace /tmp with /run/dpdk Stephen Hemminger
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stephen Hemminger @ 2025-12-31 18:56 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Current best practice is not to use /tmp for Unix domain sockets.
Move the socket communication to DPDK runtime directory.

To quote systemd:

    /run (traditionally /var/run) where privileged daemons can store
    runtime data, such as communication primitives. This is where your
    daemon should place its sockets.

See:

    http://0pointer.net/blog/projects/tmp.html
    https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
    https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html*

Stephen Hemminger (4):
  net/af_xdp: replace /tmp with /run/dpdk
  examples/vm_power_manager: replace /tmp with /run/dpdk
  net/nfp: replace /tmp with /run/dpdk
  net/cnxk: move socket from /tmp to /run/dpdk

 doc/guides/sample_app_ug/vm_power_management.rst | 13 ++-----------
 drivers/net/af_xdp/rte_eth_af_xdp.c              |  2 +-
 drivers/net/cnxk/cnxk_eswitch.h                  |  2 +-
 drivers/net/nfp/nfp_cpp_bridge.c                 |  4 ++--
 examples/vm_power_manager/channel_manager.h      |  2 +-
 5 files changed, 7 insertions(+), 16 deletions(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC 1/4] net/af_xdp: replace /tmp with /run/dpdk
  2025-12-31 18:56 [RFC 0/4] move unix domain sockets from /tmp to /run/dpdk Stephen Hemminger
@ 2025-12-31 18:56 ` Stephen Hemminger
  2025-12-31 18:56 ` [RFC 2/4] examples/vm_power_manager: " Stephen Hemminger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2025-12-31 18:56 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Ciara Loftus, Maryam Tahhan

Applications should not use /tmp to store unix domain sockets.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index f2a8fb95d1..74ffb3ba57 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -83,7 +83,7 @@ RTE_LOG_REGISTER_DEFAULT(af_xdp_logtype, NOTICE);
 
 #define ETH_AF_XDP_MP_KEY "afxdp_mp_send_fds"
 
-#define DP_BASE_PATH			"/tmp/afxdp_dp"
+#define DP_BASE_PATH			"/run/dpdk/afxdp"
 #define DP_UDS_SOCK             "afxdp.sock"
 #define DP_XSK_MAP				"xsks_map"
 #define MAX_LONG_OPT_SZ			64
-- 
2.51.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC 2/4] examples/vm_power_manager: replace /tmp with /run/dpdk
  2025-12-31 18:56 [RFC 0/4] move unix domain sockets from /tmp to /run/dpdk Stephen Hemminger
  2025-12-31 18:56 ` [RFC 1/4] net/af_xdp: replace /tmp with /run/dpdk Stephen Hemminger
@ 2025-12-31 18:56 ` Stephen Hemminger
  2025-12-31 18:56 ` [RFC 3/4] net/nfp: " Stephen Hemminger
  2025-12-31 18:56 ` [RFC 4/4] net/cnxk: move socket from /tmp to /run/dpdk Stephen Hemminger
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2025-12-31 18:56 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Anatoly Burakov, David Hunt, Sivaprasad Tummala

Applications should not use /tmp to store unix domain sockets.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/sample_app_ug/vm_power_management.rst | 13 ++-----------
 examples/vm_power_manager/channel_manager.h      |  2 +-
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/doc/guides/sample_app_ug/vm_power_management.rst b/doc/guides/sample_app_ug/vm_power_management.rst
index 1955140bb3..eb9228f0eb 100644
--- a/doc/guides/sample_app_ug/vm_power_management.rst
+++ b/doc/guides/sample_app_ug/vm_power_management.rst
@@ -195,7 +195,7 @@ The XML structure is as follows:
       <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <channel type='unix'>
-      <source mode='bind' path='/tmp/powermonitor/{vm_name}.{channel_num}'/>
+      <source mode='bind' path='/run/dpdk/powermonitor/{vm_name}.{channel_num}'/>
       <target type='virtio' name='virtio.serial.port.poweragent.{vm_channel_num}'/>
       <address type='virtio-serial' controller='0' bus='0' port='{N}'/>
    </channel>
@@ -208,18 +208,9 @@ channel. Likewise, the port value ``{N}`` must be incremented for each
 channel.
 
 On the host, for each channel to appear in the path, ensure the creation
-of the ``/tmp/powermonitor/`` directory and the assignment of ``qemu``
+of the ``/run/dpdk/powermonitor/`` directory and the assignment of ``qemu``
 permissions:
 
-.. code-block:: console
-
-   mkdir /tmp/powermonitor/
-   chown qemu:qemu /tmp/powermonitor
-
-Note that files and directories in ``/tmp`` are generally removed when
-rebooting the host and you may need to perform the previous steps after
-each reboot.
-
 The serial device as it appears on a VM is configured with the target
 element attribute name and must be in the form:
 ``virtio.serial.port.poweragent.{vm_channel_num}``, where
diff --git a/examples/vm_power_manager/channel_manager.h b/examples/vm_power_manager/channel_manager.h
index 6f70539815..5fc93ae0be 100644
--- a/examples/vm_power_manager/channel_manager.h
+++ b/examples/vm_power_manager/channel_manager.h
@@ -22,7 +22,7 @@ extern "C" {
 #define CHANNEL_MGR_DEFAULT_HV_PATH "qemu:///system"
 
 /* File socket directory */
-#define CHANNEL_MGR_SOCKET_PATH     "/tmp/powermonitor/"
+#define CHANNEL_MGR_SOCKET_PATH     "/run/dpdk/powermonitor/"
 
 /* FIFO file name template */
 #define CHANNEL_MGR_FIFO_PATTERN_NAME   "fifo"
-- 
2.51.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC 3/4] net/nfp: replace /tmp with /run/dpdk
  2025-12-31 18:56 [RFC 0/4] move unix domain sockets from /tmp to /run/dpdk Stephen Hemminger
  2025-12-31 18:56 ` [RFC 1/4] net/af_xdp: replace /tmp with /run/dpdk Stephen Hemminger
  2025-12-31 18:56 ` [RFC 2/4] examples/vm_power_manager: " Stephen Hemminger
@ 2025-12-31 18:56 ` Stephen Hemminger
  2025-12-31 18:56 ` [RFC 4/4] net/cnxk: move socket from /tmp to /run/dpdk Stephen Hemminger
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2025-12-31 18:56 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Chaoyong He

Replace /tmp/0000:00:00 with /run/dpdk/nfp/0000:00:00 for the
unix domain service name.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/nfp/nfp_cpp_bridge.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_cpp_bridge.c b/drivers/net/nfp/nfp_cpp_bridge.c
index da7ea35d62..b8ef60f22c 100644
--- a/drivers/net/nfp/nfp_cpp_bridge.c
+++ b/drivers/net/nfp/nfp_cpp_bridge.c
@@ -334,7 +334,7 @@ nfp_cpp_bridge_service_func(void *args)
 	int datafd;
 	struct nfp_cpp *cpp;
 	const char *pci_name;
-	char socket_handle[14];
+	char socket_handle[108];
 	struct sockaddr address;
 	struct nfp_pf_dev *pf_dev;
 	struct timeval timeout = {1, 0};
@@ -342,7 +342,7 @@ nfp_cpp_bridge_service_func(void *args)
 	pf_dev = args;
 
 	pci_name = strchr(pf_dev->pci_dev->name, ':') + 1;
-	snprintf(socket_handle, sizeof(socket_handle), "/tmp/%s", pci_name);
+	snprintf(socket_handle, sizeof(socket_handle), "/run/dpdk/nfp/%s", pci_name);
 
 	unlink(socket_handle);
 	sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
-- 
2.51.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC 4/4] net/cnxk: move socket from /tmp to /run/dpdk
  2025-12-31 18:56 [RFC 0/4] move unix domain sockets from /tmp to /run/dpdk Stephen Hemminger
                   ` (2 preceding siblings ...)
  2025-12-31 18:56 ` [RFC 3/4] net/nfp: " Stephen Hemminger
@ 2025-12-31 18:56 ` Stephen Hemminger
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2025-12-31 18:56 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao, Harman Kalra

Replace /tmp/cxk_rep_ctrl_msg_sock with /run/dpdk/cnxk_ctrl_msg_sock.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/cnxk/cnxk_eswitch.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/cnxk/cnxk_eswitch.h b/drivers/net/cnxk/cnxk_eswitch.h
index 0275e760fb..bef78a95ba 100644
--- a/drivers/net/cnxk/cnxk_eswitch.h
+++ b/drivers/net/cnxk/cnxk_eswitch.h
@@ -12,7 +12,7 @@
 
 #include "cn10k_tx.h"
 
-#define CNXK_ESWITCH_CTRL_MSG_SOCK_PATH "/tmp/cxk_rep_ctrl_msg_sock"
+#define CNXK_ESWITCH_CTRL_MSG_SOCK_PATH "/run/dpdk/cnxk_ctrl_msg_sock"
 #define CNXK_ESWITCH_VLAN_TPID		ROC_ESWITCH_VLAN_TPID
 #define CNXK_REP_ESWITCH_DEV_MZ		"cnxk_eswitch_dev"
 #define CNXK_ESWITCH_MAX_TXQ		256
-- 
2.51.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-12-31 18:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-31 18:56 [RFC 0/4] move unix domain sockets from /tmp to /run/dpdk Stephen Hemminger
2025-12-31 18:56 ` [RFC 1/4] net/af_xdp: replace /tmp with /run/dpdk Stephen Hemminger
2025-12-31 18:56 ` [RFC 2/4] examples/vm_power_manager: " Stephen Hemminger
2025-12-31 18:56 ` [RFC 3/4] net/nfp: " Stephen Hemminger
2025-12-31 18:56 ` [RFC 4/4] net/cnxk: move socket from /tmp to /run/dpdk Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).