From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by dpdk.org (Postfix) with ESMTP id 3CDE2B34D for ; Mon, 21 Jul 2014 22:40:44 +0200 (CEST) Received: by mail-pa0-f52.google.com with SMTP id bj1so10522412pad.11 for ; Mon, 21 Jul 2014 13:41:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=tye2D0qgvGjymuHlCFncAKCM/sAy5r9DtkXCGrMYvZo=; b=lvnOPa0pLrZMRuejaq83rib+LlISLPgS3ddLkoM+2clisajokD5Yuq1U4H1eR0Atjy AeNsZtt6gIk6Vnp4q7uV5ENzpqwP3MHCLOT1Kl5g7iCwzwIjghhTA+nTOqcs2/UW5OU8 QKxxKMjjwohVD6oOVEeD1QTkH/fhQZLQT2nCOlIHcaVcbXH9GNQotgj9SBp3KqgSLa0K ky/u0T5tjVqfMjqUf7/2E5p0VUDcLXB9nUi5gJjuo63YLnpQq3O2Op8wo3gsALDKJqAi njKUlL03tTWtDUhJ4hlBaznPDgNqywnoFVmx+qG6NV/WfXLzOKlaHeV2SX+h6znwbO2+ 4usw== X-Gm-Message-State: ALoCoQmz3d82DIG27+CY7n0MVtEI43CwHoPsrAaUUZ/upobvv2fcXsGlmlm500c5KR+7StEJmeXa X-Received: by 10.67.30.130 with SMTP id ke2mr27997975pad.44.1405975318672; Mon, 21 Jul 2014 13:41:58 -0700 (PDT) Received: from haswell (static-50-53-66-61.bvtn.or.frontiernet.net. [50.53.66.61]) by mx.google.com with ESMTPSA id zc10sm61276326pac.46.2014.07.21.13.41.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Jul 2014 13:41:58 -0700 (PDT) Date: Mon, 21 Jul 2014 13:42:00 -0700 From: Stephen Hemminger To: Yerden Zhumabekov Message-ID: <20140721134200.51fdbcd3@haswell> In-Reply-To: <1405944234-50272-3-git-send-email-e_zhumabekov@sts.kz> References: <2795655.Wj4j2zIbVg@xps13> <1405944234-50272-1-git-send-email-e_zhumabekov@sts.kz> <1405944234-50272-3-git-send-email-e_zhumabekov@sts.kz> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.24; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [igb_uio PATCH 2/3] igb_uio: pci_config_lock/pci_config_unlock wrappers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 20:40:44 -0000 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.