DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: david.marchand@redhat.com, stable@dpdk.org,
	David Hunt <david.hunt@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH 3/4] examples/vm_power: drop Unix path limit redefinition
Date: Wed, 20 May 2020 15:58:29 +0200	[thread overview]
Message-ID: <20200520135830.1178242-4-thomas@monjalon.net> (raw)
In-Reply-To: <20200520135830.1178242-1-thomas@monjalon.net>

The Unix socket path may be as long as UNIX_PATH_MAX.
This constant is supposed to be defined in sys/un.h.
On Linux, it appears to be in linux/un.h.

This constant was re-defined locally, based on a variable declaration.
It is breaking compilation with -fno-common (default in GCC 10)
We could avoid the variable declaration by using NULL struct,
but it looks simpler not redefining this system constant.

As the power library and its examples are restricted to Linux only,
the Linux header file is directly included.

Fixes: 0d74597c1b4f ("examples/vm_power: fix max length of unix socket path")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 examples/vm_power_manager/channel_manager.c | 1 -
 examples/vm_power_manager/channel_manager.h | 7 +------
 examples/vm_power_manager/power_manager.c   | 1 -
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index 4d13697208..74a2a677e8 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -4,7 +4,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/un.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <inttypes.h>
diff --git a/examples/vm_power_manager/channel_manager.h b/examples/vm_power_manager/channel_manager.h
index a2a2f2bba0..e55376fcdb 100644
--- a/examples/vm_power_manager/channel_manager.h
+++ b/examples/vm_power_manager/channel_manager.h
@@ -10,7 +10,7 @@ extern "C" {
 #endif
 
 #include <linux/limits.h>
-#include <sys/un.h>
+#include <linux/un.h>
 #include <rte_atomic.h>
 #include <stdbool.h>
 
@@ -26,11 +26,6 @@ extern "C" {
 /* FIFO file name template */
 #define CHANNEL_MGR_FIFO_PATTERN_NAME   "fifo"
 
-#ifndef UNIX_PATH_MAX
-struct sockaddr_un _sockaddr_un;
-#define UNIX_PATH_MAX sizeof(_sockaddr_un.sun_path)
-#endif
-
 #define MAX_CLIENTS 64
 #define MAX_VCPUS 20
 
diff --git a/examples/vm_power_manager/power_manager.c b/examples/vm_power_manager/power_manager.c
index 7b4f4b3c4d..cd51d4741f 100644
--- a/examples/vm_power_manager/power_manager.c
+++ b/examples/vm_power_manager/power_manager.c
@@ -6,7 +6,6 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <inttypes.h>
-#include <sys/un.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <dirent.h>
-- 
2.26.2


  parent reply	other threads:[~2020-05-20 13:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 13:58 [dpdk-dev] [PATCH 0/4] fix build with GCC 10 Thomas Monjalon
2020-05-20 13:58 ` [dpdk-dev] [PATCH 1/4] net/mvpp2: fix build with gcc 10 Thomas Monjalon
2020-05-20 14:05   ` [dpdk-dev] [EXT] " Liron Himi
2020-05-20 13:58 ` [dpdk-dev] [PATCH 2/4] examples/vm_power: fix build with -fno-common Thomas Monjalon
2020-05-20 13:58 ` Thomas Monjalon [this message]
2020-05-20 13:58 ` [dpdk-dev] [PATCH 4/4] devtools: allow warnings in ABI reference build Thomas Monjalon
2020-05-20 14:52 ` [dpdk-dev] [PATCH 0/4] fix build with GCC 10 David Marchand
2020-05-20 16:45 ` Kevin Traynor
2020-05-21 13:39   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200520135830.1178242-4-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=david.hunt@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).