From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E0A7A0544; Mon, 10 Oct 2022 10:38:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9EFE540146; Mon, 10 Oct 2022 10:38:29 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 68C4E40041 for ; Mon, 10 Oct 2022 10:38:28 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id CEA875E; Mon, 10 Oct 2022 11:38:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru CEA875E DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1665391107; bh=hGN2XILYP91xv2lUHgkAn5JxvFuB8pH+rpFwGCmaz1k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=kcelic2jCqdOLgbRtkDu4R1HNGcoVB3WQFpR8ckfFkyn+Ler4H3mL2y4+/UZi2ur4 Eaiy3c5rZO6JLknwVQzsT3bn6Vm6P7/4A19EYP1k7Py3eLK+LT4ZegZsag4eZbQSwr oMA9VqSUro38X9iV1wodLIMo9l/ebQ13w8rg53+g= Message-ID: Date: Mon, 10 Oct 2022 11:38:27 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH v11 1/5] ethdev: support get port error handling mode Content-Language: en-US To: Chengwen Feng , thomas@monjalon.net, ferruh.yigit@xilinx.com, ferruh.yigit@amd.com Cc: dev@dpdk.org, kalesh-anakkur.purayil@broadcom.com, somnath.kotur@broadcom.com, ajit.khaparde@broadcom.com, mdr@ashroe.eu, Stephen Hemminger References: <20220128124831.427-1-kalesh-anakkur.purayil@broadcom.com> <20221009091009.38978-1-fengchengwen@huawei.com> <20221009091009.38978-2-fengchengwen@huawei.com> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20221009091009.38978-2-fengchengwen@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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. Just: "Add error handling mode to device info." > > 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 With review notes applied (may be except usage of reserved fields): Reviewed-by: Andrew Rybchenko > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index e8d1e1c658..3443bf20e1 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -1629,6 +1629,22 @@ enum rte_eth_representor_type { > RTE_ETH_REPRESENTOR_PF, /**< representor of Physical Function. */ > }; > > +/** > + * @warning > + * @b EXPERIMENTAL: this enumeration may change without prior notice. > + * > + * Ethernet device error handling mode. > + */ > +enum rte_eth_err_handle_mode { > + /** No error handling modes are supported. */ > + RTE_ETH_ERROR_HANDLE_MODE_NONE, > + /** Passive error handling, after the PMD detect that a reset is > + * required, the PMD reports @see RTE_ETH_EVENT_INTR_RESET event, and > + * application invoke @see rte_eth_dev_reset to recover the port. > + */ > + RTE_ETH_ERROR_HANDLE_MODE_PASSIVE, > +}; > + > /** > * A structure used to retrieve the contextual information of > * an Ethernet device, such as the controlling driver of the > @@ -1689,8 +1705,12 @@ struct rte_eth_dev_info { > * embedded managed interconnect/switch. > */ > struct rte_eth_switch_info switch_info; > + /** Supported error handling mode. @see enum rte_eth_err_handle_mode */ > + uint8_t err_handle_mode; IMHO, it must be enum rte_eth_err_handle_mode err_handle_mode; Yes, it takes a bit more space, but it is a control path and code clearness is more important here than few extra bytes. > > - uint64_t reserved_64s[2]; /**< Reserved for future fields */ > + uint8_t reserved_8; /**< Reserved for future fields */ > + uint16_t reserved_16s[3]; /**< Reserved for future fields */ > + uint64_t reserved_64; /**< Reserved for future fields */ As far as I know it is done as per Stephen review notes, but I'm not really sure why it is a right way in ABI breaking release. I'd not touch it and just add a new field. > void *reserved_ptrs[2]; /**< Reserved for future fields */ > }; >