From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id BE66D7F14 for ; Mon, 20 Jun 2016 15:31:52 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id f126so69626487wma.1 for ; Mon, 20 Jun 2016 06:31:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=F3gVcEUdLK9WroWpeET8gAuFuyvZjtvj5tKP5T+LFAM=; b=mI7pfj7KdOnhH91LHPmYnym/3/GNk8WInwwWEsTqtjRkCnfNF6K/YaB40P/9tG7MWT 6UsaPUoTbaLAgltyaGh6kxGnMKilsHEXb1vVmDHtYGMiMO7PWwbuYebl5s9Yjglj3+JG dGRa8EvjEZ1ph/VrPmV7jHeK5iws8J3wKmk2iBg2XPOO7rUr4SDigeDSps/TDoegqWR5 2VjJ19MahGMPU4Y5juZPXFQnYEReljg28kLQYDl7N8WfkJc1W1YsLM05tlhpiXUiXk4b ri4yascmmUs+ZSqKRpAhRYxrKCRDw/xZfWjgPAvyTNxsGngPOGaBJ2QdUaLqUcNWytkO vdPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=F3gVcEUdLK9WroWpeET8gAuFuyvZjtvj5tKP5T+LFAM=; b=Y3TC8NctPCtG88BQTRpURYeMrYpNIklkCcz+i8/jtNZnDEwLGFl5NApxUifZHi49cT Gr8PLYUnkh8mQ9VMN3t/eJSGxU3gkVO5vlBJ7eRrFZVuHRaC5oJ2uwr76kgvGIushxpz eOy2MAXpobjDA+PSXEnynwWf/Kb2bEVWpEPgUP8Mgv9mT7c0ehNJ2woV5cTiPsudFQXR SQszJf/dIqPrz3nB2XNwn5REWInZlGyZpC2de8B4myp2h4Y7Q+0qE5QDF5EMUsoeH8gr zCiLYdgfxMcWZC1g29MBnW9cK460/3RWXIsQBNmBLO9BSRCkKVsLW4eJVrmbvcxfhbgw tEEg== X-Gm-Message-State: ALyK8tIuGlqSHaGVdW4fguR9omGi1QaCtcLyL17wFVAcY57egkrt73jA8otrFt6JkassOO+f X-Received: by 10.28.169.69 with SMTP id s66mr11335905wme.78.1466429512376; Mon, 20 Jun 2016 06:31:52 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id e5sm63667074wjj.10.2016.06.20.06.31.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Jun 2016 06:31:51 -0700 (PDT) From: Adrien Mazarguil To: Bruce Richardson Cc: Ferruh Yigit , dev@dpdk.org Date: Mon, 20 Jun 2016 15:31:46 +0200 Message-Id: <1466429506-16922-1-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <20160620100450.GA19416@bricha3-MOBL3> References: <20160620100450.GA19416@bricha3-MOBL3> Subject: [dpdk-dev] [PATCH v2] mlx: fix compilation with Glibc 2.20 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 13:31:52 -0000 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 Signed-off-by: Adrien Mazarguil --- 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 #include #include -#include #include #include #include @@ -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 = ðpause; + ifr.ifr_data = (void *)ðpause; 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 = ðpause; + ifr.ifr_data = (void *)ðpause; 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 #include #include -#include /* 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 #include #include -#include #include #include #include @@ -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 = ðpause; + ifr.ifr_data = (void *)ðpause; 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 = ðpause; + ifr.ifr_data = (void *)ðpause; 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 #include #include -#include #include #include -- 2.1.4