From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [igb_uio PATCH 2/3] igb_uio: pci_config_lock/pci_config_unlock wrappers Date: Tue, 22 Jul 2014 14:57:21 +0200 Message-ID: <9697334.UVtye4KLXx@xps13> References: <2795655.Wj4j2zIbVg@xps13> <1405944234-50272-3-git-send-email-e_zhumabekov@sts.kz> <20140721134200.51fdbcd3@haswell> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Stephen Hemminger , Yerden Zhumabekov Return-path: In-Reply-To: <20140721134200.51fdbcd3@haswell> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2014-07-21 13:42, Stephen Hemminger: > On Mon, 21 Jul 2014 18:03:53 +0600 > Yerden Zhumabekov wrote: > > > Since PCI config lock/unlock functions were renamed in linux kernel, > > these wrappers are introduced to reflect this change. > > > > Signed-off-by: Yerden Zhumabekov > > --- > > lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > > > > diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c > > index 02545d9..605410e 100644 > > --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c > > +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c > > @@ -223,6 +223,26 @@ static const struct attribute_group dev_attr_grp = { > > .attrs = dev_attrs, > > }; > > > > +static inline void > > +pci_config_lock(struct pci_dev *pdev) > > +{ > > +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) > > + pci_block_user_cfg_access(pdev); > > +#else > > + pci_cfg_access_lock(pdev); > > +#endif > > +} > > + > > +static inline void > > +pci_config_unlock(struct pci_dev *pdev) > > +{ > > +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) > > + pci_unblock_user_cfg_access(pdev); > > +#else > > + pci_cfg_access_unlock(pdev); > > +#endif > > +} > > + > > #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) > > /* Check if INTX works to control irq's. > > * Set's INTX_DISABLE flag and reads it back > > Rather than have wrapper's which have to live forever. > Please create backward compatability stub's. > > My goal is to be able to unifdef out all the version checks and > submit a version to upstream mainline kernel. I replace this patch by these simple fallbacks: #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 -- Thomas