From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id 55C9CB3F6 for ; Thu, 5 Feb 2015 06:49:10 +0100 (CET) Received: by mail-pa0-f43.google.com with SMTP id eu11so7816046pac.2 for ; Wed, 04 Feb 2015 21:49:09 -0800 (PST) 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-type:content-transfer-encoding; bh=fHx0vGbjQ4MQJo4qHff+uSJ18+5GM8E7O+vY31k5PUg=; b=FxN8UwPqx8yE3kM+ijpyVNwM2i0P+450dPdCkKdJxxuG4MWUIyHKCqrfrGPyJQPc1S nuWtXOX3qFgPvJ13Y7UJ3yR++unsLjdm2vxhrlFvaGueIPOtgS79YI6+kKIILffle4Z0 tj31ymcgD5iik33DwzdfJ5fCoveb6jUckzmGm2dTukZ+lxxpzhzi9etrQRfQLLpN2RjO IR26vdo3ZsAQhIkrErLJ5mDy7RXPUpU1wQZDEHvC1+qdLeI/LWGgc23x5ZR4GYw49CZJ RBTI8B9Apd8u1jfUomcIx5w82iIOut4x7+vZNgkAZdfaIxZYjkBIoPrt9lUSfrkk07mn el1w== X-Gm-Message-State: ALoCoQlIhKcB8cZfPSJSuRmW7GSX8I9b7GMbns+d/TTtEbwnyEAT+Da9XavhoAfKNjZ1ibo/Q7Id X-Received: by 10.66.190.2 with SMTP id gm2mr3243629pac.100.1423115349370; Wed, 04 Feb 2015 21:49:09 -0800 (PST) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id ku12sm3797625pab.39.2015.02.04.21.49.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Feb 2015 21:49:09 -0800 (PST) Date: Wed, 4 Feb 2015 21:49:07 -0800 From: Stephen Hemminger To: Neil Horman Message-ID: <20150204214907.6527b1b1@urahara> In-Reply-To: <2d9df6f5729c42a9a2b85a20b7316243@BRMWP-EXMB11.corp.brocade.com> References: <1423098809-21305-1-git-send-email-stephen@networkplumber.org> <1423098809-21305-2-git-send-email-stephen@networkplumber.org> <2d9df6f5729c42a9a2b85a20b7316243@BRMWP-EXMB11.corp.brocade.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" , KY Srinivasan , Stephen Hemminger Subject: Re: [dpdk-dev] [PATCH 1/7] ether: add function to query for link state interrupt 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, 05 Feb 2015 05:49:10 -0000 On Thu, 5 Feb 2015 01:47:37 +0000 Neil Horman wrote: > On Wed, Feb 04, 2015 at 05:13:23PM -0800, Stephen Hemminger wrote: > > From: Stephen Hemminger > > > > 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 ++++++++++++ > > 2 files changed, 26 insertions(+) > > > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > > index ea3a1fb..4d803d0 100644 > > --- a/lib/librte_ether/rte_ethdev.c > > +++ b/lib/librte_ether/rte_ethdev.c > > @@ -1264,6 +1264,20 @@ rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) > > } > > } > > > > +int > > +rte_eth_has_link_state(uint8_t port_id) > > +{ > > + struct rte_eth_dev *dev; > > + > > + if (port_id >= nb_ports) { > > + PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); > > + return 0; > > + } > > + dev = &rte_eth_devices[port_id]; > > + > > + return (dev->pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) != 0; > > +} > > + > > void > > rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) > > { > > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > > index 1200c1c..9d43ca3 100644 > > --- a/lib/librte_ether/rte_ethdev.h > > +++ b/lib/librte_ether/rte_ethdev.h > > @@ -2038,6 +2038,18 @@ extern void rte_eth_link_get_nowait(uint8_t port_id, > > struct rte_eth_link *link); > > > > /** > > + * 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 > > -- > > 2.1.4 > > > > > I think if your intention is to expose this as an application (or other library > visible api), you'll need to add it to the appropriate version map file for the > link now. Should just be a single line addition > > Regards > Neil > Will add that after other changes are approved. Also looking at the map files they seem to have been auto generated because some symbols are exposed which are unnecessary (example pci_driver_list)