[PATCH v11 1/5] ethdev: support get port error handling mode

Andrew Rybchenko andrew.rybchenko at oktetlabs.ru
Mon Oct 10 10:44:16 CEST 2022


On 10/9/22 12:10, Chengwen Feng wrote:
> This patch support gets port's error handling mode by
> rte_eth_dev_info_get() API.
> 
> Currently, the defined modes include:
> 1) NONE: it means no error handling modes are supported by this port.
> 2) PASSIVE: passive error handling, after the PMD detect that a reset
> is required, the PMD reports RTE_ETH_EVENT_INTR_RESET event, and
> application invoke rte_eth_dev_reset() to recover the port.
> 
> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>

in fact one more point below

> ---
>   app/test-pmd/config.c               |  2 ++
>   drivers/net/e1000/igb_ethdev.c      |  2 ++
>   drivers/net/ena/ena_ethdev.c        |  2 ++
>   drivers/net/iavf/iavf_ethdev.c      |  2 ++
>   drivers/net/ixgbe/ixgbe_ethdev.c    |  2 ++
>   drivers/net/txgbe/txgbe_ethdev_vf.c |  2 ++
>   lib/ethdev/rte_ethdev.h             | 22 +++++++++++++++++++++-
>   7 files changed, 33 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 841e8efe78..bd7f2ba257 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -921,6 +921,8 @@ port_infos_display(portid_t port_id)
>   			printf("Switch Rx domain: %u\n",
>   			       dev_info.switch_info.rx_domain);
>   	}
> +	if (dev_info.err_handle_mode == RTE_ETH_ERROR_HANDLE_MODE_PASSIVE)
> +		printf("Device error handling mode: passive\n");

It should be done using switch/case instead of if/elseif.
Also I'd say that none should be handled as well.

>   }
>   
>   void



More information about the dev mailing list