[dpdk-dev,v2,4/5] app/testpmd: request link status interrupt

Message ID 83bfe3fd6dc1f7696049bf8d8d1ef20370c92242.1492517222.git.gaetan.rivet@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Gaëtan Rivet April 18, 2017, 12:17 p.m. UTC
  For drivers supporting the LSC event, enable it.
This allows to test LSC event support.

Add the --no-lsc-interrupt parameter to explicitly disable the link status
change interrupt.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 app/test-pmd/parameters.c |  4 ++++
 app/test-pmd/testpmd.c    | 13 +++++++++++++
 app/test-pmd/testpmd.h    |  1 +
 3 files changed, 18 insertions(+)
  

Comments

Ferruh Yigit April 21, 2017, 2:55 p.m. UTC | #1
On 4/18/2017 1:17 PM, Gaetan Rivet wrote:
> For drivers supporting the LSC event, enable it.
> This allows to test LSC event support.
> 
> Add the --no-lsc-interrupt parameter to explicitly disable the link status
> change interrupt.
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> ---
>  app/test-pmd/parameters.c |  4 ++++
>  app/test-pmd/testpmd.c    | 13 +++++++++++++
>  app/test-pmd/testpmd.h    |  1 +
>  3 files changed, 18 insertions(+)

Hi Gaetan,

This patch adds new option to testpmd, can you please update testpmd
documentation to document new option?

Same is valid for next patch (no-rmv-interrupt option)

Thanks,
ferruh
  
Gaëtan Rivet April 25, 2017, 9:07 a.m. UTC | #2
On Fri, Apr 21, 2017 at 03:55:43PM +0100, Ferruh Yigit wrote:
>On 4/18/2017 1:17 PM, Gaetan Rivet wrote:
>> For drivers supporting the LSC event, enable it.
>> This allows to test LSC event support.
>>
>> Add the --no-lsc-interrupt parameter to explicitly disable the link status
>> change interrupt.
>>
>> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
>> ---
>>  app/test-pmd/parameters.c |  4 ++++
>>  app/test-pmd/testpmd.c    | 13 +++++++++++++
>>  app/test-pmd/testpmd.h    |  1 +
>>  3 files changed, 18 insertions(+)
>
>Hi Gaetan,
>
>This patch adds new option to testpmd, can you please update testpmd
>documentation to document new option?
>
>Same is valid for next patch (no-rmv-interrupt option)
>

Sure, I will send a patch for this.

Should I send a new version of my previous series or a single
patch fixing the documentation for both options as a standalone?

>Thanks,
>ferruh
>
  
Ferruh Yigit April 25, 2017, 9:40 a.m. UTC | #3
On 4/25/2017 10:07 AM, Gaëtan Rivet wrote:
> On Fri, Apr 21, 2017 at 03:55:43PM +0100, Ferruh Yigit wrote:
>> On 4/18/2017 1:17 PM, Gaetan Rivet wrote:
>>> For drivers supporting the LSC event, enable it.
>>> This allows to test LSC event support.
>>>
>>> Add the --no-lsc-interrupt parameter to explicitly disable the link status
>>> change interrupt.
>>>
>>> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
>>> ---
>>>  app/test-pmd/parameters.c |  4 ++++
>>>  app/test-pmd/testpmd.c    | 13 +++++++++++++
>>>  app/test-pmd/testpmd.h    |  1 +
>>>  3 files changed, 18 insertions(+)
>>
>> Hi Gaetan,
>>
>> This patch adds new option to testpmd, can you please update testpmd
>> documentation to document new option?
>>
>> Same is valid for next patch (no-rmv-interrupt option)
>>
> 
> Sure, I will send a patch for this.
> 
> Should I send a new version of my previous series or a single
> patch fixing the documentation for both options as a standalone?

Single patch to fix documentation will be do it.

Thanks,
ferruh
  

Patch

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index c36bcf8..c79c349 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -200,6 +200,7 @@  usage(char* progname)
 		" or total packet length.\n");
 	printf("  --disable-link-check: disable check on link status when "
 	       "starting/stopping ports.\n");
+	printf("  --no-lsc-interrupt: disable link status change interrupt.\n");
 }
 
 #ifdef RTE_LIBRTE_CMDLINE
@@ -568,6 +569,7 @@  launch_args_parse(int argc, char** argv)
 		{ "no-flush-rx",	0, 0, 0 },
 		{ "txpkts",			1, 0, 0 },
 		{ "disable-link-check",		0, 0, 0 },
+		{ "no-lsc-interrupt",		0, 0, 0 },
 		{ 0, 0, 0, 0 },
 	};
 
@@ -998,6 +1000,8 @@  launch_args_parse(int argc, char** argv)
 				no_flush_rx = 1;
 			if (!strcmp(lgopts[opt_idx].name, "disable-link-check"))
 				no_link_check = 1;
+			if (!strcmp(lgopts[opt_idx].name, "no-lsc-interrupt"))
+				lsc_interrupt = 0;
 
 			break;
 		case 'h':
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 221f0e9..5f94393 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -271,6 +271,11 @@  uint8_t no_flush_rx = 0; /* flush by default */
 uint8_t no_link_check = 0; /* check by default */
 
 /*
+ * Enable link status change notification
+ */
+uint8_t lsc_interrupt = 1; /* enabled by default */
+
+/*
  * NIC bypass mode configuration options.
  */
 #ifdef RTE_NIC_BYPASS
@@ -1746,6 +1751,9 @@  check_all_ports_link_status(uint32_t port_mask)
 		if (all_ports_up == 1 || count == (MAX_CHECK_TIME - 1)) {
 			print_flag = 1;
 		}
+
+		if (lsc_interrupt)
+			break;
 	}
 }
 
@@ -1929,6 +1937,11 @@  init_port_config(void)
 #ifdef RTE_NIC_BYPASS
 		rte_eth_dev_bypass_init(pid);
 #endif
+
+		if (lsc_interrupt &&
+		    (rte_eth_devices[pid].data->dev_flags &
+		     RTE_ETH_DEV_INTR_LSC))
+			port->dev_conf.intr_conf.lsc = 1;
 	}
 }
 
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 642796e..62f89e6 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -305,6 +305,7 @@  extern uint8_t no_flush_rx; /**<set by "--no-flush-rx" parameter */
 extern uint8_t  mp_anon; /**< set by "--mp-anon" parameter */
 extern uint8_t no_link_check; /**<set by "--disable-link-check" parameter */
 extern volatile int test_done; /* stop packet forwarding when set to 1. */
+extern uint8_t lsc_interrupt; /**< disabled by "--no-lsc-interrupt" parameter */
 
 #ifdef RTE_NIC_BYPASS
 extern uint32_t bypass_timeout; /**< Store the NIC bypass watchdog timeout */