From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by dpdk.org (Postfix) with ESMTP id 21EB15584 for ; Mon, 27 Jun 2016 18:23:20 +0200 (CEST) Received: by mail-pf0-f181.google.com with SMTP id t190so63353694pfb.3 for ; Mon, 27 Jun 2016 09:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K/AFATx1TmcsToHYeKJ0rdLqJ/IVk8Nti2YTIa4m89A=; b=qFHh6h1tzfp+bWidvHsdcXeAa5uQc4qQsJwiQc74F25hzaXtQis+f5BpCGucu4c7Gz 1nps+WMtfaq4w1WJPGe1zMB0liHEBTdE2XzOCwu1JRRySSDrVKyTmZlX55+qZpRdxCC8 l6NZ0cCZ1e2zy+cTNAepTqWMfCVnZ9Fc5nH/HXyWRhbrQDDe+7gXRySGwKZ2B0F+mXfX HSH0dg3fWyqG3r6pXoOy8Uj32UszWWj+BQ+lyvFDefyYjkmQy0L7nxf1eYvuPOgVf1se EXQabL8GRXNXa+6XTTh3ZjA/rSTnQ4vt8rv6XvqvnMxSj8fWT0LMrvZgk7+/yCB1Bmw/ XDrA== 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-transfer-encoding; bh=K/AFATx1TmcsToHYeKJ0rdLqJ/IVk8Nti2YTIa4m89A=; b=em4jDSKU+xJua27e7G55Ni1ZUkUVkcI4uTtgkhzWPiYwhRrFakiW1BS46LH2CFgeof ub+mXyMcS7dFYLnap0sQ8iqc9CXSTmFiY4SZNaKGkT1YEgxgcI8qcwTLbUYkI0q2HlUh wTV1eZfhKI5OGhlogz7tedC4Ixa49JdAqTYXNvDxMLW4EJYIEIlr0auyDhqP6LHiZnFS HQJ7nYyC2ba1F4DsDOxRbS69D1cnx6Zco/mZ1klXiLsWVFBDwpe1udc3YCrpWrXCM3r9 16GrEWaBjM0ueVFnLMPzASmSd45PcJFDIrjMc1uv9vwl2SgcJd2RxPAzqWQ4DZd+qB/c UEAQ== X-Gm-Message-State: ALyK8tLdzwXlNKTSTDn+hmHb+9okGyQxiYg8N5kW3WXJha08OHyZgUJgoQwL98cT+ql5Lw== X-Received: by 10.98.55.1 with SMTP id e1mr34137905pfa.107.1467044599348; Mon, 27 Jun 2016 09:23:19 -0700 (PDT) Received: from xeon-e3 (static-50-53-69-251.bvtn.or.frontiernet.net. [50.53.69.251]) by smtp.gmail.com with ESMTPSA id y63sm7306812pfb.13.2016.06.27.09.23.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jun 2016 09:23:19 -0700 (PDT) Date: Mon, 27 Jun 2016 09:23:34 -0700 From: Stephen Hemminger To: John Sucaet Cc: Message-ID: <20160627092334.6131ac4d@xeon-e3> In-Reply-To: <5770F822.7070303@oneaccess-net.com> References: <5770F822.7070303@oneaccess-net.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-users] Detect LSC capability of dpdk ports X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2016 16:23:20 -0000 On Mon, 27 Jun 2016 11:55:46 +0200 John Sucaet wrote: > Hi, >=20 > How can a dpdk application determine if a port has support for lsc,=20 > before trying to configure it? >=20 > Thanks >=20 > John We ended up adding this patch, which never seemed to be accepted upstream. =46rom 79060ea428f070f309f577006af43eb4ab74586d Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 3 Feb 2015 17:14:32 -0800 Subject: [PATCH 1/7] ether: add function to query for link state interrupt Allow application to query whether link state will work. This is also part of abstracting dependency on PCI. Signed-off-by: Stephen Hemminger --- lib/librte_ether/rte_ethdev.c | 14 ++++++++++++++ lib/librte_ether/rte_ethdev.h | 12 ++++++++++++ lib/librte_ether/rte_ether_version.map | 1 + 3 files changed, 27 insertions(+) --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1091,6 +1091,23 @@ rte_eth_dev_start(uint8_t port_id) return 0; } =20 +int +rte_eth_has_link_state(uint8_t port_id) +{ + struct rte_eth_dev *dev; + + if (!rte_eth_dev_is_valid_port(port_id)) { + RTE_PMD_DEBUG_TRACE("Invalid port_id=3D%d\n", port_id); + return 0; + } + dev =3D &rte_eth_devices[port_id]; + + if (!dev->driver || !dev->pci_dev) + return 0; + + return (dev->pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) !=3D 0; +} + void rte_eth_dev_stop(uint8_t port_id) { --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -2149,6 +2149,18 @@ extern void rte_eth_link_get_nowait(uint struct rte_eth_link *link); =20 /** + * Test whether device supports link state interrupt mode. + * + * @param port_id + * The port identifier of the Ethernet device. + * @return + * - (1) if link state interrupt is supported + * - (0) if link state interrupt is not supported + */ +extern int +rte_eth_has_link_state(uint8_t port_id); + +/** * Retrieve the general I/O statistics of an Ethernet device. * * @param port_id --- a/lib/librte_ether/rte_ether_version.map +++ b/lib/librte_ether/rte_ether_version.map @@ -83,6 +83,7 @@ DPDK_2.2 { rte_eth_dev_wd_timeout_store; rte_eth_dma_zone_reserve; rte_eth_driver_register; + rte_eth_has_link_state; rte_eth_led_off; rte_eth_led_on; rte_eth_link;