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 77624A04FD; Mon, 3 Oct 2022 19:35:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67BB540F16; Mon, 3 Oct 2022 19:35:45 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2074.outbound.protection.outlook.com [40.107.92.74]) by mails.dpdk.org (Postfix) with ESMTP id 4875840E5A for ; Mon, 3 Oct 2022 19:35:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SzHILSiD/ENhr/pzxdr9urrYs2lRF0yQdtopmArVKVbC5ke/23vOYYNYM2mSitXa7/oUvbeaqOryTBgy1VTyiVh0OpnTVnbnlfoaFSK8xDjBhmqtiaWGQ9TnsuvvUGeyGkXfNPnSgy6mdXMEhsrY8/28i5gKhKObfZzWaQrMAUJ+eRpFNLlAPAw2BWLa4Bl8xkj3/WcY3cpoR+YV51BZON9aSi4Ddog92iSyPb8uSG/Ohzkh06qVd/tOrwydAixQrqbMEXMx9V6HVdmx5Ff86akAaTxP0I+Mgq6wF1pju/EI31VrIbIhaP+5EvHBSvOMydok07jEFIBHAtHIk6pNUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9bm2TqrX5PsvUzxEN7jCEfBI6kZDZ6+bcmb7FAjsPFg=; b=j/ezFuaM4aFNMQZQdahYpgxEOBAOw3k9MhtfEiOaE50K+SkvB5Q4jY1++MgKVuTJqvvukK5y9tRz/H2S2rdTvWthqU6Ap2PMAszrZcnFs9PoqOYEWV3Z/R0SbFQe86dICo5uiG6+7YdqW+BAtGBX5pdrvrayLozzQiA+V8nx41cnbt++SFNKWLpZLV+LbtDuW/3+JtgWu8UXzR6CK3VT40KbtKwr4131tGWpmDXw+knduQvN6OjT/jqLVPAqjanEDInAy99/Cp6u+lq7G5/2QBoGlrbxjN+OP1xvPHNI6YJzeRk6O64p2YdL1gzgiJT+/JnN5zjKVGT3V3s9LsmTZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 149.199.80.198) smtp.rcpttodomain=huawei.com smtp.mailfrom=amd.com; dmarc=fail (p=quarantine sp=quarantine pct=100) action=quarantine header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9bm2TqrX5PsvUzxEN7jCEfBI6kZDZ6+bcmb7FAjsPFg=; b=lif+PyzwWmhhrZrLYKSAzqZQ52D6R48NhfnT1OjmIv7CBsezUO2st3dtl49M/k8JgZ9OtaHIKGUhcG86hT69MUgOtRm1CMNXFuggrrn1A0VZiBvbbpWKP5GKyrksVJdDGiez5VHRS0ARFexEoLskmMwaNxK2X/9h4ayIUDtyl0s= Received: from BN9PR03CA0857.namprd03.prod.outlook.com (2603:10b6:408:13d::22) by BL3PR02MB8892.namprd02.prod.outlook.com (2603:10b6:208:3b3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Mon, 3 Oct 2022 17:35:41 +0000 Received: from BN1NAM02FT045.eop-nam02.prod.protection.outlook.com (2603:10b6:408:13d:cafe::97) by BN9PR03CA0857.outlook.office365.com (2603:10b6:408:13d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23 via Frontend Transport; Mon, 3 Oct 2022 17:35:41 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 149.199.80.198) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=fail action=quarantine header.from=amd.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning amd.com discourages use of 149.199.80.198 as permitted sender) Received: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by BN1NAM02FT045.mail.protection.outlook.com (10.13.2.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5676.17 via Frontend Transport; Mon, 3 Oct 2022 17:35:41 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 3 Oct 2022 18:35:40 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2375.24 via Frontend Transport; Mon, 3 Oct 2022 18:35:40 +0100 Envelope-to: fengchengwen@huawei.com, thomas@monjalon.net, dev@dpdk.org, kalesh-anakkur.purayil@broadcom.com, somnath.kotur@broadcom.com, ajit.khaparde@broadcom.com, mdr@ashroe.eu, Andrew.Rybchenko@oktetlabs.ru Received: from [10.71.194.74] (port=29461) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1ofPLw-00087O-Jf; Mon, 03 Oct 2022 18:35:40 +0100 Message-ID: Date: Mon, 3 Oct 2022 18:35:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v9 1/5] ethdev: support get port error handling mode To: Chengwen Feng , CC: , , , , , References: <20220128124831.427-1-kalesh-anakkur.purayil@broadcom.com> <20220922074151.39450-1-fengchengwen@huawei.com> <20220922074151.39450-2-fengchengwen@huawei.com> Content-Language: en-US From: Ferruh Yigit In-Reply-To: <20220922074151.39450-2-fengchengwen@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1NAM02FT045:EE_|BL3PR02MB8892:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e91d225-3b98-422c-6e3a-08daa565b1ac X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XPzoM5Vc9ZNRPEeHnTcg7DB9NiD5E4Y5FKQaEU343pQjJIjwyj17ZHA1mpvLPzH81ZSTZKDQzb/ZrforDiaR+mwu+/5A75unxFu4C8fiFO363ulYousZU1AZDRW7lc2Zb+F38f/XatnnEAEPNixE/r7+cVnKR88BOnxDr3f5H9Cc+m69oBns6E4YV/dXTOxdRc34cfTifuvYTGh5zW1Drq2eRNsVWm/q8IPsjgyJ4cpvU0KiWPDwGDAjcd+HV41ARlF8aW/JefClftCwZLV/zWuMLZOicob2CfwohF0et8snZqBBzqL+MP8yfYPQ96XoQIt8Dyj1VrJcUT2pKIqmNlz0+OOnpKQ3H5/Jl75nzLe3Kmnck75sF7eZ7CYITvRUmEjktILi+P1ZcCHdKLvTPROYd9fa0Ir4nqr3WSUGLam/LWb3S2K4eauXT1MHqZr3GHqujSNXQ2dFKXV3f8LMFeENNMuf6IsvUs16vw9pTI92pFd+tT3ZW1xOwO7JCwbyvatb+TTHWIGN5vlH/gnQ+vu1A5OJWmAKwU3WXvHo6KUoGYaL49a/pxWG1lVqMDVi2G/EQJESaYOD+JDTLZHq50t6y0pEJVsfoJjkSwz6qkZlFLqJiURoKmiyhV6bJ82TJBYXYL0XNY5wN5rPo9Z7umvWJJIJCEh4PYxcM87JnydXlQRiaX5YYgCWYInQqyKbsu1SHO5MelyrS3AZ7KrSXWm35nbpZ0rGretVKsXUoI4GKCHNRgzJC8kfPQ7iX9HbFXw3s5RO+5JTYxowdB1wk7KxGo0I/bAu6CCQX/epKUYnRcohBNbXft5ROhFZGCGz X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch02.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230022)(4636009)(396003)(136003)(346002)(376002)(39860400002)(451199015)(40470700004)(46966006)(9786002)(31686004)(2906002)(44832011)(5660300002)(8936002)(41300700001)(70206006)(36756003)(498600001)(316002)(86362001)(31696002)(40480700001)(82740400003)(4326008)(8676002)(26005)(82310400005)(110136005)(53546011)(2616005)(54906003)(70586007)(7636003)(40460700003)(356005)(336012)(47076005)(83380400001)(35950700001)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:35:41.5931 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5e91d225-3b98-422c-6e3a-08daa565b1ac X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT045.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR02MB8892 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 9/22/2022 8:41 AM, 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 <...> > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index de9e970d4d..930b0a2fff 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -1848,6 +1848,19 @@ enum rte_eth_representor_type { > RTE_ETH_REPRESENTOR_PF, /**< representor of Physical Function. */ > }; > > +/** > + * Ethernet device error handling mode. Needs to be experimental, if decides to keep. > + */ > +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, Hi Chengwen, Is the intention of 'PASSIVE' / 'PROACTIVE' mode to let application decide which event to register? Like some kind of capability? If mode == RTE_ETH_ERROR_HANDLE_MODE_PASSIVE register RTE_ETH_EVENT_INTR_RESET if mode == RTE_ETH_ERROR_HANDLE_MODE_PROACTIVE register ERR_RECOVERING | RECOVERY_SUCCESS | RECOVERY_FAILED Can't a PMD support both? Or is application really needs to know this, what happens if it register all events and implements related actions for it? > +}; > + > /** > * A structure used to retrieve the contextual information of > * an Ethernet device, such as the controlling driver of the > @@ -1908,8 +1921,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; > I guess 'uint8_t' is used to save space, but 'enum' is mostly integer (although as far as I remember compiler can select smaller type is cases fit it), so I concern if it case any warning. If not agree to use smaller type, since we know possible number of handler type is limited and small. > - 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 */ > void *reserved_ptrs[2]; /**< Reserved for future fields */ > }; >