From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) by dpdk.org (Postfix) with ESMTP id 0BB4958EE for ; Fri, 26 Jul 2013 13:25:32 +0200 (CEST) Received: by mail-ee0-f53.google.com with SMTP id e53so1514914eek.12 for ; Fri, 26 Jul 2013 04:25:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:x-gm-message-state; bh=Och2Qz9VR6pcYOM2miwBE0BM18tnqolgf7kHvngmvG0=; b=aA6PRjfBdzpbCi1bXK7rLg6HWT7d9LZRsTncA3bKknAkXB6aNtML1CqljjfBDSXX9e W6zAHsInfotuYl79CHUnMZANujJcDnTFVRbL1qHbPPi+OIRsFwaj+H63w78edio6ZuoK vOo+/2pUackc/elYsm2nnZt+tccFt7tEjMiGAA1JBxqzKL7Fk0PyNq8SBm/28RMILR3g GuH/9z2ZMhp+xRhB0lHxOw6UETtJmX8elNUMTRvzmqRY+W5qGIx7uBjXZvIqyEmsbv92 rTzixytwmzZ71eyyQx6DoVwsh4L0dRsB6dbH9Tl2X3/cdZU4QWyODtl76LfWOlf7jsF5 AM8w== X-Received: by 10.15.86.65 with SMTP id h41mr46196645eez.147.1374837955673; Fri, 26 Jul 2013 04:25:55 -0700 (PDT) Received: from 6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id ci50sm80360842eeb.12.2013.07.26.04.25.53 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 26 Jul 2013 04:25:54 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Fri, 26 Jul 2013 13:25:48 +0200 Message-Id: <1374837948-20169-1-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 1.7.12 X-Gm-Message-State: ALoCoQkPVLbLycWk9F0tkJdCXAaBpVKSH9W6qiGJweXf1KcZC8q/hG48zeHVglEIIBQ/E1x7ZiwP Subject: [dpdk-dev] [PATCH] kni: fix build with kernel < 3.3 with netdev_features_t backport 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: Fri, 26 Jul 2013 11:25:33 -0000 The netdev_features_t typedef appeared in Linux 3.3, but checking the kernel version isn't enough with some distributions (such as Debian Wheezy) that backported it into 3.2, causing a compilation failure due to redefinition. Since the presence of a typedef can't be tested at compile time, this commit adds type kni_netdev_features_t, which, depending on the kernel version, translates either to u32 or netdev_features_t. Signed-off-by: Adrien Mazarguil --- lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 6 +++--- lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 3 ++- lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c index f0728bb..9d772fa 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -1831,8 +1831,8 @@ void igb_reset(struct igb_adapter *adapter) } #ifdef HAVE_NDO_SET_FEATURES -static netdev_features_t igb_fix_features(struct net_device *netdev, - netdev_features_t features) +static kni_netdev_features_t igb_fix_features(struct net_device *netdev, + kni_netdev_features_t features) { /* * Since there is no support for separate tx vlan accel @@ -1849,7 +1849,7 @@ static netdev_features_t igb_fix_features(struct net_device *netdev, } static int igb_set_features(struct net_device *netdev, - netdev_features_t features) + kni_netdev_features_t features) { u32 changed = netdev->features ^ features; diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h index 553e1c0..a2aa361 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3012,8 +3012,9 @@ static inline void __kc_skb_frag_unref(skb_frag_t *frag) /*****************************************************************************/ #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) ) -typedef u32 netdev_features_t; +typedef u32 kni_netdev_features_t; #else /* ! < 3.3.0 */ +typedef netdev_features_t kni_netdev_features_t; #define HAVE_INT_NDO_VLAN_RX_ADD_VID #ifdef ETHTOOL_SRXNTUPLE #undef ETHTOOL_SRXNTUPLE diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h index a0e0698..6ac890a 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h @@ -3078,8 +3078,9 @@ static inline void __kc_skb_frag_unref(skb_frag_t *frag) /*****************************************************************************/ #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) ) -typedef u32 netdev_features_t; +typedef u32 kni_netdev_features_t; #else /* ! < 3.3.0 */ +typedef netdev_features_t kni_netdev_features_t; #define HAVE_INT_NDO_VLAN_RX_ADD_VID #ifdef ETHTOOL_SRXNTUPLE #undef ETHTOOL_SRXNTUPLE -- 1.7.12