DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] Link Status and Interrupts in 2.2.0
@ 2016-04-25 11:49 martin_curran-gray
  2016-04-25 20:03 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: martin_curran-gray @ 2016-04-25 11:49 UTC (permalink / raw)
  To: users

Hello All,

Been adding in support for the interrupt handler for the link status for ports on an X710 card.

Before I changed the lsc field of the intr_conf to 1, I was able to see the link status information correctly.

The documentation does say that if interrupts are enabled, the rte_eth_link_get function recovers the information from a structure that the interrupt host thread fills in, rather than going to the card it's self.

This seems reasonable, however....once you've had an interrupt then all is good,

But if the link was "active" when dpdk and my app starts up, then no interrupt is generated, which then means that global structure is not filled in, so I see

get link status
status is 0  speed is 0 duplex is 0

if I turn the lasers on and off on my source I get the expected values, since the interrupt event causes the global data to be populated.

get link status
status is 1  speed is 10000 duplex is 2

So the question is, how do I use the LSC interrupts via the "rte_eth_dev_callback_register" function,
but get the correct values in the link status information if no interrupts occur?

I saw a submission to the patchwork 7160, dated Sep 24 2015 but it was marked as not applicable , archived.....

Many Thanks


Martin

R&D Engineer
Keysight Technologies UK Ltd

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

* Re: [dpdk-users] Link Status and Interrupts in 2.2.0
  2016-04-25 11:49 [dpdk-users] Link Status and Interrupts in 2.2.0 martin_curran-gray
@ 2016-04-25 20:03 ` Stephen Hemminger
  2016-04-26  6:03 ` martin_curran-gray
  2016-04-27  9:39 ` Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2016-04-25 20:03 UTC (permalink / raw)
  To: martin_curran-gray; +Cc: users

On Mon, 25 Apr 2016 11:49:52 +0000
<martin_curran-gray@keysight.com> wrote:

> Hello All,
> 
> Been adding in support for the interrupt handler for the link status for ports on an X710 card.
> 
> Before I changed the lsc field of the intr_conf to 1, I was able to see the link status information correctly.
> 
> The documentation does say that if interrupts are enabled, the rte_eth_link_get function recovers the information from a structure that the interrupt host thread fills in, rather than going to the card it's self.
> 
> This seems reasonable, however....once you've had an interrupt then all is good,
> 
> But if the link was "active" when dpdk and my app starts up, then no interrupt is generated, which then means that global structure is not filled in, so I see
> 
> get link status
> status is 0  speed is 0 duplex is 0
> 
> if I turn the lasers on and off on my source I get the expected values, since the interrupt event causes the global data to be populated.
> 
> get link status
> status is 1  speed is 10000 duplex is 2
> 
> So the question is, how do I use the LSC interrupts via the "rte_eth_dev_callback_register" function,
> but get the correct values in the link status information if no interrupts occur?
> 
> I saw a submission to the patchwork 7160, dated Sep 24 2015 but it was marked as not applicable , archived.....
> 
> Many Thanks
> 
> 
> Martin
> 
> R&D Engineer
> Keysight Technologies UK Ltd

Your application needs to make one call to check for current link state after
device is started. After that all updates can be done from the LSC interrupt callback.

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

* Re: [dpdk-users] Link Status and Interrupts in 2.2.0
  2016-04-25 11:49 [dpdk-users] Link Status and Interrupts in 2.2.0 martin_curran-gray
  2016-04-25 20:03 ` Stephen Hemminger
@ 2016-04-26  6:03 ` martin_curran-gray
  2016-04-27  9:39 ` Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: martin_curran-gray @ 2016-04-26  6:03 UTC (permalink / raw)
  To: users

 > Your application needs to make one call to check for current link state after device is started. After that all updates can be done from the LSC interrupt callback.

I made a call from the application, it just keeps getting 0s?

If I change the lsc value to 0, then the call gets the correct value, since it's asking the card, not the global value the callback fills in 

I seem to be able to register a handler for the interrupt which gets called, even if lsc is 0?

Then I can call that once at startup, then use the callback????

Seems a little strange?

Thanks for your help Stephen H.

Martin Curran-Gray

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

* Re: [dpdk-users] Link Status and Interrupts in 2.2.0
  2016-04-25 11:49 [dpdk-users] Link Status and Interrupts in 2.2.0 martin_curran-gray
  2016-04-25 20:03 ` Stephen Hemminger
  2016-04-26  6:03 ` martin_curran-gray
@ 2016-04-27  9:39 ` Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2016-04-27  9:39 UTC (permalink / raw)
  To: martin_curran-gray; +Cc: users, stephen, dev

2016-04-25 11:49, martin_curran-gray@keysight.com:
> But if the link was "active" when dpdk and my app starts up,
> then no interrupt is generated, which then means that global
> structure is not filled in

You are describing the case of interrupts enabled but never called.
It has been fixed in DPDK 2.0:
	http://dpdk.org/commit/99610782

But a race condition has been seen if interrupt fires during
rte_eth_dev_start() call. The decision was to remove link update if
interrupt is enabled (DPDK 2.2):
	http://dpdk.org/commit/d5790b03
This "fix" was a bit strange:
- Is it possible to fix the race condition with link_update in the drivers?
- Is it possible to update the link status in dev_start of each driver
without race condition with the interrupt?
- Why calling link_update() from rte_eth_dev_start() in the polling case?

> I saw a submission to the patchwork 7160, dated Sep 24 2015
> but it was marked as not applicable , archived.....

It has been re-submitted and applied (hence the problem):
	http://dpdk.org/patch/8112

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

end of thread, other threads:[~2016-04-27  9:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-25 11:49 [dpdk-users] Link Status and Interrupts in 2.2.0 martin_curran-gray
2016-04-25 20:03 ` Stephen Hemminger
2016-04-26  6:03 ` martin_curran-gray
2016-04-27  9:39 ` Thomas Monjalon

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).