From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [igb_uio PATCH 2/3] igb_uio: pci_config_lock/pci_config_unlock wrappers Date: Mon, 21 Jul 2014 13:42:00 -0700 Message-ID: <20140721134200.51fdbcd3@haswell> References: <2795655.Wj4j2zIbVg@xps13> <1405944234-50272-1-git-send-email-e_zhumabekov@sts.kz> <1405944234-50272-3-git-send-email-e_zhumabekov@sts.kz> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Yerden Zhumabekov Return-path: In-Reply-To: <1405944234-50272-3-git-send-email-e_zhumabekov-8EHiFRVJVgQ@public.gmane.org> 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" 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.