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 BD0F3A0552; Tue, 6 Dec 2022 04:47:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5DFA640156; Tue, 6 Dec 2022 04:47:55 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2088.outbound.protection.outlook.com [40.107.243.88]) by mails.dpdk.org (Postfix) with ESMTP id 7533740151 for ; Tue, 6 Dec 2022 04:47:53 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z1ZuafnnOGy9/f/eS7FCO8InXIwvzTxL4l6ocYeC81GeagcHb91djhTNU4ay2H4JKOJjI37jfha/fiPxoVYFsrH2+Vq7a0o80RHvsSg7qkhfR9+kXpJqMH+e4ftS93x1kV0OMheMN0MwVvIWmyKyUh/fnnsnT+BNaM+oR0ElooRH+iA5itYPkWqFWFEvflmmpXvJ5pW5F0GYlOfH0u5e5wkg4qdJt52ruEicwhspAJgC+eAgydspZk5dszbKXdsg0YDD9E1A9NALWfI1v8O2q5AnCB9e07xAGTbiMl9lmb94eHp2FEpfBKs3kv/vHUj4prmI4Zl1l4+LCxQtJvG6Uw== 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=+9Bbc0Z8MDTD25ioiBaHRymeKCwJdzgSup4l4AQFyjo=; b=djJSVkXhQ7UenO3njDnr8JFO7KgUxeiGXEvjgD6Byw4CAdfI2Yj3LlIhekBhAvX1VNdAaB9K2ty5kl7dbekswgeESJq43BUBc1MoiTTlLszPMxNvbtCh83Gt299VwBBo3wbwnCmgpc+6BrICNu2FBGIGlXnkj4dIuiaLdkhARzD+CjtLhy8jIGktpKkjIcbfBMw1GH2rY6ggZqam4vC1pwB9ITkaclcCCEjGiDA8C3jF2oD4tcN6KsdOWvTphI2RGEGbD5WdEWNisvJF5CRx4OU1feVFdycLZyqeyqL1P2LCw8/MSHdlD1AFuAyhuymV/pK7Bt6fGIdWltKssu4hGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+9Bbc0Z8MDTD25ioiBaHRymeKCwJdzgSup4l4AQFyjo=; b=rJSfVxIKc8bMFx0s2KN2r5C/ypdM8DXQaX0Oa6i61GSur7OZDxfZkIjrgVfddcDtZmYwYHGA8CzzoL0fjwA1vpKQeur54RrJ0Lum/6aCzTvedHMBlMxwm8ESHO0uuGNANoI/2YBS4sB1EESpGYk4EobQRAuzctgEEDpX4ieavosoDZc0vsZGr/3DbxtiWa2g034R1mLH9FOlirKiTo4sfpoTVEmx93VuqRrCHk3QF9dXI80S6QlcpqTXd3IMKlU4890AubjrBV7J74Ju3doXi78Usw1SXvZyF+LRpp4jAiCBZA3XnX46373r70cBOyyPBB+YReDE+edngJRCdjEOxA== Received: from BN9PR12MB5273.namprd12.prod.outlook.com (2603:10b6:408:11e::22) by CY8PR12MB7610.namprd12.prod.outlook.com (2603:10b6:930:9a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Tue, 6 Dec 2022 03:47:49 +0000 Received: from BN9PR12MB5273.namprd12.prod.outlook.com ([fe80::434f:ddd2:c15c:bf21]) by BN9PR12MB5273.namprd12.prod.outlook.com ([fe80::434f:ddd2:c15c:bf21%7]) with mapi id 15.20.5880.014; Tue, 6 Dec 2022 03:47:42 +0000 From: Rongwei Liu To: Stephen Hemminger CC: Matan Azrad , Slava Ovsiienko , Ori Kam , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Ferruh Yigit , Andrew Rybchenko , "dev@dpdk.org" , Raslan Darawsheh Subject: RE: [RFC 2/2] ethdev: add API to set process to primary or secondary Thread-Topic: [RFC 2/2] ethdev: add API to set process to primary or secondary Thread-Index: AQHZBV3QxRLFAA1PMkalUGQUV2RsBq5ZI0eAgADK4JCABY6cgIAAv6CA Date: Tue, 6 Dec 2022 03:47:42 +0000 Message-ID: References: <20221201082005.732252-1-rongweil@nvidia.com> <20221201082005.732252-3-rongweil@nvidia.com> <20221201071011.1fd30f68@hermes.local> <20221205080801.52030df8@hermes.local> In-Reply-To: <20221205080801.52030df8@hermes.local> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN9PR12MB5273:EE_|CY8PR12MB7610:EE_ x-ms-office365-filtering-correlation-id: fe6d1114-83d8-4368-4f9f-08dad73ca127 x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KCP7eLZubM0oYK1PwS5Wf/mxMr51ytxLFtdN+cvIwey1/iEWuKd5by8+hH6vm9dzyYWtGQkd9sAnfET2naxLU9YXu/3em+xR+whDrgexHx/nvBEzz2be89g+DU3/OAUo8vsefnrzW29BobNLsfH5N2sGh1XOiXaXITmMV3tF+XkwegATULZ+rvO9roeZdexw/EZvIeJVkP63MNZr7fG2u0YFm6eNnwBMtiANIBvhcdO8aCO/gT/6cRCrJbDEBzXL2mskY7Yb9y2d41AF50s0EeMnl4q87PAtJJwdXbgtCP0xU6mtP84hYswc/+0GvYlgGvlbfkVlW9VdnEFl9dt/o21/5XtoHUnN6zrXR0mdAQZUofYYb/8u8ZEyIdfERWaDqgK9hrcN/4ck7v60V03jklpVWyNNChREX5KaspisbjzZMEBWHBvWLUGIaj75vWmPrGYbzR/IXkJEef2c5pwjy3tNLOQLYnBoZiRQOfvZjrhv+5JYN36vMpX0Cr1p9y8s9xLlWBUxpfGbD3LaFQ+GP5NLgs4iHQACPVxSi3hiilcAG5Vr8H64L6/LMbsIeJ9fRaifFGcle34X0wIlZv9dZoJLVFByViTb3GQK4SA1WNMw1ub1GK1DVlmumvE4dablmISMlS+lCTbZWIUWmjjdi+xR7KlYyGtd516YnMHHYOqBTqNUvrDU4a9ap1mqRSzSifDgYzLZsZj+QTZmpH45og== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR12MB5273.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(376002)(396003)(39860400002)(346002)(136003)(366004)(451199015)(83380400001)(122000001)(33656002)(86362001)(5660300002)(38070700005)(8936002)(2906002)(41300700001)(4326008)(8676002)(52536014)(55016003)(26005)(186003)(6506007)(53546011)(478600001)(64756008)(7696005)(9686003)(107886003)(316002)(6916009)(66946007)(66446008)(54906003)(66556008)(66476007)(76116006)(71200400001)(38100700002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?prPxZGIT7M7HQH7MkWiXwfWe1Qj4aGyuvrGqEqKIANqW/jg6p22xSU4lLade?= =?us-ascii?Q?ib+gWlOJAifLuOp2rJFHE4KGMxr9zV5xS5e+ky5MoGTOBgMzLYRImkpTk//h?= =?us-ascii?Q?uNcU/OdHej1AF5juDp5T5pXoAa2GmUhztB5ke1IpIq1t1zmmBd41oZCqZDqW?= =?us-ascii?Q?hT0Y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syOZH?= =?us-ascii?Q?gaiM+0zthXRwsyUaDp3u8kPZoqLpBLcM1Fxk/Sg4pDHXM+WbesPFkozXUehX?= =?us-ascii?Q?H9rRck4T5gbooudboB3+52l9L6maiLaTe08GsSX983Z4npdkbs0OQp3RN6ps?= =?us-ascii?Q?jqHL5SYaEjRDarXkvwWmgZCStBqapZXjj/sLGfXFcj1ujAGODluSNgDHw7su?= =?us-ascii?Q?4TABtlwpO+COP3/MXyOOU32YI9A9Nqm8+CaAHYarPECuqse44UJ2Yh/MzJ0D?= =?us-ascii?Q?ytGWV5KlO/I1CvaPpg06if+0MygIfbWTqPYi3gjhhrkfuLRoLBIAhh1FAef3?= =?us-ascii?Q?j0QV4XZS6ZPrHlYQMZ+GZSgGDB+jSPzTAh0048Zk3Abgh7RaLEwWUGlFVQxh?= =?us-ascii?Q?Qt8BGa7SvmkOlDS22SN8kZMANIzlyoaaiaMfZXb32K10ZgyhiujNKu+z4c3N?= =?us-ascii?Q?1m25QdiMKzb8JRO0MGHvm6+mdyAYMEfwwxkahhn29wSk0dkekEbPROMYP8ZG?= =?us-ascii?Q?2JESeGaYzKXpAPlcDK1lChdp8o5fbqKMZd+fSD4G?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR12MB5273.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe6d1114-83d8-4368-4f9f-08dad73ca127 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Dec 2022 03:47:42.7908 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Ht7NzePKENt09z9A4K6kFSNXDQcz4Cop9npBdv9owZjOYimYhI2M+ZSAS+yHyQ8XPUW4owzI254JsgvpPB7dbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7610 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 Hi BR Rongwei > -----Original Message----- > From: Stephen Hemminger > Sent: Tuesday, December 6, 2022 00:08 > To: Rongwei Liu > Cc: Matan Azrad ; Slava Ovsiienko > ; Ori Kam ; NBU-Contact- > Thomas Monjalon (EXTERNAL) ; Ferruh Yigit > ; Andrew Rybchenko > ; dev@dpdk.org; Raslan Darawsheh > > Subject: Re: [RFC 2/2] ethdev: add API to set process to primary or secon= dary >=20 > External email: Use caution opening links or attachments >=20 >=20 > On Fri, 2 Dec 2022 03:27:38 +0000 > Rongwei Liu wrote: >=20 > > > > > > The state of the devices and the system is really unstable if this > > > fails. There is no rollback here. > > > > > Assume application is calling rte_eth_process_set_primary(false); > > Once failed, call all preceding successful ports as > > rte_eth_process_set_primary(true); > > What do you think? > > > I think this should have a PMD capability flag so that application > > > can check that device supports doing this. And it would have to be > > > opt-in so that existing devices would always fail. > > If device doesn't support it, it can set the ethdev callback to NULL or= return > failure for all devices. > > Then the devices' state will be consistent. >=20 >=20 > Assume there are two DPDK ports. > If the application tries to change roles and one of the devices does not = support > the change over, then that error is fatal. The first device has changed s= tate > already, and the second doesn't allow it. >=20 If my understanding is correct, you are saying one application to probe two= PMD vendors. This is difficult to handle.=20 > This needs to be a capability flag for the device, and would need an addi= tional > flag in the device documentation as well. >=20 For multiple vendors simultaneously probing. Capability flag is a must. But= no need for single vendor, right? > I bet many devices do regular malloc or mmap in the primary process and t= hat > is not going to work with this change. Sorry, looks like I mis-lead you. The words "Primary/Secondary" in this upd= ate have no relationship with current PRIMARY/SECDONARY definition. Doesn't focus on the resource ownership. In this update: Primary application' offload rules are effective immediatel= y. Secondary' rules are in queue which will be effective if primary applica= tion exits or primary application doesn't insert any rule. Maybe we can call it as "active/standby" or "main/standby" or "active/backu= p"? Do you have naming suggestion? =20