vfio: fix FreeBSD build
[dpdk.git] / lib / librte_eal / linuxapp / kni / kni_misc.c
index 818f7ce..def4f1e 100644 (file)
@@ -1,25 +1,6 @@
-/*-
- * GPL LICENSE SUMMARY
- *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of version 2 of the GNU General Public License as
- *   published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful, but
- *   WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *   General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *   The full GNU General Public License is included in this distribution
- *   in the file called LICENSE.GPL.
- *
- *   Contact Information:
- *   Intel Corporation
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright(c) 2010-2014 Intel Corporation.
  */
 
 #include <linux/version.h>
@@ -197,7 +178,7 @@ kni_dev_remove(struct kni_dev *dev)
        if (!dev)
                return -ENODEV;
 
-#ifdef CONFIG_RTE_KNI_KMOD_ETHTOOL
+#ifdef RTE_KNI_KMOD_ETHTOOL
        if (dev->pci_dev) {
                if (pci_match_id(ixgbe_pci_tbl, dev->pci_dev))
                        ixgbe_kni_remove(dev->pci_dev);
@@ -319,6 +300,11 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num,
        struct rte_kni_device_info dev_info;
        struct net_device *net_dev = NULL;
        struct kni_dev *kni, *dev, *n;
+#ifdef RTE_KNI_KMOD_ETHTOOL
+       struct pci_dev *found_pci = NULL;
+       struct net_device *lad_dev = NULL;
+       struct pci_dev *pci = NULL;
+#endif
 
        pr_info("Creating kni...\n");
        /* Check the buffer size, to avoid warning */
@@ -408,12 +394,7 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num,
                                        dev_info.function,
                                        dev_info.vendor_id,
                                        dev_info.device_id);
-
-#ifdef CONFIG_RTE_KNI_KMOD_ETHTOOL
-       struct pci_dev *found_pci = NULL;
-       struct net_device *lad_dev = NULL;
-       struct pci_dev *pci = NULL;
-
+#ifdef RTE_KNI_KMOD_ETHTOOL
        pci = pci_get_device(dev_info.vendor_id, dev_info.device_id, NULL);
 
        /* Support Ethtool */