From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 2C83B1B1B0 for ; Wed, 24 Jan 2018 16:35:54 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D1DF02231E; Wed, 24 Jan 2018 10:35:53 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 24 Jan 2018 10:35:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:content-transfer-encoding:content-type:date:from :message-id:mime-version:subject:to:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=VlXftPUYGBBgZd0OzABUrbVjQ7FkG3+QPPQs35E0a JE=; b=bAaSc5rCzSsSvu+ni3kXWrWMSLhMtxy0Kayj29ZnU5o7hN/6ghOwTMIrl 9tpZGN84jDPIHzzfcwNydiV7AedCE//aP5Cq2aUrK5B01JWeGJx13dIxtksfxrNs mzs/1ox4XuZ1hEEqKiQYyz5mSFbXeP+tbsLIuq58ClcWl2hLQgn9swPkHJmG3Uhr +onxrw/xSYnkh1nNf5d1+KNiMEU0VRwSE05DRSmXk+ANZUSNZmd+pqA/GVJzmGPH aL4+zYQ1fYyZa9TH5ZCc47j0D+nc10rVGuAI2QamE0OpBXLHg4/mfLOyexVs1LGv 4JBfA08i7frz2FAFBFeEAP3YV/VCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=VlXftPUYGBBgZd0OzABUrbVjQ7FkG 3+QPPQs35E0aJE=; b=DiswSuixkHGMnMHTj6zj1DgW8gtnMU5mQJCJNxd3l05mu LaNGeD3gFkg9CEGyJ29fA5K09//fTZAAVp2ZyzSxl8DNaGVQ7kKGpJ/eef8bHUWh 4jAVVCbAuyEpuRnIvfls1E+HAV3+fYMxcqYsJEaE/vzafZBtR7w8rCBex0ZpyPnU BZ/BbU8Js6RfTdEKJ3tTNPk5zh+foOq6+fQ71unJkF0JBRGybxRuT/td95AGX4OI RNg0qcT4Yo8ANB5OAf73aeNIcMlgiBfRGwX6hlX/LkUXO3ZXfLH3Cko6tf1x/foM Gn1QBa7NxsapVZUuNIDe3hmUAb9F/W05SC/5YCsRQ== X-ME-Sender: Received: from localhost.localdomain (unknown [115.150.27.206]) by mail.messagingengine.com (Postfix) with ESMTPA id 128B57E1A2; Wed, 24 Jan 2018 10:35:51 -0500 (EST) From: Yuanhan Liu To: Ferruh Yigit Cc: dpdk stable Date: Wed, 24 Jan 2018 23:31:09 +0800 Message-Id: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'kni: fix build with kernel 4.15' has been queued to LTS release 17.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2018 15:35:54 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/26/18. So please shout if anyone has objections. Thanks. --yliu --- >>From c4b60502e7135b683f48de568698281b42dd83f6 Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Tue, 28 Nov 2017 23:45:53 +0000 Subject: [PATCH] kni: fix build with kernel 4.15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit d291fb3a8d162161897636387910637bbe9cbf17 ] build error: .../dpdk/build/build/lib/librte_eal/linuxapp/kni/igb_main.c:2809:2: error: implicit declaration of function ‘setup_timer’; did you mean ‘sk_stop_timer’? [-Werror=implicit-function-declaration] setup_timer(&adapter->watchdog_timer, &igb_watchdog, ^~~~~~~~~~~ sk_stop_timer cc1: all warnings being treated as errors error observed whed CONFIG_RTE_KNI_KMOD_ETHTOOL config option enabled. Because Linux removed setup_timer macros for kernel version >= 4.15 Linux: 513ae785c63c ("timer: Remove setup_*timer() interface") Replaced setup_timer with timer_setup for new kernel versions. Signed-off-by: Ferruh Yigit --- lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 41 ++++++++++++++++++++++ lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 4 +++ 2 files changed, 45 insertions(+) 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 99338c5..e0f427a 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -137,11 +137,20 @@ static void igb_clean_all_tx_rings(struct igb_adapter *); static void igb_clean_all_rx_rings(struct igb_adapter *); static void igb_clean_tx_ring(struct igb_ring *); static void igb_set_rx_mode(struct net_device *); +#ifdef HAVE_TIMER_SETUP +static void igb_update_phy_info(struct timer_list *); +static void igb_watchdog(struct timer_list *); +#else static void igb_update_phy_info(unsigned long); static void igb_watchdog(unsigned long); +#endif static void igb_watchdog_task(struct work_struct *); static void igb_dma_err_task(struct work_struct *); +#ifdef HAVE_TIMER_SETUP +static void igb_dma_err_timer(struct timer_list *); +#else static void igb_dma_err_timer(unsigned long data); +#endif static netdev_tx_t igb_xmit_frame(struct sk_buff *skb, struct net_device *); static struct net_device_stats *igb_get_stats(struct net_device *); static int igb_change_mtu(struct net_device *, int); @@ -2806,6 +2815,12 @@ static int __devinit igb_probe(struct pci_dev *pdev, /* Check if Media Autosense is enabled */ if (hw->mac.type == e1000_82580) igb_init_mas(adapter); +#ifdef HAVE_TIMER_SETUP + timer_setup(&adapter->watchdog_timer, &igb_watchdog, 0); + if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA) + timer_setup(&adapter->dma_err_timer, &igb_dma_err_timer, 0); + timer_setup(&adapter->phy_info_timer, &igb_update_phy_info, 0); +#else setup_timer(&adapter->watchdog_timer, &igb_watchdog, (unsigned long) adapter); if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA) @@ -2813,6 +2828,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, (unsigned long) adapter); setup_timer(&adapter->phy_info_timer, &igb_update_phy_info, (unsigned long) adapter); +#endif INIT_WORK(&adapter->reset_task, igb_reset_task); INIT_WORK(&adapter->watchdog_task, igb_watchdog_task); @@ -4543,9 +4559,15 @@ static void igb_spoof_check(struct igb_adapter *adapter) /* Need to wait a few seconds after link up to get diagnostic information from * the phy */ +#ifdef HAVE_TIMER_SETUP +static void igb_update_phy_info(struct timer_list *t) +{ + struct igb_adapter *adapter = from_timer(adapter, t, phy_info_timer); +#else static void igb_update_phy_info(unsigned long data) { struct igb_adapter *adapter = (struct igb_adapter *) data; +#endif e1000_get_phy_info(&adapter->hw); } @@ -4594,9 +4616,15 @@ bool igb_has_link(struct igb_adapter *adapter) * igb_watchdog - Timer Call-back * @data: pointer to adapter cast into an unsigned long **/ +#ifdef HAVE_TIMER_SETUP +static void igb_watchdog(struct timer_list *t) +{ + struct igb_adapter *adapter = from_timer(adapter, t, watchdog_timer); +#else static void igb_watchdog(unsigned long data) { struct igb_adapter *adapter = (struct igb_adapter *)data; +#endif /* Do the rest outside of interrupt context */ schedule_work(&adapter->watchdog_task); } @@ -4854,9 +4882,15 @@ dma_timer_reset: * igb_dma_err_timer - Timer Call-back * @data: pointer to adapter cast into an unsigned long **/ +#ifdef HAVE_TIMER_SETUP +static void igb_dma_err_timer(struct timer_list *t) +{ + struct igb_adapter *adapter = from_timer(adapter, t, dma_err_timer); +#else static void igb_dma_err_timer(unsigned long data) { struct igb_adapter *adapter = (struct igb_adapter *)data; +#endif /* Do the rest outside of interrupt context */ schedule_work(&adapter->dma_err_task); } @@ -10051,6 +10085,12 @@ int igb_kni_probe(struct pci_dev *pdev, igb_init_mas(adapter); #ifdef NO_KNI +#ifdef HAVE_TIMER_SETUP + timer_setup(&adapter->watchdog_timer, &igb_watchdog, 0); + if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA) + timer_setup(&adapter->dma_err_timer, &igb_dma_err_timer, 0); + timer_setup(&adapter->phy_info_timer, &igb_update_phy_info, 0); +#else setup_timer(&adapter->watchdog_timer, &igb_watchdog, (unsigned long) adapter); if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA) @@ -10058,6 +10098,7 @@ int igb_kni_probe(struct pci_dev *pdev, (unsigned long) adapter); setup_timer(&adapter->phy_info_timer, &igb_update_phy_info, (unsigned long) adapter); +#endif INIT_WORK(&adapter->reset_task, igb_reset_task); INIT_WORK(&adapter->watchdog_task, igb_watchdog_task); diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h index e38a756..443a3f2 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h @@ -3941,4 +3941,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) #define HAVE_PCI_ENABLE_MSIX #endif +#if defined(timer_setup) && defined(from_timer) +#define HAVE_TIMER_SETUP +#endif + #endif /* _KCOMPAT_H_ */ -- 2.7.4