From owner-freebsd-current@freebsd.org Fri Apr 1 11:07:57 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A1FBAEBA5A for ; Fri, 1 Apr 2016 11:07:57 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com [IPv6:2a00:1450:4010:c07::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD3B1176; Fri, 1 Apr 2016 11:07:57 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: by mail-lf0-x22b.google.com with SMTP id k79so79288219lfb.2; Fri, 01 Apr 2016 04:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=0u9/Et1qmWsck7zEP289xAgK3U8DsBhk1HGsMhUk8cA=; b=pHQUWOmZRVXAe1u4Ypro27QTb2Dv28ohdkFW2m6AYsuqf963Qng7iFoSPeiP1G9iMk DdRnSk5NtX2l//X2oRG0QWsRxJNXBA1s772N2vxcFXInU8DEIYoBl4M9LplD1orB3EAY irk8MC2Iy6V7R7hX+j+ESq1pLc+74h8++V2H3HOtozfjIm8bcEBAg81bGJj4yq4l01h+ /VAwGmbVfNj3H2dFii2yU1Bmoa75fHHNAxlST7wDJZMK3+QtbNjXcvtjMc+YKEKA2GfD kTCJOv8gVoCSXXe7RbsHEmRkP4KKgYHiK4gUrxHBmr0wVFV25CXpctoV1Mxv7bSJAcit doPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=0u9/Et1qmWsck7zEP289xAgK3U8DsBhk1HGsMhUk8cA=; b=OyTkcVb79IH9SIqMMN3fRNm+Ee2iXqi3ogZz0Avb/Ar/001EMxE6hKKrBcLTsHL98f sV1SBAtJenKafcLzec0uCsQeCcnDWC9zTe2HXiaQSGQK5g3AbTRQa9VqVI3CC6kjl5fJ xWUpa1uPRWQUrRJGefct2A/1dN15R4ew1L0b9Ftzq/NutUharqFF4cS3wQqElsTCOAQW XypIzzH1fO8UQRJg1PbYFcLRR7lGSV6p2AOlVfkZZ3yAnmTc1yiOfhgSD31iEAx/vsCl 2WynBn8RCn4Cw02Fj5l00tGvUi7Vw6ks9l/v0n/5zOWBapy7n6vLtZ5ylYjUtjdQx0GR Zl8w== X-Gm-Message-State: AD7BkJLqx/LBi3MGRkUi1tOMijTWKBSyAVKtoEhJeuHsAUHeudzeTOzb/AJ9MfK1AruqYLTnEJ03UVaTu+b7PA== MIME-Version: 1.0 X-Received: by 10.25.145.149 with SMTP id t143mr1628766lfd.37.1459508875176; Fri, 01 Apr 2016 04:07:55 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.114.199.19 with HTTP; Fri, 1 Apr 2016 04:07:55 -0700 (PDT) In-Reply-To: References: <2550091.UENsv0ilXD@ralph.baldwin.cx> Date: Fri, 1 Apr 2016 13:07:55 +0200 X-Google-Sender-Auth: 2MjIH989_JKTZkmjhHYGCiTmq7E Message-ID: Subject: Re: accessing a PCIe register from userspace through kmem or other ways ? From: Luigi Rizzo To: Ryan Stone , Jim Harris Cc: John Baldwin , FreeBSD Current , Giuseppe Lettieri , Vincenzo Maffione Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 11:07:57 -0000 On Thu, Mar 31, 2016 at 11:55 PM, Ryan Stone wrote: > On Thu, Mar 31, 2016 at 4:39 PM, John Baldwin wrote: > >> On Wednesday, March 30, 2016 11:20:51 AM Jim Harris wrote: >> > On Wed, Mar 30, 2016 at 10:47 AM, Luigi Rizzo >> wrote: >> > >> > > Hi, >> > > I'd like to test the rate at which I can access device registers >> > > on a PCIe card, and was wondering whether I need to patch a device >> > > driver, or perhaps I can use /dev/kmem once I figure out where >> > > the registers are mapped ? >> > > >> > >> > You do not need to patch a device driver. Have you looked at >> > libpciaccess? This should give you everything you need. >> >> You can also look at what pciconf uses. (It has a read_config() method >> that uses an ioctl on an fd of /dev/pci). >> > > pciconf can only access the configuration space, right? I believe that > Luigi is more interested in measuring the latency to a register mapped fr= om > a BAR. > =E2=80=8BThank you all for you answers, I will look at libpciaccess. Yes my goal is to look at the rate and latency for accessing BAR-mapped registers cheers luigi=E2=80=8B --=20 -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2217533 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------