[PATCH 1/2] mlx: fix compilation with recent Glibc

Subsystems: networking drivers, the rest

STALE3694d

10 messages, 3 authors, 2016-06-20 · open the first message on its own page

[PATCH 1/2] mlx: fix compilation with recent Glibc

From: Adrien Mazarguil <hidden>
Date: 2016-06-10 15:09:39

Various BSD ioctl macros are not exposed anymore when _XOPEN_SOURCE is
defined, and linux/if.h now conflicts with net/if.h.

Suggested-by: Bruce Richardson <redacted>
Signed-off-by: Adrien Mazarguil <redacted>
---
 drivers/net/mlx4/Makefile      | 1 +
 drivers/net/mlx4/mlx4.c        | 7 +++----
 drivers/net/mlx5/Makefile      | 1 +
 drivers/net/mlx5/mlx5.h        | 1 -
 drivers/net/mlx5/mlx5_ethdev.c | 7 +++----
 drivers/net/mlx5/mlx5_mac.c    | 1 -
 6 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile
index d2f5692..6ec33a6 100644
--- a/drivers/net/mlx4/Makefile
+++ b/drivers/net/mlx4/Makefile
@@ -48,6 +48,7 @@ CFLAGS += -O3
 CFLAGS += -std=gnu99 -Wall -Wextra
 CFLAGS += -g
 CFLAGS += -I.
+CFLAGS += -D_DEFAULT_SOURCE
 CFLAGS += -D_XOPEN_SOURCE=600
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -libverbs
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 9ed1491..5000eb1 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -54,7 +54,6 @@
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <linux/if.h>
 #include <linux/ethtool.h>
 #include <linux/sockios.h>
 #include <fcntl.h>
@@ -4771,7 +4770,7 @@ mlx4_link_update_unlocked(struct rte_eth_dev *dev, int wait_to_complete)
 	memset(&dev_link, 0, sizeof(dev_link));
 	dev_link.link_status = ((ifr.ifr_flags & IFF_UP) &&
 				(ifr.ifr_flags & IFF_RUNNING));
-	ifr.ifr_data = &edata;
+	ifr.ifr_data = (void *)&edata;
 	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
 		WARN("ioctl(SIOCETHTOOL, ETHTOOL_GSET) failed: %s",
 		     strerror(errno));
@@ -4930,7 +4929,7 @@ mlx4_dev_get_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 
 	if (mlx4_is_secondary())
 		return -E_RTE_SECONDARY;
-	ifr.ifr_data = &ethpause;
+	ifr.ifr_data = (void *)&ethpause;
 	priv_lock(priv);
 	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
 		ret = errno;
@@ -4980,7 +4979,7 @@ mlx4_dev_set_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 
 	if (mlx4_is_secondary())
 		return -E_RTE_SECONDARY;
-	ifr.ifr_data = &ethpause;
+	ifr.ifr_data = (void *)&ethpause;
 	ethpause.autoneg = fc_conf->autoneg;
 	if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
 	    (fc_conf->mode & RTE_FC_RX_PAUSE))
diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index 92bfa07..a25649b 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -59,6 +59,7 @@ CFLAGS += -O3
 CFLAGS += -std=gnu99 -Wall -Wextra
 CFLAGS += -g
 CFLAGS += -I.
+CFLAGS += -D_DEFAULT_SOURCE
 CFLAGS += -D_XOPEN_SOURCE=600
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-strict-prototypes
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 2487662..fb4f95a 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -39,7 +39,6 @@
 #include <limits.h>
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if.h>
 
 /* Verbs header. */
 /* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 36b369e..9a8d1d9 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -44,7 +44,6 @@
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <linux/if.h>
 #include <linux/ethtool.h>
 #include <linux/sockios.h>
 #include <fcntl.h>
@@ -617,7 +616,7 @@ mlx5_link_update_unlocked(struct rte_eth_dev *dev, int wait_to_complete)
 	memset(&dev_link, 0, sizeof(dev_link));
 	dev_link.link_status = ((ifr.ifr_flags & IFF_UP) &&
 				(ifr.ifr_flags & IFF_RUNNING));
-	ifr.ifr_data = &edata;
+	ifr.ifr_data = (void *)&edata;
 	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
 		WARN("ioctl(SIOCETHTOOL, ETHTOOL_GSET) failed: %s",
 		     strerror(errno));
@@ -767,7 +766,7 @@ mlx5_dev_get_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	if (mlx5_is_secondary())
 		return -E_RTE_SECONDARY;
 
-	ifr.ifr_data = &ethpause;
+	ifr.ifr_data = (void *)&ethpause;
 	priv_lock(priv);
 	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
 		ret = errno;
@@ -818,7 +817,7 @@ mlx5_dev_set_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	if (mlx5_is_secondary())
 		return -E_RTE_SECONDARY;
 
-	ifr.ifr_data = &ethpause;
+	ifr.ifr_data = (void *)&ethpause;
 	ethpause.autoneg = fc_conf->autoneg;
 	if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
 	    (fc_conf->mode & RTE_FC_RX_PAUSE))
diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
index c9cea48..f6b27bb 100644
--- a/drivers/net/mlx5/mlx5_mac.c
+++ b/drivers/net/mlx5/mlx5_mac.c
@@ -38,7 +38,6 @@
 #include <inttypes.h>
 #include <errno.h>
 #include <netinet/in.h>
-#include <linux/if.h>
 #include <sys/ioctl.h>
 #include <arpa/inet.h>
 
-- 
2.1.4

[PATCH 2/2] mlx: regenerate autoconf file automatically

From: Adrien Mazarguil <hidden>
Date: 2016-06-10 15:09:43

Mellanox PMDs must be rebuilt if a Verbs update would cause the autoconf
file to differ.

Signed-off-by: Adrien Mazarguil <redacted>
---
 drivers/net/mlx4/Makefile | 13 +++++++++++--
 drivers/net/mlx5/Makefile | 13 +++++++++++--
 2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile
index 6ec33a6..ca6e483 100644
--- a/drivers/net/mlx4/Makefile
+++ b/drivers/net/mlx4/Makefile
@@ -99,7 +99,9 @@ ifndef V
 AUTOCONF_OUTPUT := >/dev/null
 endif
 
-mlx4_autoconf.h: $(RTE_SDK)/scripts/auto-config-h.sh
+mlx4_autoconf.h.new: FORCE
+
+mlx4_autoconf.h.new: $(RTE_SDK)/scripts/auto-config-h.sh
 	$Q $(RM) -f -- '$@'
 	$Q sh -- '$<' '$@' \
 		RSS_SUPPORT \
@@ -119,9 +121,16 @@ mlx4_autoconf.h: $(RTE_SDK)/scripts/auto-config-h.sh
 		enum IBV_EXP_QP_BURST_CREATE_DISABLE_ETH_LOOPBACK \
 		$(AUTOCONF_OUTPUT)
 
+# Create mlx4_autoconf.h or update it in case it differs from the new one.
+
+mlx4_autoconf.h: mlx4_autoconf.h.new
+	$Q [ -f '$@' ] && \
+		cmp '$<' '$@' $(AUTOCONF_OUTPUT) || \
+		mv '$<' '$@'
+
 mlx4.o: mlx4_autoconf.h
 
 clean_mlx4: FORCE
-	$Q rm -f -- mlx4_autoconf.h
+	$Q rm -f -- mlx4_autoconf.h mlx4_autoconf.h.new
 
 clean: clean_mlx4
diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index a25649b..81061fe 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -107,7 +107,9 @@ ifndef V
 AUTOCONF_OUTPUT := >/dev/null
 endif
 
-mlx5_autoconf.h: $(RTE_SDK)/scripts/auto-config-h.sh
+mlx5_autoconf.h.new: FORCE
+
+mlx5_autoconf.h.new: $(RTE_SDK)/scripts/auto-config-h.sh
 	$Q $(RM) -f -- '$@'
 	$Q sh -- '$<' '$@' \
 		HAVE_EXP_QUERY_DEVICE \
@@ -148,9 +150,16 @@ mlx5_autoconf.h: $(RTE_SDK)/scripts/auto-config-h.sh
 		enum IBV_EXP_RECEIVE_WQ_CVLAN_INSERTION \
 		$(AUTOCONF_OUTPUT)
 
+# Create mlx5_autoconf.h or update it in case it differs from the new one.
+
+mlx5_autoconf.h: mlx5_autoconf.h.new
+	$Q [ -f '$@' ] && \
+		cmp '$<' '$@' $(AUTOCONF_OUTPUT) || \
+		mv '$<' '$@'
+
 $(SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD):.c=.o): mlx5_autoconf.h
 
 clean_mlx5: FORCE
-	$Q rm -f -- mlx5_autoconf.h
+	$Q rm -f -- mlx5_autoconf.h mlx5_autoconf.h.new
 
 clean: clean_mlx5
-- 
2.1.4

Re: [PATCH 1/2] mlx: fix compilation with recent Glibc

From: Bruce Richardson <hidden>
Date: 2016-06-13 12:53:32

On Fri, Jun 10, 2016 at 05:09:31PM +0200, Adrien Mazarguil wrote:
Various BSD ioctl macros are not exposed anymore when _XOPEN_SOURCE is
defined, and linux/if.h now conflicts with net/if.h.

Suggested-by: Bruce Richardson <redacted>
Signed-off-by: Adrien Mazarguil <redacted>
Acked-by: Bruce Richardson <redacted>

Re: [PATCH 1/2] mlx: fix compilation with recent Glibc

From: Bruce Richardson <hidden>
Date: 2016-06-13 13:08:11

On Mon, Jun 13, 2016 at 01:53:28PM +0100, Bruce Richardson wrote:
On Fri, Jun 10, 2016 at 05:09:31PM +0200, Adrien Mazarguil wrote:
quoted
Various BSD ioctl macros are not exposed anymore when _XOPEN_SOURCE is
defined, and linux/if.h now conflicts with net/if.h.

Suggested-by: Bruce Richardson <redacted>
Signed-off-by: Adrien Mazarguil <redacted>
Acked-by: Bruce Richardson <redacted>
Patchset applied to dpdk-next-net/rel_16_07

/Bruce

[PATCH] mlx: fix compilation with older Glibc

From: Adrien Mazarguil <hidden>
Date: 2016-06-14 09:22:10

A missing define in the previous patch causes additional compilation
issues.

Fixes: 3025206f5060 ("mlx: fix compilation with recent Glibc")

Signed-off-by: Adrien Mazarguil <redacted>
---
 drivers/net/mlx4/Makefile | 1 +
 drivers/net/mlx5/Makefile | 1 +
 2 files changed, 2 insertions(+)
diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile
index ca6e483..efed953 100644
--- a/drivers/net/mlx4/Makefile
+++ b/drivers/net/mlx4/Makefile
@@ -48,6 +48,7 @@ CFLAGS += -O3
 CFLAGS += -std=gnu99 -Wall -Wextra
 CFLAGS += -g
 CFLAGS += -I.
+CFLAGS += -D_BSD_SOURCE
 CFLAGS += -D_DEFAULT_SOURCE
 CFLAGS += -D_XOPEN_SOURCE=600
 CFLAGS += $(WERROR_FLAGS)
diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index 283d8eb..66687e8 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -60,6 +60,7 @@ CFLAGS += -O3
 CFLAGS += -std=gnu99 -Wall -Wextra
 CFLAGS += -g
 CFLAGS += -I.
+CFLAGS += -D_BSD_SOURCE
 CFLAGS += -D_DEFAULT_SOURCE
 CFLAGS += -D_XOPEN_SOURCE=600
 CFLAGS += $(WERROR_FLAGS)
-- 
2.1.4

Re: [PATCH] mlx: fix compilation with older Glibc

From: Ferruh Yigit <hidden>
Date: 2016-06-17 16:30:19

On 6/14/2016 10:22 AM, Adrien Mazarguil wrote:
A missing define in the previous patch causes additional compilation
issues.

Fixes: 3025206f5060 ("mlx: fix compilation with recent Glibc")

Signed-off-by: Adrien Mazarguil <redacted>
"older Glibc" or "recent Glibc" can be very hard to trace from git
history later.

Does it make sense to add glibc version info for the failing ones or
fixed one?

Thanks,
ferruh

Re: [PATCH] mlx: fix compilation with older Glibc

From: Adrien Mazarguil <hidden>
Date: 2016-06-20 09:25:24

On Fri, Jun 17, 2016 at 05:29:53PM +0100, Ferruh Yigit wrote:
On 6/14/2016 10:22 AM, Adrien Mazarguil wrote:
quoted
A missing define in the previous patch causes additional compilation
issues.

Fixes: 3025206f5060 ("mlx: fix compilation with recent Glibc")

Signed-off-by: Adrien Mazarguil <redacted>
"older Glibc" or "recent Glibc" can be very hard to trace from git
history later.
I wasn't sure about the exact version, it appears to be 2.19 and/or 2.20,
where _BSD_SOURCE was modified and subsequently removed.

I suggest squashing this patch into the original broken commit ("mlx: fix
compilation with recent Glibc") if possible, I did not submit a v2 as it is
already applied on dpdk-next-net.
Does it make sense to add glibc version info for the failing ones or
fixed one?
Depends if we can modify the first commit. If we do, let's squash them
together before adding version information, otherwise let's modify the
second one only.

I can submit a v2 that overrides both commits or only the second one, tell
me what you think is best.

-- 
Adrien Mazarguil
6WIND

Re: [PATCH] mlx: fix compilation with older Glibc

From: Bruce Richardson <hidden>
Date: 2016-06-20 10:05:27

On Mon, Jun 20, 2016 at 11:25:18AM +0200, Adrien Mazarguil wrote:
On Fri, Jun 17, 2016 at 05:29:53PM +0100, Ferruh Yigit wrote:
quoted
On 6/14/2016 10:22 AM, Adrien Mazarguil wrote:
quoted
A missing define in the previous patch causes additional compilation
issues.

Fixes: 3025206f5060 ("mlx: fix compilation with recent Glibc")

Signed-off-by: Adrien Mazarguil <redacted>
"older Glibc" or "recent Glibc" can be very hard to trace from git
history later.
I wasn't sure about the exact version, it appears to be 2.19 and/or 2.20,
where _BSD_SOURCE was modified and subsequently removed.

I suggest squashing this patch into the original broken commit ("mlx: fix
compilation with recent Glibc") if possible, I did not submit a v2 as it is
already applied on dpdk-next-net.
quoted
Does it make sense to add glibc version info for the failing ones or
fixed one?
Depends if we can modify the first commit. If we do, let's squash them
together before adding version information, otherwise let's modify the
second one only.

I can submit a v2 that overrides both commits or only the second one, tell
me what you think is best.

-- 
While I don't like squashing or modifying already-applied commits on the next
tree, since this is for a compilation issue, I may be able to make an exception.

To evaluate it, please send on the proposed updated commit message for the
combined commits. I assume the code to be squashed is as in this V1 patch.

Regards,
/Bruce

[PATCH v2] mlx: fix compilation with Glibc 2.20

From: Adrien Mazarguil <hidden>
Date: 2016-06-20 13:31:52

Since _BSD_SOURCE was deprecated in favor of _DEFAULT_SOURCE in Glibc 2.19
and entirely removed in 2.20, various BSD ioctl macros are not exposed
anymore when _XOPEN_SOURCE is defined, and linux/if.h now conflicts with
net/if.h.

Add _DEFAULT_SOURCE and keep _BSD_SOURCE for compatibility with older
versions.

Suggested-by: Bruce Richardson <redacted>
Signed-off-by: Adrien Mazarguil <redacted>
---
 drivers/net/mlx4/Makefile      | 2 ++
 drivers/net/mlx4/mlx4.c        | 7 +++----
 drivers/net/mlx5/Makefile      | 2 ++
 drivers/net/mlx5/mlx5.h        | 1 -
 drivers/net/mlx5/mlx5_ethdev.c | 7 +++----
 drivers/net/mlx5/mlx5_mac.c    | 1 -
 6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile
index f3268fb..efed953 100644
--- a/drivers/net/mlx4/Makefile
+++ b/drivers/net/mlx4/Makefile
@@ -48,6 +48,8 @@ CFLAGS += -O3
 CFLAGS += -std=gnu99 -Wall -Wextra
 CFLAGS += -g
 CFLAGS += -I.
+CFLAGS += -D_BSD_SOURCE
+CFLAGS += -D_DEFAULT_SOURCE
 CFLAGS += -D_XOPEN_SOURCE=600
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -libverbs
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 9faea6c..6228688 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -54,7 +54,6 @@
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <linux/if.h>
 #include <linux/ethtool.h>
 #include <linux/sockios.h>
 #include <fcntl.h>
@@ -4771,7 +4770,7 @@ mlx4_link_update_unlocked(struct rte_eth_dev *dev, int wait_to_complete)
 	memset(&dev_link, 0, sizeof(dev_link));
 	dev_link.link_status = ((ifr.ifr_flags & IFF_UP) &&
 				(ifr.ifr_flags & IFF_RUNNING));
-	ifr.ifr_data = &edata;
+	ifr.ifr_data = (void *)&edata;
 	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
 		WARN("ioctl(SIOCETHTOOL, ETHTOOL_GSET) failed: %s",
 		     strerror(errno));
@@ -4933,7 +4932,7 @@ mlx4_dev_get_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 
 	if (mlx4_is_secondary())
 		return -E_RTE_SECONDARY;
-	ifr.ifr_data = &ethpause;
+	ifr.ifr_data = (void *)&ethpause;
 	priv_lock(priv);
 	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
 		ret = errno;
@@ -4983,7 +4982,7 @@ mlx4_dev_set_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 
 	if (mlx4_is_secondary())
 		return -E_RTE_SECONDARY;
-	ifr.ifr_data = &ethpause;
+	ifr.ifr_data = (void *)&ethpause;
 	ethpause.autoneg = fc_conf->autoneg;
 	if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
 	    (fc_conf->mode & RTE_FC_RX_PAUSE))
diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index 2711a87..66687e8 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -60,6 +60,8 @@ CFLAGS += -O3
 CFLAGS += -std=gnu99 -Wall -Wextra
 CFLAGS += -g
 CFLAGS += -I.
+CFLAGS += -D_BSD_SOURCE
+CFLAGS += -D_DEFAULT_SOURCE
 CFLAGS += -D_XOPEN_SOURCE=600
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-strict-prototypes
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 17d4e6e..8349e5b 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -39,7 +39,6 @@
 #include <limits.h>
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if.h>
 
 /* Verbs header. */
 /* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 32af304..757f8e4 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -44,7 +44,6 @@
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <linux/if.h>
 #include <linux/ethtool.h>
 #include <linux/sockios.h>
 #include <fcntl.h>
@@ -657,7 +656,7 @@ mlx5_link_update_unlocked(struct rte_eth_dev *dev, int wait_to_complete)
 	memset(&dev_link, 0, sizeof(dev_link));
 	dev_link.link_status = ((ifr.ifr_flags & IFF_UP) &&
 				(ifr.ifr_flags & IFF_RUNNING));
-	ifr.ifr_data = &edata;
+	ifr.ifr_data = (void *)&edata;
 	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
 		WARN("ioctl(SIOCETHTOOL, ETHTOOL_GSET) failed: %s",
 		     strerror(errno));
@@ -864,7 +863,7 @@ mlx5_dev_get_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	if (mlx5_is_secondary())
 		return -E_RTE_SECONDARY;
 
-	ifr.ifr_data = &ethpause;
+	ifr.ifr_data = (void *)&ethpause;
 	priv_lock(priv);
 	if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
 		ret = errno;
@@ -915,7 +914,7 @@ mlx5_dev_set_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	if (mlx5_is_secondary())
 		return -E_RTE_SECONDARY;
 
-	ifr.ifr_data = &ethpause;
+	ifr.ifr_data = (void *)&ethpause;
 	ethpause.autoneg = fc_conf->autoneg;
 	if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
 	    (fc_conf->mode & RTE_FC_RX_PAUSE))
diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
index c9cea48..f6b27bb 100644
--- a/drivers/net/mlx5/mlx5_mac.c
+++ b/drivers/net/mlx5/mlx5_mac.c
@@ -38,7 +38,6 @@
 #include <inttypes.h>
 #include <errno.h>
 #include <netinet/in.h>
-#include <linux/if.h>
 #include <sys/ioctl.h>
 #include <arpa/inet.h>
 
-- 
2.1.4

Re: [PATCH v2] mlx: fix compilation with Glibc 2.20

From: Bruce Richardson <hidden>
Date: 2016-06-20 15:24:58

On Mon, Jun 20, 2016 at 03:31:46PM +0200, Adrien Mazarguil wrote:
Since _BSD_SOURCE was deprecated in favor of _DEFAULT_SOURCE in Glibc 2.19
and entirely removed in 2.20, various BSD ioctl macros are not exposed
anymore when _XOPEN_SOURCE is defined, and linux/if.h now conflicts with
net/if.h.

Add _DEFAULT_SOURCE and keep _BSD_SOURCE for compatibility with older
versions.

Suggested-by: Bruce Richardson <redacted>
Signed-off-by: Adrien Mazarguil <redacted>
Applied to dpdk-next-net in place of previous incomplete fix.

/Bruce
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help