From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by dpdk.org (Postfix) with ESMTP id AAEEA1F3 for ; Thu, 22 Aug 2013 03:54:41 +0200 (CEST) Received: by mail-pd0-f174.google.com with SMTP id y13so1215654pdi.19 for ; Wed, 21 Aug 2013 18:55:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=0DA0aA4tcPmg1bmBTN/fkkV6Vs0GcqDg2ZHXOrB5hfw=; b=RbHjVSqiIeK0OwabyEMkP70cj+v4Vi1iQDtcCY/ekLYWB8C4znSo05gv4kPLaYpv65 WOLSkdXBnVDUwjL7dvvYoczFDhx3q89WGpJnAd5d4hXUjGqEO/JJcnHxXkaTiWIQbPPu CBaZU59+ideShxi+HgtvAwFAjrm2VAlB/8nI9AD2MsuxPskKdCbLrZXf2uEPIXhoom+G 4oJ56EUw+njiN1wFV9hy6Tc98poyYly0nH3N+sERY3pc5GRemilChcaHfNn+1Gq22ahp ScrVIhaXi+kMwjErHJLvaalWcnfVB01RYOP9g4jl0IT1f1PLvzikaK/n9tlHSNeiUZwV GVuA== X-Gm-Message-State: ALoCoQnoCZJ4Kwh8eP9k/ryVhTYCdRUHctAMjPsWZWlzQ3yZhMjjLgr47zXF6ltErg2+SeSxRyc9 X-Received: by 10.68.125.226 with SMTP id mt2mr2687136pbb.115.1377136510563; Wed, 21 Aug 2013 18:55:10 -0700 (PDT) Received: from nehalam.linuxnetplumber.net (static-50-53-69-237.bvtn.or.frontiernet.net. [50.53.69.237]) by mx.google.com with ESMTPSA id dg3sm11337550pbc.24.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 21 Aug 2013 18:55:10 -0700 (PDT) Date: Wed, 21 Aug 2013 18:55:07 -0700 From: Stephen Hemminger To: Patrick Mahan Message-ID: <20130821185507.5d6a8539@nehalam.linuxnetplumber.net> In-Reply-To: <521565B1.9020506@mahan.org> References: <521565B1.9020506@mahan.org> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; 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] Access to the PCI config space 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: Thu, 22 Aug 2013 01:54:42 -0000 On Wed, 21 Aug 2013 18:13:21 -0700 Patrick Mahan wrote: > Has anyone contemplated providing access to the PCI config space > (pci_read_config_[byte|word|dword]) for DPDK? It seems simple to > perform, some preliminary testing by me seems to indicate opening > the /sys/bus/pci/devices//config file, seeking > to the correct offset and reading off the value. > > It seems to be correctly returning expected values and sysfs-pci.txt > seems to indicate that this is RW so you can set values as well. > It would seem a natural to make the PCI support code in DPDK more > fully capable of porting PCI drivers. > > I realize that somethings should be avoid (ie. causing interrupts), > but I know that my device needs to modify bits in both the DEVCTL > field of the PCI config and a BAR0 register to ensure they have > the same value. > > Thoughts? > > Thanks, > > Patrick I played with that and it worked, but proved be unnecessary for the hardware we support. If your device needs it, then sure it makes sense to be supported genericly.