*Note:  Changed subject line from /run/dpdk/powermanager ->
/run/dpdk/powermonitor*

Hi All,

Apologies for the delay.

So, I am following the above thread and below are what I understand are the
changes that are needed :


   1. I see that rte_eal_get_runtime_dir() is RTE_EXPORTED_SYMBOL.  I will
   verify that channel_manager has access to this symbol.
   2. Upon successful creation of /run/dpdk, I can mkdir
   CHANNEL_MGR_SOCKET_PATH (/var/run/dpdk/powermonitor) and opendir() that for
   subsequent processing.
   3. Fixup the documentation to reflect correct powermonitor path

Please let me know if I am missing anything or if I misinterpreting any
part of the email exchange.

Thanks for all your help and support.

-Sudheendra G Sampath

On Fri, May 29, 2026 at 9:01 AM Bruce Richardson <[email protected]>
wrote:

> On Fri, May 29, 2026 at 08:23:24AM -0700, Stephen Hemminger wrote:
> > On Fri, 29 May 2026 09:01:34 +0100
> > Bruce Richardson <[email protected]> wrote:
> >
> > > On Thu, May 28, 2026 at 07:04:48PM +0000, Sudheendra Sampath wrote:
> > > > This patch for bug 1832 will do the following:
> > > > 1.  If /run/dpdk is not present, it will create it first with and
> > > >     then create powermanager directory underneath it.
> > > > 2.  If /run/dpdk is present, it will verify it is actually a
> directory
> > > >     before creating subdirectory, powermanager.
> > > >
> > > I would suggest using $XDG_RUNTIME_DIR for the directory path, rather
> than
> > > hardcoding it by default. If XDG_RUNTIME_DIR is not set, then maybe
> > > consider using /run/dpdk. However, rather than /run/dpdk, I'd suggest
> using
> > > the normal runtime dir path on most distros as the default:
> > > /run/user/<uid>.
> > >
> > > /Bruce
> >
> > The login in EAL is a little more detailed.
> > The choice is from systemd conventions which follows filesystem
> hierarchy.
> >
> >
> > int eal_create_runtime_dir(void)
> > {
> >       const char *directory;
> >       char run_dir[PATH_MAX];
> >       char tmp[PATH_MAX];
> >       int ret;
> >
> >       /* from RuntimeDirectory= see systemd.exec */
> >       directory = getenv("RUNTIME_DIRECTORY");
> >       if (directory == NULL) {
> >               /*
> >                * Used standard convention defined in
> >                * XDG Base Directory Specification and
> >                * Filesystem Hierarchy Standard.
> >                */
> >               if (getuid() == 0)
> >                       directory = "/var/run";
> >               else
> >                       directory = getenv("XDG_RUNTIME_DIR") ? : "/tmp";
> >       }
> >
> >       /* create DPDK subdirectory under runtime dir */
> >       ret = snprintf(tmp, sizeof(tmp), "%s/dpdk", directory);
> >       if (ret < 0 || ret == sizeof(tmp)) {
> >               EAL_LOG(ERR, "Error creating DPDK runtime path name");
> >               return -1;
> >       }
> >
> >       /* create prefix-specific subdirectory under DPDK runtime dir */
> >       ret = snprintf(run_dir, sizeof(run_dir), "%s/%s",
> >                       tmp, eal_get_hugefile_prefix());
> >       if (ret < 0 || ret == sizeof(run_dir)) {
> >               EAL_LOG(ERR, "Error creating prefix-specific runtime path
> name");
> >               return -1;
> >       }
> >
> >       /* create the path if it doesn't exist. no "mkdir -p" here, so do
> it
> >        * step by step.
> >        */
> >       ret = mkdir(tmp, 0700);
> >       if (ret < 0 && errno != EEXIST) {
> >               EAL_LOG(ERR, "Error creating '%s': %s",
> >                       tmp, strerror(errno));
> >               return -1;
> >       }
> >
> >       ret = mkdir(run_dir, 0700);
> >       if (ret < 0 && errno != EEXIST) {
> >               EAL_LOG(ERR, "Error creating '%s': %s",
> >                       run_dir, strerror(errno));
> >               return -1;
> >       }
>
> Yes. Can the power manager call the rte_eal_get_runtime_dir() API and use
> that as a basis for its working directory? Save duplicating all this logic.
>
> /Bruce
>

Reply via email to