net/ice: add devargs to control link update
RFC 1/1 net/ice: add devargs to control link update
This patch adds the ‘link_period’ devargs to adjust the link update period (microseconds), when the value is less than or equal to 0 it will be disabled, by default it is not enabled.
--- doc/guides/nics/ice.rst | 7 ++++ drivers/net/ice/ice_ethdev.c | 69 ++++++++++++++++++++++++++++++++++++ drivers/net/ice/ice_ethdev.h | 1 + 3 files changed, 77 insertions(+)
doc/guides/nics/ice.rst +7 -0
@@ -303,6 +303,13 @@ Runtime Configuration * ``segment``: Check number of mbuf segments does not exceed HW limits. * ``offload``: Check for use of an unsupported offload flag. +- ``Cycle link update`` (default ``not enabled``) + + Cyclic link update is enabled when the PMD status changes to STARTED. Setting + the ``devargs`` parameter ``link_period`` adjusts the link update period in + microseconds, and is disabled when the value set is less than or equal to 0. + For example ``-a 81:00.0,link_period=5000`` or ``-a 81:00.0,link_period=0``. + Driver compilation and testing ------------------------------
drivers/net/ice/ice_ethdev.c +69 -0
111 lines not on this page · raw message
drivers/net/ice/ice_ethdev.h +1 -0
@@ -569,6 +569,7 @@ struct ice_devargs {/* Name of the field. */ char xtr_field_name[RTE_MBUF_DYN_NAMESIZE ];uint64_t mbuf_check; +uint32_t link_update_period; };/**
Signature · 1 line
2.25.1
RFC v2 1/1 net/ice: add devargs to control link update
This patch adds the ‘link_period’ devargs to adjust the link update period (microseconds), when the value is less than or equal to 0 it will be disabled, by default it is not enabled.
---
v2: Fix using the wrong variable.
--- doc/guides/nics/ice.rst | 7 ++++ drivers/net/ice/ice_ethdev.c | 69 ++++++++++++++++++++++++++++++++++++ drivers/net/ice/ice_ethdev.h | 1 + 3 files changed, 77 insertions(+)
doc/guides/nics/ice.rst +7 -0
@@ -303,6 +303,13 @@ Runtime Configuration * ``segment``: Check number of mbuf segments does not exceed HW limits. * ``offload``: Check for use of an unsupported offload flag. +- ``Cycle link update`` (default ``not enabled``) + + Cyclic link update is enabled when the PMD status changes to STARTED. Setting + the ``devargs`` parameter ``link_period`` adjusts the link update period in + microseconds, and is disabled when the value set is less than or equal to 0. + For example ``-a 81:00.0,link_period=5000`` or ``-a 81:00.0,link_period=0``. + Driver compilation and testing ------------------------------
drivers/net/ice/ice_ethdev.c +69 -0
111 lines not on this page · raw message
drivers/net/ice/ice_ethdev.h +1 -0
@@ -569,6 +569,7 @@ struct ice_devargs {/* Name of the field. */ char xtr_field_name[RTE_MBUF_DYN_NAMESIZE ];uint64_t mbuf_check; +uint32_t link_update_period; };/**
Signature · 1 line
2.25.1
Quoted 4 lines · Mingjin Ye
This patch adds the ‘link_period’ devargs to adjust the link update period (microseconds), when the value is less than or equal to 0 it will be disabled, by default it is not enabled.
Quoted 9 lines
Signed-off-by Mingjin Ye <[email protected]>---
v2: Fix using the wrong variable.--- doc/guides/nics/ice.rst | 7 ++++ drivers/net/ice/ice_ethdev.c | 69 ++++++++++++++++++++++++++++++++++++ drivers/net/ice/ice_ethdev.h | 1 + 3 files changed, 77 insertions(+)
This RFC is now quite old, so marking as "Not Applicable" in patchwork. I know we had some other rework around link status updates in our driver, so these changes may no longer be relevant. If they are, please submit a new patch version rebased on latest main.
Thanks,
/Bruce
drivers/net/ice/ice_ethdev.c ice_parse_mbuf_check(__rte_unused const char *key, const char *value, void *args · line 2244
Quoted 5 lines · On Tue, 22 Oct 2024 06:20:43 +0000 Mingjin Ye <[email protected]> wrote:
drivers/net/ice/ice_ethdev.c +5
-0+static int +ice_parse_clean_subtask_period(__rte_unused const char *key, +const char *value,void *args) +{ +int *num = (int *)args;
Cast of void * unnecessary in C.
You probably want period to be unsigned not signed.
Quoted 4 lines
drivers/net/ice/ice_ethdev.c +4
-0+int tmp; + + errno =0 ; + tmp =atoi (value);
drivers/net/ice/ice_ethdev.c ice_parse_mbuf_check(__rte_unused const char *key, const char *value, void *args · line 2258
Quoted 10 lines
drivers/net/ice/ice_ethdev.c +10
-0+if (tmp <0 ) { +PMD_DRV_LOG (WARNING ,"%s: \"%s\" is not greater than or equal to zero" , + key, value); +return -1 ; + } + + *num = tmp; + +return 0 ; +}
Prefer strtoul() when parsing values, it allows for better error handling.
Quoted 27 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Tuesday, October 22, 2024 11:23 PM
To: Ye, MingjinX <[email protected]>
Cc: [email protected]
Subject: Re: [RFC] net/ice: add devargs to control link updatedrivers/net/ice/ice_ethdev.c ice_parse_mbuf_check(__rte_unused const char *key, const char *value, void *args · line 2244
Quoted 5 lines · On Tue, 22 Oct 2024 06:20:43 +0000 Mingjin Ye <[email protected]> wrote:
drivers/net/ice/ice_ethdev.c +5
-0+static int +ice_parse_clean_subtask_period(__rte_unused const char *key, +const char *value,void *args) +{ +int *num = (int *)args;Cast of void * unnecessary in C.
You probably want period to be unsigned not signed.drivers/net/ice/ice_ethdev.c ice_parse_mbuf_check(__rte_unused const char *key, const char *value, void *args
Quoted 6 lines
drivers/net/ice/ice_ethdev.c +6
-0+int tmp; + + errno =0 ; + tmp =atoi (value); +if (tmp <0 ) { + PMD_DRV_LOG(WARNING, "%s: \"%s\" is not greater thanor equal to zero",
Quoted 10 lines
drivers/net/ice/ice_ethdev.c ice_parse_mbuf_check(__rte_unused const char *key, const char *value, void *args · line 2258
Quoted 8 lines
drivers/net/ice/ice_ethdev.c +8
-0+ key, value); +return -1 ; + } + + *num = tmp; + +return 0 ; +}Prefer
strtoul()when parsing values, it allows for better error handling.
Thank you. Good suggestion.