[PATCH v2] examples/multi_process: reconfigure port when rss or csum isn't supported
Bruce Richardson
bruce.richardson at intel.com
Mon Feb 21 10:21:14 CET 2022
On Mon, Feb 21, 2022 at 03:35:18PM +0000, Wenwu Ma wrote:
> The default values of rx mq_mode and rx offloads for port
> will cause symmetric_mp startup failure if the port do not
> support rss or csum. This Patch make the app to reconfigure
> the NIC without them. Only quit the app if the second
> reconfiguration fails.
>
> Signed-off-by: Wenwu Ma <wenwux.ma at intel.com>
> ---
> examples/multi_process/symmetric_mp/main.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
> index 050337765f..c0e7ed70e0 100644
> --- a/examples/multi_process/symmetric_mp/main.c
> +++ b/examples/multi_process/symmetric_mp/main.c
> @@ -232,6 +232,20 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
> }
>
> retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
> + if (retval == -EINVAL) {
> + printf("Maybe port %u don't have csum offloads capabilities, "
> + "so clear csum config and try again.\n", port);
Two comments for here and below:
1. Don't split error messages across multiple lines, as it means the
user/developer cannot find them using "grep" on the code.
2. Text should try and be shorter and clearer. I'd suggest:
"Port configuration failed. Re-attempting with HW checksum disabled"
> + port_conf.rxmode.offloads &= ~(RTE_ETH_RX_OFFLOAD_CHECKSUM);
> + retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
> + }
> +
> + if (retval == -ENOTSUP) {
> + printf("Maybe port %u don't support rss, "
> + "so clear rss config and try again.\n", port);
Same two comments from above apply here.
> + port_conf.rxmode.mq_mode &= ~(RTE_ETH_MQ_RX_RSS);
> + retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
> + }
> +
> if (retval < 0)
> return retval;
>
> --
> 2.25.1
>
More information about the dev
mailing list