DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users]  Detect LSC capability of dpdk ports
@ 2016-06-27  9:55 John Sucaet
  2016-06-27 16:23 ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: John Sucaet @ 2016-06-27  9:55 UTC (permalink / raw)
  To: users

Hi,

How can a dpdk application determine if a port has support for lsc, 
before trying to configure it?

Thanks

John

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] Detect LSC capability of dpdk ports
  2016-06-27  9:55 [dpdk-users] Detect LSC capability of dpdk ports John Sucaet
@ 2016-06-27 16:23 ` Stephen Hemminger
  2016-06-27 17:21   ` Thomas Monjalon
  2016-06-28  8:20   ` John Sucaet
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Hemminger @ 2016-06-27 16:23 UTC (permalink / raw)
  To: John Sucaet; +Cc: users

On Mon, 27 Jun 2016 11:55:46 +0200
John Sucaet <john.sucaet@oneaccess-net.com> wrote:

> Hi,
> 
> How can a dpdk application determine if a port has support for lsc, 
> before trying to configure it?
> 
> Thanks
> 
> John

We ended up adding this patch, which never seemed to be accepted upstream.
From 79060ea428f070f309f577006af43eb4ab74586d Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <shemming@brocade.com>
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 <stephen@networkplumber.org>
---
 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;
 }
 
+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=%d\n", port_id);
+		return 0;
+	}
+	dev = &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) != 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);
 
 /**
+ * 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;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] Detect LSC capability of dpdk ports
  2016-06-27 16:23 ` Stephen Hemminger
@ 2016-06-27 17:21   ` Thomas Monjalon
  2016-06-27 17:35     ` Stephen Hemminger
  2016-06-28  8:20   ` John Sucaet
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2016-06-27 17:21 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users, John Sucaet

2016-06-27 09:23, Stephen Hemminger:
> On Mon, 27 Jun 2016 11:55:46 +0200
> John Sucaet <john.sucaet@oneaccess-net.com> wrote:
> > How can a dpdk application determine if a port has support for lsc, 
> > before trying to configure it?
> 
> We ended up adding this patch, which never seemed to be accepted upstream.

No, this patch was part of a series for Hyper-V.
Why Hyper-V PMD is still not integrated? What is the status please?

> From 79060ea428f070f309f577006af43eb4ab74586d Mon Sep 17 00:00:00 2001
> From: Stephen Hemminger <shemming@brocade.com>
> 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 <stephen@networkplumber.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] Detect LSC capability of dpdk ports
  2016-06-27 17:21   ` Thomas Monjalon
@ 2016-06-27 17:35     ` Stephen Hemminger
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2016-06-27 17:35 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: users, John Sucaet

On Mon, 27 Jun 2016 19:21:12 +0200
Thomas Monjalon <thomas.monjalon@6wind.com> wrote:

> 2016-06-27 09:23, Stephen Hemminger:
> > On Mon, 27 Jun 2016 11:55:46 +0200
> > John Sucaet <john.sucaet@oneaccess-net.com> wrote:
> > > How can a dpdk application determine if a port has support for lsc, 
> > > before trying to configure it?
> > 
> > We ended up adding this patch, which never seemed to be accepted upstream.
> 
> No, this patch was part of a series for Hyper-V.
> Why Hyper-V PMD is still not integrated? What is the status please?

The original driver was on older code base. There is some activity to port
a newer FreeBSD driver code base but it was not ready last I checked.

Ask Jan Blunck the DPDK maintainer now at Brocade.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-users] Detect LSC capability of dpdk ports
  2016-06-27 16:23 ` Stephen Hemminger
  2016-06-27 17:21   ` Thomas Monjalon
@ 2016-06-28  8:20   ` John Sucaet
  1 sibling, 0 replies; 5+ messages in thread
From: John Sucaet @ 2016-06-28  8:20 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users

Thanks, Stephen.

This function rte_eth_has_link_state was exactly what I was looking for. 
As it seems interesting to more people, could it be resubmitted outside 
the patch serie for Hyper-V?

Regards

John

On 27-06-16 18:23, Stephen Hemminger wrote:
> On Mon, 27 Jun 2016 11:55:46 +0200
> John Sucaet <john.sucaet@oneaccess-net.com> wrote:
>
>> Hi,
>>
>> How can a dpdk application determine if a port has support for lsc,
>> before trying to configure it?
>>
>> Thanks
>>
>> John
> We ended up adding this patch, which never seemed to be accepted upstream.
> >From 79060ea428f070f309f577006af43eb4ab74586d Mon Sep 17 00:00:00 2001
> From: Stephen Hemminger <shemming@brocade.com>
> 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 <stephen@networkplumber.org>
> ---
>   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;
>   }
>   
> +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=%d\n", port_id);
> +		return 0;
> +	}
> +	dev = &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) != 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);
>   
>   /**
> + * 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;
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-28  8:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-27  9:55 [dpdk-users] Detect LSC capability of dpdk ports John Sucaet
2016-06-27 16:23 ` Stephen Hemminger
2016-06-27 17:21   ` Thomas Monjalon
2016-06-27 17:35     ` Stephen Hemminger
2016-06-28  8:20   ` John Sucaet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).