mirror of https://github.com/F-Stack/f-stack.git
Merge pull request #138 from shivansh/fix/build_kernel-4.12
DPDK: Fix build with kernel 4.12
This commit is contained in:
commit
73ef8c4ddb
|
@ -380,7 +380,11 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||||
case RTE_INTR_MODE_MSIX:
|
case RTE_INTR_MODE_MSIX:
|
||||||
/* Only 1 msi-x vector needed */
|
/* Only 1 msi-x vector needed */
|
||||||
msix_entry.entry = 0;
|
msix_entry.entry = 0;
|
||||||
|
#ifdef HAVE_PCI_ENABLE_MSIX
|
||||||
if (pci_enable_msix(dev, &msix_entry, 1) == 0) {
|
if (pci_enable_msix(dev, &msix_entry, 1) == 0) {
|
||||||
|
#else
|
||||||
|
if (pci_enable_msix_range(dev, &msix_entry, 1, 1) == 0) {
|
||||||
|
#endif
|
||||||
dev_dbg(&dev->dev, "using MSI-X");
|
dev_dbg(&dev->dev, "using MSI-X");
|
||||||
udev->info.irq = msix_entry.vector;
|
udev->info.irq = msix_entry.vector;
|
||||||
udev->mode = RTE_INTR_MODE_MSIX;
|
udev->mode = RTE_INTR_MODE_MSIX;
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
* Minimal wrappers to allow compiling kni on older kernels.
|
* Minimal wrappers to allow compiling kni on older kernels.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/version.h>
|
||||||
|
|
||||||
#ifndef RHEL_RELEASE_VERSION
|
#ifndef RHEL_RELEASE_VERSION
|
||||||
#define RHEL_RELEASE_VERSION(a, b) (((a) << 8) + (b))
|
#define RHEL_RELEASE_VERSION(a, b) (((a) << 8) + (b))
|
||||||
#endif
|
#endif
|
||||||
|
@ -38,3 +40,7 @@
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
|
||||||
#define HAVE_TRANS_START_HELPER
|
#define HAVE_TRANS_START_HELPER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||||
|
#define HAVE_SIGNAL_FUNCTIONS_OWN_HEADER
|
||||||
|
#endif
|
||||||
|
|
|
@ -1031,8 +1031,15 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter, bool msix)
|
||||||
for (i = 0; i < numvecs; i++)
|
for (i = 0; i < numvecs; i++)
|
||||||
adapter->msix_entries[i].entry = i;
|
adapter->msix_entries[i].entry = i;
|
||||||
|
|
||||||
|
#ifdef HAVE_PCI_ENABLE_MSIX
|
||||||
err = pci_enable_msix(pdev,
|
err = pci_enable_msix(pdev,
|
||||||
adapter->msix_entries, numvecs);
|
adapter->msix_entries, numvecs);
|
||||||
|
#else
|
||||||
|
err = pci_enable_msix_range(pdev,
|
||||||
|
adapter->msix_entries,
|
||||||
|
numvecs,
|
||||||
|
numvecs);
|
||||||
|
#endif
|
||||||
if (err == 0)
|
if (err == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3933,4 +3933,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
|
||||||
#define HAVE_VF_VLAN_PROTO
|
#define HAVE_VF_VLAN_PROTO
|
||||||
#endif /* >= 4.9.0 */
|
#endif /* >= 4.9.0 */
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
||||||
|
#define HAVE_PCI_ENABLE_MSIX
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _KCOMPAT_H_ */
|
#endif /* _KCOMPAT_H_ */
|
||||||
|
|
|
@ -25,9 +25,15 @@
|
||||||
#ifndef _KNI_DEV_H_
|
#ifndef _KNI_DEV_H_
|
||||||
#define _KNI_DEV_H_
|
#define _KNI_DEV_H_
|
||||||
|
|
||||||
|
#include "compat.h"
|
||||||
|
|
||||||
#include <linux/if.h>
|
#include <linux/if.h>
|
||||||
#include <linux/wait.h>
|
#include <linux/wait.h>
|
||||||
|
#ifdef HAVE_SIGNAL_FUNCTIONS_OWN_HEADER
|
||||||
|
#include <linux/sched/signal.h>
|
||||||
|
#else
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
#endif
|
||||||
#include <linux/netdevice.h>
|
#include <linux/netdevice.h>
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
#include <linux/list.h>
|
#include <linux/list.h>
|
||||||
|
|
Loading…
Reference in New Issue