igb_uio: fix build with kernel older than 3.3
authorThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 22 Jul 2014 12:27:55 +0000 (14:27 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 22 Jul 2014 13:00:00 +0000 (15:00 +0200)
Since Linux commit fb51ccbf217 (PCI: Rework config space blocking services),
the functions pci_(un)block_user_cfg_access are replaced by
pci_cfg_access_(un)lock.

The compatibility with older functions was broken since commit 399a3f0db8b0
(igb_uio: fix IRQ mode handling).

Reported-by: Yerden Zhumabekov <e_zhumabekov@sts.kz>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_eal/linuxapp/igb_uio/igb_uio.c

index 02545d9..f220a12 100644 (file)
 #endif
 #include <rte_pci_dev_features.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
+#define pci_cfg_access_lock   pci_block_user_cfg_access
+#define pci_cfg_access_unlock pci_unblock_user_cfg_access
+#endif
+
 #ifdef RTE_PCI_CONFIG
 #define PCI_SYS_FILE_BUF_SIZE      10
 #define PCI_DEV_CAP_REG            0xA4