From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by dpdk.org (Postfix) with ESMTP id 8084DADBE for ; Sat, 7 Jun 2014 01:51:03 +0200 (CEST) Received: by mail-pd0-f181.google.com with SMTP id z10so2997997pdj.40 for ; Fri, 06 Jun 2014 16:51:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:user-agent:date:from:to:cc:subject :references:mime-version:content-type:content-disposition; bh=kXOquV1DmvnB+LEnR7g+2i8fUDL8bIyB1CYqA7YpUX4=; b=dN8fu08vPzbk5Nuo7HpQUxe6ZevYq2wuAQJpXK1uh36tFz1RFmAJbWIHtUk1GL8ANm ceoG6nRc+weLJLCD1MJg3RA5crm6RDGCq1TANrRCBejm98LqyBTzMC6O9g0QQ8Uhd6gb paxFVHhh+T6XPBSG17RLZH6zbqgHViqFFTa0A+dTO0UQdDqH8ycyE4Z/TCTaZeT4j0/k L6+bnDkLL+GMkNsaZEmBlVIs+fxDVJDbZXmoADMiao29n/XBs0Of2GnpJARiDI9kFFwL ESLAt+/SA6h6W/PbcTpv/06mJ8J3Mp0VdVraX1/35de9lZJZfPFAa3MbZq/sHEinE9Cs lDjw== X-Gm-Message-State: ALoCoQnegSMMckGO7vdWTcXn8nQ94+qymIjTv2cBL1eZJmjagIzJ2zJe67lZTFlx5tUNH5PO4McF X-Received: by 10.68.130.38 with SMTP id ob6mr5862831pbb.141.1402098676785; Fri, 06 Jun 2014 16:51:16 -0700 (PDT) Received: from localhost (static-50-53-83-51.bvtn.or.frontiernet.net. [50.53.83.51]) by mx.google.com with ESMTPSA id qv9sm40854276pbc.71.2014.06.06.16.51.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jun 2014 16:51:16 -0700 (PDT) Message-Id: <20140606235115.248804518@networkplumber.org> User-Agent: quilt/0.63-1 Date: Fri, 06 Jun 2014 16:50:37 -0700 From: Stephen Hemminger To: Alan Carew References: <20140606235028.189345212@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=igbuio-irq-mode-sysfs.patch Cc: dev@dpdk.org Subject: [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: Fri, 06 Jun 2014 23:51:04 -0000 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[] = { + "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 = pci_get_drvdata(to_pci_dev(dev)); + struct rte_uio_pci_dev *udev = 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[] = { &dev_attr_max_vfs.attr, + &dev_attr_irq_mode.attr, NULL, };