From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <fyigit@ecsmtp.ir.intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 83AFDCB66
 for <dev@dpdk.org>; Wed, 15 Jun 2016 17:57:47 +0200 (CEST)
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by fmsmga102.fm.intel.com with ESMTP; 15 Jun 2016 08:57:46 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.26,476,1459839600"; d="scan'208";a="998252005"
Received: from irvmail001.ir.intel.com ([163.33.26.43])
 by orsmga002.jf.intel.com with ESMTP; 15 Jun 2016 08:57:45 -0700
Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com
 [10.237.217.46])
 by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id
 u5FFvi7K017473; Wed, 15 Jun 2016 16:57:44 +0100
Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1])
 by sivswdev02.ir.intel.com with ESMTP id u5FFvi71030262;
 Wed, 15 Jun 2016 16:57:44 +0100
Received: (from fyigit@localhost)
 by sivswdev02.ir.intel.com with  id u5FFviVK030258;
 Wed, 15 Jun 2016 16:57:44 +0100
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org
Cc: Rami Rosen <rami.rosen@intel.com>, thiagocmartinsc@gmail.com,
 Ferruh Yigit <ferruh.yigit@intel.com>
Date: Wed, 15 Jun 2016 16:57:42 +0100
Message-Id: <1466006262-30228-1-git-send-email-ferruh.yigit@intel.com>
X-Mailer: git-send-email 1.7.4.1
In-Reply-To: <9B0331B6EBBD0E4684FBFAEDA55776F92CD5CBC7@HASMSX110.ger.corp.intel.com>
References: <9B0331B6EBBD0E4684FBFAEDA55776F92CD5CBC7@HASMSX110.ger.corp.intel.com>
Subject: [dpdk-dev] [PATCH] igb_uio: fix build with backported kernel
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 15 Jun 2016 15:57:47 -0000

Following compile error observed with CentOS 6.8, which uses kernel
kernel-devel-2.6.32-642.el6.x86_64:

CC eal_thread.o
.../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.c:
In function 'igbuio_msix_mask_irq':
.../build/lib/librte_eal/linuxapp/igb_uio/igb_uio.c:157:
error: 'PCI_MSIX_ENTRY_CTRL_MASKBIT' undeclared (first use in this
function)

Reported-by: Thiago <thiagocmartinsc@gmail.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_eal/linuxapp/igb_uio/compat.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/librte_eal/linuxapp/igb_uio/compat.h b/lib/librte_eal/linuxapp/igb_uio/compat.h
index c1d45a6..0d781e4 100644
--- a/lib/librte_eal/linuxapp/igb_uio/compat.h
+++ b/lib/librte_eal/linuxapp/igb_uio/compat.h
@@ -24,6 +24,15 @@
 #define   PCI_MSIX_ENTRY_CTRL_MASKBIT   1
 #endif
 
+/*
+ * for kernels < 2.6.38 and backported patch that moves MSI-X entry definition
+ * to pci_regs.h Those kernels has PCI_MSIX_ENTRY_SIZE defined but not
+ * PCI_MSIX_ENTRY_CTRL_MASKBIT
+ */
+#ifndef PCI_MSIX_ENTRY_CTRL_MASKBIT
+#define PCI_MSIX_ENTRY_CTRL_MASKBIT    1
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) && \
 	(!(defined(RHEL_RELEASE_CODE) && \
 	 RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(5, 9)))
-- 
2.5.5