All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Ananyev <konstantin.ananyev@huawei.com>
To: Kamil Vojanec <vojanec@cesnet.cz>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Trevor Tao <taozj888@163.com>
Subject: RE: [PATCH] examples/l3fwd: fix conf propagation to RX queues
Date: Thu, 7 Mar 2024 10:14:37 +0000	[thread overview]
Message-ID: <29c7562593cf46eeacd648b681df3af6@huawei.com> (raw)
In-Reply-To: <20240216120207.126025-1-vojanec@cesnet.cz>


> When configuring RX queues, the default port configuration was used,
> even though it was modified before. This results in the
> 'relax-rx-offload' not being respected for RX queues.
> This commit uses 'rte_eth_dev_conf_get()' to obtain the device
> configuration structure instead.
> 
> Fixes: 4b01cabfb0 ("examples/l3fwd: add option to relax Rx offload")
> Signed-off-by: Kamil Vojanec <vojanec@cesnet.cz>
> ---
>  examples/l3fwd/main.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
> index 3bf28aec0c..2b714a362a 100644
> --- a/examples/l3fwd/main.c
> +++ b/examples/l3fwd/main.c
> @@ -1388,6 +1388,7 @@ l3fwd_poll_resource_setup(void)
>  		fflush(stdout);
>  		/* init RX queues */
>  		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
> +			struct rte_eth_conf local_conf;
>  			struct rte_eth_rxconf rxq_conf;
> 
>  			portid = qconf->rx_queue_list[queue].port_id;
> @@ -1408,8 +1409,14 @@ l3fwd_poll_resource_setup(void)
>  					"Error during getting device (port %u) info: %s\n",
>  					portid, strerror(-ret));
> 
> +			ret = rte_eth_dev_conf_get(portid, &local_conf);
> +			if (ret != 0)
> +				rte_exit(EXIT_FAILURE,
> +					"Error during getting device (port %u) configuration: %s\n",
> +					portid, strerror(-ret));
> +
>  			rxq_conf = dev_info.default_rxconf;
> -			rxq_conf.offloads = port_conf.rxmode.offloads;
> +			rxq_conf.offloads = local_conf.rxmode.offloads;
>  			if (!per_port_pool)
>  				ret = rte_eth_rx_queue_setup(portid, queueid,
>  						nb_rxd, socketid,
> --

LGTM
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
 

> 2.39.3


  parent reply	other threads:[~2024-03-07 10:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 12:02 [PATCH] examples/l3fwd: fix conf propagation to RX queues Kamil Vojanec
2024-03-07  8:47 ` Thomas Monjalon
2024-03-07 10:14 ` Konstantin Ananyev [this message]
2024-03-07 15:03   ` Thomas Monjalon
2024-03-07 14:07 ` Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29c7562593cf46eeacd648b681df3af6@huawei.com \
    --to=konstantin.ananyev@huawei.com \
    --cc=dev@dpdk.org \
    --cc=taozj888@163.com \
    --cc=vojanec@cesnet.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.