Skip to contentSkip to conversation

use config flags for target OS checks

PATCH In review Thomas Monjalon 2 participants 2 messages Dec 5, 2016 – Jan 15, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 use config flags for target OS checks

Clean up the code to always use the flags RTE_EXEC_ENV_*APP set up in the DPDK configuration instead of the native ones.

---
 app/test-pmd/cmdline.c                       | 4 ++--
 app/test/commands.c                          | 4 ++--
 app/test/test_cmdline_ipaddr.c               | 4 ++--
 drivers/net/bnx2x/bnx2x.c                    | 4 ++--
 drivers/net/bnx2x/bnx2x.h                    | 4 ++--
 examples/cmdline/commands.c                  | 4 ++--
 lib/librte_cmdline/cmdline_parse_etheraddr.c | 2 +-
 lib/librte_cmdline/cmdline_parse_ipaddr.c    | 4 ++--
 lib/librte_eal/common/include/rte_lcore.h    | 4 ++--
 9 files changed, 17 insertions(+), 17 deletions(-)
app/test-pmd/cmdline.c +2 -2
index 63b55dc..7f3667d 100644
@@ -41,8 +41,8 @@
 #include <termios.h>
 #include <unistd.h>
 #include <inttypes.h>
-#ifndef __linux__
-#ifndef __FreeBSD__
+#ifndef RTE_EXEC_ENV_LINUXAPP
+#ifndef RTE_EXEC_ENV_BSDAPP
 #include <net/socket.h>
 #else
 #include <sys/socket.h>
app/test/commands.c +2 -2
index 2df46b0..da0c035 100644
@@ -39,8 +39,8 @@
 #include <stdlib.h>
 #include <netinet/in.h>
 #include <termios.h>
-#ifndef __linux__
-#ifndef __FreeBSD__
+#ifndef RTE_EXEC_ENV_LINUXAPP
+#ifndef RTE_EXEC_ENV_BSDAPP
 #include <net/socket.h>
 #endif
 #endif
app/test/test_cmdline_ipaddr.c +2 -2
index 471d2ff..16570fb 100644
@@ -36,8 +36,8 @@
 #include <inttypes.h>
 #include <netinet/in.h>
 
-#ifndef __linux__
-#ifndef __FreeBSD__
+#ifndef RTE_EXEC_ENV_LINUXAPP
+#ifndef RTE_EXEC_ENV_BSDAPP
 #include <net/socket.h>
 #else
 #include <sys/socket.h>
drivers/net/bnx2x/bnx2x.c +2 -2
index 2856630..47cf5d3 100644
@@ -9484,7 +9484,7 @@ static int bnx2x_pci_get_caps(struct bnx2x_softc *sc)
 		return -ENOMEM;
 	}
 
-#ifndef __FreeBSD__
+#ifndef RTE_EXEC_ENV_BSDAPP
 	pci_read(sc, PCI_STATUS, &status, 2);
 	if (!(status & PCI_STATUS_CAP_LIST)) {
 #else
@@ -9495,7 +9495,7 @@ static int bnx2x_pci_get_caps(struct bnx2x_softc *sc)
 		return -1;
 	}
 
-#ifndef __FreeBSD__
+#ifndef RTE_EXEC_ENV_BSDAPP
 	pci_read(sc, PCI_CAPABILITY_LIST, &pci_cap.next, 1);
 #else
 	pci_read(sc, PCIR_CAP_PTR, &pci_cap.next, 1);
drivers/net/bnx2x/bnx2x.h +2 -2
index 5cefea4..006ad28 100644
@@ -41,7 +41,7 @@
 
 #include "elink.h"
 
-#ifndef __FreeBSD__
+#ifndef RTE_EXEC_ENV_BSDAPP
 #include <linux/pci_regs.h>
 
 #define PCIY_PMG                       PCI_CAP_ID_PM
@@ -71,7 +71,7 @@
 #define IFM_10G_TWINAX                 22 /* 10GBase Twinax copper */
 #define IFM_10G_T                      26 /* 10GBase-T - RJ45 */
 
-#ifndef __FreeBSD__
+#ifndef RTE_EXEC_ENV_BSDAPP
 #define PCIR_EXPRESS_DEVICE_STA        PCI_EXP_TYPE_RC_EC
 #define PCIM_EXP_STA_TRANSACTION_PND   PCI_EXP_DEVSTA_TRPND
 #define PCIR_EXPRESS_LINK_STA          PCI_EXP_LNKSTA
examples/cmdline/commands.c +2 -2
index f3ba247..205a205 100644
@@ -66,8 +66,8 @@
 #include <errno.h>
 #include <netinet/in.h>
 #include <termios.h>
-#ifndef __linux__
-	#ifdef __FreeBSD__
+#ifndef RTE_EXEC_ENV_LINUXAPP
+	#ifdef RTE_EXEC_ENV_BSDAPP
 		#include <sys/socket.h>
 	#else
 		#include <net/socket.h>
lib/librte_cmdline/cmdline_parse_etheraddr.c +1 -1
index dbfe4a6..1f26426 100644
@@ -85,7 +85,7 @@ struct cmdline_token_ops cmdline_token_etheraddr_ops = {
 #define ETHER_ADDRSTRLENLONG 18
 #define ETHER_ADDRSTRLENSHORT 15
 
-#ifdef __linux__
+#ifdef RTE_EXEC_ENV_LINUXAPP
 #define ea_oct ether_addr_octet
 #else
 #define ea_oct octet
lib/librte_cmdline/cmdline_parse_ipaddr.c +2 -2
index d3d3e04..4ef1c57 100644
@@ -86,8 +86,8 @@
 #include <string.h>
 #include <errno.h>
 #include <netinet/in.h>
-#ifndef __linux__
-#ifndef __FreeBSD__
+#ifndef RTE_EXEC_ENV_LINUXAPP
+#ifndef RTE_EXEC_ENV_BSDAPP
 #include <net/socket.h>
 #else
 #include <sys/socket.h>
lib/librte_eal/common/include/rte_lcore.h +2 -2
index fe7b586..f74bc0c 100644
@@ -50,9 +50,9 @@ extern "C" {
 
 #define LCORE_ID_ANY     UINT32_MAX       /**< Any lcore. */
 
-#if defined(__linux__)
+#if defined(RTE_EXEC_ENV_LINUXAPP)
 	typedef	cpu_set_t rte_cpuset_t;
-#elif defined(__FreeBSD__)
+#elif defined(RTE_EXEC_ENV_BSDAPP)
 #include <pthread_np.h>
 	typedef cpuset_t rte_cpuset_t;
 #endif
Signature · 1 line
2.7.0
#1 lore raw
Quoted 4 lines · On 12/5/2016 5:50 PM, thomas.monjalon at 6wind.com (Thomas Monjalon) wrote:

Clean up the code to always use the flags RTE_EXEC_ENV_*APP set up in the DPDK configuration instead of the native ones.

Signed-off-by Thomas Monjalon <thomas.monjalon at 6wind.com>

Hi Thomas,

This one is similar, there is not comment on the patch for a long time, can we reject it?

Patch: https://patches.dpdk.org/patch/17686/