From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 2AF59B0C8 for ; Wed, 11 Jun 2014 20:27:27 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 11 Jun 2014 11:27:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,459,1400050800"; d="scan'208";a="546413493" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga001.fm.intel.com with ESMTP; 11 Jun 2014 11:27:40 -0700 Received: from irsmsx153.ger.corp.intel.com (163.33.192.75) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 11 Jun 2014 19:27:40 +0100 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.245]) by IRSMSX153.ger.corp.intel.com ([169.254.9.252]) with mapi id 14.03.0123.003; Wed, 11 Jun 2014 19:27:38 +0100 From: "Carew, Alan" To: Neil Horman , Stephen Hemminger Thread-Topic: [dpdk-dev] [PATCH v2 09/10] igbuio: show irq mode in sysfs Thread-Index: AQHPgeJGFEa9FdnAVk6Ym2Jz5TYUVptnSnYAgATrc/A= Date: Wed, 11 Jun 2014 18:27:35 +0000 Message-ID: <0E29434AEE0C3A4180987AB476A6F630593A63AB@IRSMSX101.ger.corp.intel.com> References: <20140606235028.189345212@networkplumber.org> <20140606235115.248804518@networkplumber.org> <20140608153704.GA27652@localhost.localdomain> In-Reply-To: <20140608153704.GA27652@localhost.localdomain> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 09/10] igbuio: show irq mode in sysfs 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: Wed, 11 Jun 2014 18:27:28 -0000 > -----Original Message----- > From: Neil Horman [mailto:nhorman@tuxdriver.com] > Sent: Sunday, June 08, 2014 4:37 PM > To: Stephen Hemminger > Cc: Carew, Alan; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2 09/10] igbuio: show irq mode in sysfs >=20 > On Fri, Jun 06, 2014 at 04:50:37PM -0700, Stephen Hemminger wrote: > > Since irq mode is determined dynamically on a per-device > > basis, and virtio needs to know if using intx or msi-x, > > make it a sysfs attribute. > > > > --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c > > +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c > > @@ -43,6 +43,10 @@ > > IGBUIO_MSIX_INTR_MODE > > }; > > > > +static const char *igbuio_intr_modes[] =3D { > > + "legacy", "msi", "msix" > > +}; > > + > > /** > > * A structure describing the private information for a uio device. > > */ > > @@ -128,8 +132,20 @@ > > } > > > > static DEVICE_ATTR(max_vfs, S_IRUGO | S_IWUSR, show_max_vfs, > store_max_vfs); > > + > > +static ssize_t irq_mode_show(struct device *dev, > > + struct device_attribute *attr, char *buf) > > +{ > > + struct uio_info *info =3D pci_get_drvdata(to_pci_dev(dev)); > > + struct rte_uio_pci_dev *udev =3D igbuio_get_uio_pci_dev(info); > > + > > + return sprintf(buf, "%s\n", igbuio_intr_modes[udev->mode]); > > +} > > +static DEVICE_ATTR(irq_mode, S_IRUGO, irq_mode_show, NULL); > > + > > static struct attribute *dev_attrs[] =3D { > > &dev_attr_max_vfs.attr, > > + &dev_attr_irq_mode.attr, > > NULL, > > }; > > > > > > > Do you really need this attribute? The pci bus sysfs tree already export= s irq > mode information for each device allocated already in > /sys/bus/pci/device/msi_irqs >=20 > Neil Hi Neil, After some digging around, I now realise what you mean, it is a good sugges= tion. /sys/bus/pci/devices//msi_irqs//mode, where "msi_irqs" direct= ory only exists for msi/msix and not for int-x. Also the "mode" file contai= ns string of configured interrupt mode. Thanks, Alan