path: root/kernel
AgeCommit message (Collapse)Author
2018-10-11igb_uio: fix refcount if open returns errorStephen Hemminger
This fixes the problem of reference count leak if igbuio_pci_enable_interrupts fails. Also, replace mutex and integer with a kernel atomic counter. This is standard pattern for kernel devices. Fixes: 19685d5aa79c ("igb_uio: allow multi-process access") Cc: Signed-off-by: Stephen Hemminger <> Acked-by: Ferruh Yigit <>
2018-10-02kni: return failure for all ioctlsDan Gora
Modify kni_net_ioctl() to return -EOPNOTSUPP for all ioctls instead of 0. This is necessary because the Wicked (and possibly other) network interface managers will perform the SIOCGIWNAME ioctl to check if the interface is a wireless interface. If the KNI module returns success, Wicked will incorrectly interpret the interface as a wireless interface. Signed-off-by: Dan Gora <> Acked-by: Ferruh Yigit <>
2018-09-17igb_uio: install module when building with mesonLuca Boccassi
Install in $kerneldir/../extra/dpdk. Usually $kerneldir should something like: /lib/modules/$kver/build, so this directory will match the default one used by legacy makefiles. Fixes: a52f4574f798 ("igb_uio: build with meson") Cc: Signed-off-by: Luca Boccassi <> Acked-by: Bruce Richardson <>
2018-08-09kni: fix build on RHEL 7.5Drocula Lambda
This patch fixes compilation errors on Centos 7.5 when CONFIG_RTE_KNI_KMOD_ETHTOOL is set to 'y'. On RHEL75 ndo_change_mtu has changed to ndo_change_mtu_rh74. See commit 37d477b6863e5c06 ("kni: fix build on RHEL 7.5") Signed-off-by: Drocula Lambda <> Acked-by: Ferruh Yigit <>
2018-07-11igb_uio: fix build with lock down checksDavid Marchand
Caught on ubuntu-16.04 with hwe kernel for aarch64: $ uname -a Linux ubuntu1604arm64es 4.13.0-43-generic #48~16.04.1-Ubuntu SMP Thu May 17 13:08:01 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux == Build kernel/linux/igb_uio CC [M] .../kernel/linux/igb_uio/igb_uio.o In file included from .../kernel/linux/igb_uio/igb_uio.c:20:0: .../igb_uio/compat.h: In function ‘igbuio_kernel_is_locked_down’: .../igb_uio/compat.h:146:7: error: "CONFIG_EFI_SECURE_BOOT_LOCK_DOWN" is not defined [-Werror=undef] #elif CONFIG_EFI_SECURE_BOOT_LOCK_DOWN ^ cc1: all warnings being treated as errors Fixes: d67014c3d38b ("igb_uio: fail and log if kernel lock down is enabled") Signed-off-by: David Marchand <> Acked-by: Ferruh Yigit <>
2018-06-30igb_uio: add write combining optionRafal Kozik
Write combining (WC) increases NIC performance by making better utilization of PCI bus, but cannot be use by all PMD. To get internal_addr memory need to be mapped. But as memory could not be mapped twice: with and without WC it should be skipped for WC. [1] To do not spoil other drivers that potentially could use internal_addr, parameter wc_activate adds possibility to skip it for those PMDs, that do not use it. [1] section 5.3 and 5.4 Signed-off-by: Rafal Kozik <> Acked-by: Bruce Richardson <> Acked-by: Ferruh Yigit <>
2018-06-27igb_uio: fail and log if kernel lock down is enabledFerruh Yigit
When EFI secure boot is enabled, it is possible to lock down kernel and prevent accessing device BARs and this makes igb_uio unusable. Lock down patches are not part of the vanilla kernel but they are applied and used by some distros already [1]. It is not possible to fix this issue, but intention of this patch is to detect and log if kernel lock down enabled and don't insert the module for that case. The challenge is since this feature enabled by distros, they have different config options and APIs for it. This patch is done based on Fedora and Ubuntu kernel source, may needs to add more distro specific support. [1] And a few more patches too. Signed-off-by: Ferruh Yigit <> Acked-by: Luca Boccassi <>
2018-06-27kni: fix build with gcc 8.1Ferruh Yigit
Error observed when CONFIG_RTE_KNI_KMOD_ETHTOOL config option is enabled. build error: In function ‘strncpy’, inlined from ‘igb_get_drvinfo’ at kernel/linux/kni/igb_ethtool.c:814:2: include/linux/string.h:246:9: error: ‘__builtin_strncpy’ output may be truncated copying 31 bytes from a string of length 42 [-Werror=stringop-truncation] return __builtin_strncpy(p, q, size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixed by using strlcpy instead of strncpy. adapter->fw_version size kept same because of c3698192940c ("kni: fix build with gcc 7.1") Also next line strncpy usage replaced with strlcpy while arround. Fixes: c3698192940c ("kni: fix build with gcc 7.1") Cc: Signed-off-by: Ferruh Yigit <> Acked-by: Pablo de Lara <>
2018-05-25kernel: add missing SPDX license identifiersHemant Agrawal
Signed-off-by: Hemant Agrawal <>
2018-05-22kni: fix build on CentOS 7.4Dan Gora
Fix compilation errors on Centos 7.4 when CONFIG_RTE_KNI_KMOD_ETHTOOL is set to 'y'. Centos 7.4 needs HAVE_NDO_BRIDGE_GETLINK_FILTER_MASK_VLAN_FILL: igb_main.c: In function ‘igb_ndo_bridge_getlink’: igb_main.c:2289:2: error: too few arguments to function ‘ndo_dflt_bridge_getlink’ return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode, 0, 0, nlflags); ^ Centos 7.4 needs HAVE_VF_VLAN_PROTO and needs to redefine ndo_set_vf_vlan to .extended.ndo_set_vf_vlan: igb_main.c:2318:2: error: unknown field ‘ndo_set_vf_vlan’ specified in initializer .ndo_set_vf_vlan = igb_ndo_set_vf_vlan, ^ Signed-off-by: Dan Gora <> Acked-by: Ferruh Yigit <>
2018-05-13kni: fix possible mbuf leaks and speed up port releaseYangchao Zhou
rx_q fifo can only be released by kernel thread. There may be mbuf leaks in rx_q because kernel threads are randomly stopped. When the kni is released and netdev is unregisterd, convert the physical address mbufs in rx_q to the virtual address in free_q. By the way, alloc_q can be processed together to speed up the release rate in userspace. In my test, it is improved from 300-500ms with a mempool that has 131072 mbufs to 10ms(regardless of the specifications). Suggested-by: Ferruh Yigit <> Signed-off-by: Yangchao Zhou <> Acked-by: Ferruh Yigit <>
2018-05-08kernel: fix cross-build of Linux modules with mesonBruce Richardson
When cross-compiling, if no kernel_dir was specified, then the kernel modules were still being compiled for the build machine. Fix this by only building modules on cross-compile when we have a kernel_dir value set. Print out a message indicating why we are skipping kernel compilation, and in case that the headers for kernel compile are not found, print a warning instead of erroring out. Fixes: a52f4574f798 ("igb_uio: build with meson") Signed-off-by: Bruce Richardson <> Acked-by: Luca Boccassi <>
2018-05-01igb_uio: pass MODULE_CFLAGS in KbuildLuca Boccassi
With the legacy build system MODULE_CFLAGS can be set to pass compiler flags specific for the kernel modules builds. This is used currently by Ubuntu and Debian. Set ccflags-y in the Kbuild to achieve the same result with Meson, and to keep backward compatbility with older scripts. Fixes regression in Ubuntu/Debian when the Kbuild is included in the DKMS source package, as DKMS will pick it up silently by default if present, causing the MODULE_CFLAGS to be ignored. Fixes: a52f4574f798 ("igb_uio: build with meson") Cc: Signed-off-by: Luca Boccassi <> Acked-by: Bruce Richardson <>
2018-04-17build: clean up building kernel modules using mesonBruce Richardson
The files for building the kernel modules directory could be improved now that it is extracted from the EAL. For example, no global processing is necessary inside the kernel folder, just need to subdir to the appropriate bsd or linux folder to do the actual work. To avoid potential race conditions with the BSD module builds when the kernel build system is creating the dev_if.h and other files, we serialize the kernel module builds (all 2 of them!) by setting up each module to depend on all the previous. Signed-off-by: Bruce Richardson <> Tested-by: Hemant Agrawal <>
2018-04-20igb_uio: fix build on Linux < 3.16Scott Branden
Starting from Linux v3.16 pci_is_bridge() is in linux/pci.h, in previous versions it is in drivers/pci/pci.h which is private header. Fix build error when calling pci_is_bridge by not calling/supporting pci_is_bridge with kernel versions before 3.16. Fixes: 6f0841b7701b ("igb_uio: bind error if PCIe bridge") Reported-by: Ferruh Yigit <> Signed-off-by: Scott Branden <> Signed-off-by: Ajit Khaparde <> Acked-by: Bernard Iremonger <> Acked-by: Ferruh Yigit <>
2018-04-11igb_uio: bind error if PCIe bridgeDarren Edamura
Probe function should exit immediately if pcie bridge detected Signed-off-by: Darren Edamura <> Signed-off-by: Rahul Gupta <> Signed-off-by: Scott Branden <> Signed-off-by: Ajit Khaparde <> Acked-by: Ferruh Yigit <>
2018-03-28kni: fix build on RHEL 7.5Lee Roberts
Signed-off-by: Lee Roberts <> Acked-by: Ferruh Yigit <>
2018-03-21move kernel modules directoriesHemant Agrawal
This patch moves the kernel modules code from EAL to a common place. - Separate the kernel module code from user space code. Signed-off-by: Hemant Agrawal <> Tested-by: Bruce Richardson <>