[PATCH v5 1/5] net/ice: add option to download scheduler topology
Medvedkin, Vladimir
vladimir.medvedkin at intel.com
Fri Oct 25 19:01:06 CEST 2024
Hi Bruce,
On 23/10/2024 17:55, Bruce Richardson wrote:
> The DDP package file being loaded at init time may contain an
> alternative Tx Scheduler topology in it. Add driver option to load this
> topology at init time.
>
> Signed-off-by: Bruce Richardson<bruce.richardson at intel.com>
> ---
> doc/guides/nics/ice.rst | 15 +++++++++++++++
> drivers/net/ice/base/ice_ddp.c | 20 +++++++++++++++++---
> drivers/net/ice/base/ice_ddp.h | 4 ++--
> drivers/net/ice/ice_ethdev.c | 24 +++++++++++++++---------
> drivers/net/ice/ice_ethdev.h | 1 +
> 5 files changed, 50 insertions(+), 14 deletions(-)
>
<snip>
> @@ -2030,19 +2032,18 @@ static int
> parse_bool(const char *key, const char *value, void *args)
> {
> int *i = (int *)args;
> - char *end;
> - int num;
>
> - num = strtoul(value, &end, 10);
> -
> - if (num != 0 && num != 1) {
> - PMD_DRV_LOG(WARNING, "invalid value:\"%s\" for key:\"%s\", "
> - "value must be 0 or 1",
> + if (value == NULL || value[0] == '\0') {
> + PMD_DRV_LOG(WARNING, "key:\"%s\", requires a value, which must be 0 or 1", key);
> + return -1;
> + }
> + if (value[1] != '\0' || (value[0] != '0' && value[0] != '1')) {
> + PMD_DRV_LOG(WARNING, "invalid value:\"%s\" for key:\"%s\", value must be 0 or 1",
> value, key);
> return -1;
> }
>
> - *i = num;
> + *i = value[0] - '0';
Ithinkthatinsteadof usingchararithmetic,it wouldbe better to:
*i = !(value[0] == '0')
> return 0;
> }
>
> @@ -2307,6 +2308,10 @@ static int ice_parse_devargs(struct rte_eth_dev *dev)
> if (ret)
> goto bail;
>
> + ret = rte_kvargs_process(kvlist, ICE_DDP_LOAD_SCHED_ARG,
> + &parse_bool, &ad->devargs.ddp_load_sched);
> + if (ret)
> + goto bail;
> bail:
> rte_kvargs_free(kvlist);
> return ret;
> @@ -7185,6 +7190,7 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ice,
> ICE_SAFE_MODE_SUPPORT_ARG "=<0|1>"
> ICE_DEFAULT_MAC_DISABLE "=<0|1>"
> ICE_DDP_FILENAME_ARG "=</path/to/file>"
> + ICE_DDP_LOAD_SCHED_ARG "=<0|1>"
> ICE_RX_LOW_LATENCY_ARG "=<0|1>");
>
> RTE_LOG_REGISTER_SUFFIX(ice_logtype_init, init, NOTICE);
> diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h
> index 076cf595e8..2794a76096 100644
> --- a/drivers/net/ice/ice_ethdev.h
> +++ b/drivers/net/ice/ice_ethdev.h
> @@ -564,6 +564,7 @@ struct ice_devargs {
> uint8_t proto_xtr[ICE_MAX_QUEUE_NUM];
> uint8_t pin_idx;
> uint8_t pps_out_ena;
> + uint8_t ddp_load_sched;
> int xtr_field_offs;
> uint8_t xtr_flag_offs[PROTO_XTR_MAX];
> /* Name of the field. */
--
Regards,
Vladimir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20241025/1c027b4e/attachment-0001.htm>
More information about the dev
mailing list