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 7341545B13; Fri, 11 Oct 2024 17:30:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20172402E3; Fri, 11 Oct 2024 17:30:45 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2064.outbound.protection.outlook.com [40.107.96.64]) by mails.dpdk.org (Postfix) with ESMTP id 8E43C4028B for ; Fri, 11 Oct 2024 17:30:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZXrUSRelmMOH1P8WINOxy7KIg4COYYCDO/+xvaEtkEPQ2aYWKGfXrUE/bPEsO9Fhr3BKkTvhy/BcZza0CmkHdo7Aik4Am0cNNh2XtGcjlQ1l3Lq3vYvgpWFEW6rrOyN2J5pZ5QDYT8+pT2FbdckJ74TINauLPrVq/a5LRBW2cqTuuA7WIVscndl0C+BKylSVpdJyiEcjciLFxafVZ0SWzOLuGtpqqUOfbRPnYMPoLjT6/Ylz+Jp13iorwaSnUGiSgbdlQpKy2OUss88TXzzSLXpr5QDXlSHsZidr3GQY9cLjGSw16cloegoFJHrT9grp+91JR8lqj7PeQ89MLMer/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=08bv3dkvoKXe9ktTdWbwnl5nEakRFXGnCOLpgdVnv2g=; b=AGsIX4u7QeQh0BYNIXPeuRfs2VyHhFYd+IWtmJ7sqBPiLcRKrlK4e90OJYjSVPBqGRlI7StyRomSnIM/3gJ0wTKuhZaIVME42XAKvjCn8iECMuHcIKo8vedR3QJafvXUxJP+uPCFOqSxUPKge6y6t39VwEwqs+RVKOvlMrpNiI+pt7awrLHd3/NObjW5osJ2/i6bpngDBfe9hZA/CTNtfz3e02GJnwRz8V0xYgeLMHhHa5RGI23NaJQiHRQK97zXHVTuwOmyz0QuGienIR4x06Ww0o9rURtSB5kEdqPA7qQgwsFdkee/J69MFGzFupjQulObFmej07iG9ZYwzDiCTg== 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=08bv3dkvoKXe9ktTdWbwnl5nEakRFXGnCOLpgdVnv2g=; b=O5VYKcGwAvaHbekSj1H70JSiHVocWWbZ+kaOpIGZwagq2IVNumGWC0maadusX6j21MM7I3tNFVcWkIXVAkR/tU5ksKfJswiS6ng0vmomIlsb2IL+/sSTqBK1eDdGrxvPp/Ix2eCoBzwNA8JzZ0B4hFHlEUGwP5BXiyNbkThZmxGl78COgwqUo65wlIeASyCYeNJ4Swv176L+Yrh0cCzkavJN1Sj4I/fLx8oIDrYoEzZgESKNjU0CB7Jd6Dm+mr0+7NzmaV4RttikWbABTcuXE9d2g22KbvYOv5i7TXSoRxYFCRotjydUmGNiI8OmCb/CJMDEyezlX+kL4VamDk9a5g== Received: from CH3PR12MB8460.namprd12.prod.outlook.com (2603:10b6:610:156::15) by SJ2PR12MB9139.namprd12.prod.outlook.com (2603:10b6:a03:564::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.20; Fri, 11 Oct 2024 15:30:40 +0000 Received: from CH3PR12MB8460.namprd12.prod.outlook.com ([fe80::2e9d:7265:3b84:59b5]) by CH3PR12MB8460.namprd12.prod.outlook.com ([fe80::2e9d:7265:3b84:59b5%7]) with mapi id 15.20.8048.020; Fri, 11 Oct 2024 15:30:40 +0000 From: Dariusz Sosnowski To: Konstantin Ananyev , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Ferruh Yigit , Andrew Rybchenko CC: "dev@dpdk.org" Subject: RE: [PATCH v2 2/4] ethdev: add get restore flags driver callback Thread-Topic: [PATCH v2 2/4] ethdev: add get restore flags driver callback Thread-Index: AQHbG8DSo3RPNv89gEiy3vKfweTQzrKBgdOAgAAktpA= Date: Fri, 11 Oct 2024 15:30:39 +0000 Message-ID: References: <20241011092103.181145-1-dsosnowski@nvidia.com> <20241011093351.187191-1-dsosnowski@nvidia.com> <20241011093351.187191-3-dsosnowski@nvidia.com> <36888a4e9c074e06a822ca84a2eda09b@huawei.com> In-Reply-To: <36888a4e9c074e06a822ca84a2eda09b@huawei.com> Accept-Language: en-US Content-Language: en-US X-Mentions: ferruh.yigit@amd.com 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: CH3PR12MB8460:EE_|SJ2PR12MB9139:EE_ x-ms-office365-filtering-correlation-id: 9a676136-19d2-488d-dd17-08dcea09a976 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; ARA:13230040|376014|366016|1800799024|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?y8sEx61qJ6Kl1/Ithod9HKKx8lgstr3QNayajIe7muwep9NF9lXH619IlqlG?= =?us-ascii?Q?gC2hO8UTKMWK9JIMUk3AInhW5ofcMVyR7HnNLls9AqNZ56FTSkf1BKtS0mZt?= =?us-ascii?Q?XuCX4zeG2BkW5fTD5pqlkPgfNYC+LHgIKxnVdRLadkYQ9h5k5709thzfOMzP?= =?us-ascii?Q?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Ri?= =?us-ascii?Q?SbIxSupsOyj19vBJYp6va1Ag0/4pPMJJizmMCiO7as5qpnvyzrGgPLpBXH56?= =?us-ascii?Q?Yt4uqsaComNxJxzw4DVpBtOgt8OKVd6GjS73s17Bg97sxKAxxd6RKewXiThr?= =?us-ascii?Q?ar9HvKGrbZ3wsWRNBmkEm/ABt91gtxpXwY4JF/MfJbKUcUdW4bF8I/UR5idu?= =?us-ascii?Q?AN/GD9j2f5FJX+sTBbm2VKKKgNhsEZFU25kO/j3tY7yYd6JPYnxw8KqJxQ6h?= =?us-ascii?Q?tFx/W3I4lR9NFHNQ8l0OmYhyOuhaGV6uco/LKqyxVioO+w=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH3PR12MB8460.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fvos/+ukDFq5JGiHPnM1C4YfxvnX/JYoL8DDUKYwHvHmZEHUxH0VUivtqX0p?= =?us-ascii?Q?H5ovvOIoZBTyK+FMxbMOB9QTVF1FGri+7R15AHegr+QQKk/kjtnPXQZTmgQW?= =?us-ascii?Q?GtJ+W4kZRXwaovb8zIP7mzcInY8l/LV8giZxpXC7EyPIQ41Pdv1nddE2BIiZ?= =?us-ascii?Q?Gg+B+g2VBdvxl6zBb12OdJA1aiAz/GUzyXMXKCSRSh/lbVAoqsxSZTde8uK3?= =?us-ascii?Q?LuXjxVIOIJt4OTCufJzTpWYLRcw5GeqWTwvDQ3EYL4oIKiiab05tOWMESdb7?= =?us-ascii?Q?4XnyZFQrNZ6/5k2jeYUozvbN4ZBwWFESqSOGDueD3WGYe5xPXZFLT1133ycz?= =?us-ascii?Q?+j+VV9v4kUGoF3/urHieEQdmA+LVBkER/20IMhV10KhX2X+Cg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XO8nA6Pb6bZGTC0UL0PDDVztCIUMhG?= =?us-ascii?Q?Sc2IZCpHMCJaO7n9wb71Z8TeST4U4SoKZHJWvmDOM14+sVIfC+WLUZ1nQYs/?= =?us-ascii?Q?c4dtD5EbR6ezHyHOGJAQLj+edLQefIIwBe/IvDLp8+vumPLui2zep2K/K3lb?= =?us-ascii?Q?Gjq6YiKFGU81Kn1ELi3Wlya5wCgxaJV2zB0i1UqXZvO0QviBZrFiMHsVzOto?= =?us-ascii?Q?7T++zezNZB44p8tHovp2yxdUjDc9IODWr2ADcR79O+dIVINFB3N3LjyB/NRw?= =?us-ascii?Q?v0yXryAxK8icwvwDqVN2m+m04R5vCKQ+/f6Fscmw?= 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: CH3PR12MB8460.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a676136-19d2-488d-dd17-08dcea09a976 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2024 15:30:39.8393 (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: 5VJTIctoppFTVgCGU1uBsZ0Ac6xSAP2LbP9xuebxj1XcWpMStpIp15ExQ9phW9AyR1begjIl1WQR4k1d8pSM/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9139 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 > -----Original Message----- > From: Konstantin Ananyev > Sent: Friday, October 11, 2024 14:54 > To: Dariusz Sosnowski ; NBU-Contact-Thomas > Monjalon (EXTERNAL) ; Ferruh Yigit > ; Andrew Rybchenko > Cc: dev@dpdk.org > Subject: RE: [PATCH v2 2/4] ethdev: add get restore flags driver callback >=20 > External email: Use caution opening links or attachments >=20 >=20 > > Before this patch, ethdev layer assumed that all drivers require that > > it has to forcefully restore: > > > > - MAC addresses > > - promiscuous mode setting > > - all multicast mode setting > > > > upon rte_eth_dev_start(). > > > > This patch introduces a new callback to eth_dev_ops - > > get_restore_flags(). > > Drivers implementing this callback can explicitly enable/disable > > certain parts of config restore procedure. > > > > In order to minimize the changes to all the drivers and preserve the > > current behavior, it is assumed that if this callback is not defined, > > all configuration should be restored. > > > > Signed-off-by: Dariusz Sosnowski >=20 > LGTM, just few nits/suggestions, pls see below. > Series-Acked-by: Konstantin Ananyev >=20 > > --- > > lib/ethdev/ethdev_driver.c | 11 +++++++ lib/ethdev/ethdev_driver.h | > > 64 ++++++++++++++++++++++++++++++++++++++ > > lib/ethdev/version.map | 1 + > > 3 files changed, 76 insertions(+) > > > > diff --git a/lib/ethdev/ethdev_driver.c b/lib/ethdev/ethdev_driver.c > > index c335a25a82..f78f9fb5c1 100644 > > --- a/lib/ethdev/ethdev_driver.c > > +++ b/lib/ethdev/ethdev_driver.c > > @@ -958,3 +958,14 @@ rte_eth_switch_domain_free(uint16_t domain_id) > > > > return 0; > > } > > + > > +void > > +rte_eth_get_restore_flags(struct rte_eth_dev *dev, > > + enum rte_eth_dev_operation op, > > + uint32_t *flags) >=20 > I would go with uint64_t for flags (to avoid limitations in future). +1 > Also, If it is void anyway, might be just return flags? > i.e: > uint64_t +rte_eth_get_restore_flags(struct rte_eth_dev *dev, enum > rte_eth_dev_operation op); +1 >=20 > Another thing - do we need to do update docs? > PMD or PG sections, release notes? IIRC new additions and internal changes in ethdev are not advertised in rel= ease notes. @Ferruh Yigit: Should these changes be documented/announced somewhere? >=20 > > +{ > > + if (dev->dev_ops->get_restore_flags !=3D NULL) > > + dev->dev_ops->get_restore_flags(dev, op, flags); > > + else > > + *flags =3D RTE_ETH_RESTORE_ALL; } > > diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h > > index ae00ead865..8ac5328521 100644 > > --- a/lib/ethdev/ethdev_driver.h > > +++ b/lib/ethdev/ethdev_driver.h > > @@ -1235,6 +1235,47 @@ typedef int (*eth_count_aggr_ports_t)(struct > > rte_eth_dev *dev); typedef int (*eth_map_aggr_tx_affinity_t)(struct > rte_eth_dev *dev, uint16_t tx_queue_id, > > uint8_t affinity); > > > > +/** > > + * @internal > > + * Defines types of operations which can be executed by the applicatio= n. > > + */ > > +enum rte_eth_dev_operation { > > + RTE_ETH_START, > > +}; > > + > > +/**@{@name Restore flags > > + * Flags returned by get_restore_flags() callback. > > + * They indicate to ethdev layer which configuration is required to be= restored. > > + */ > > +/** If set, ethdev layer will forcefully restore default and any > > +other added MAC addresses. */ #define RTE_ETH_RESTORE_MAC_ADDR > > +RTE_BIT32(0) > > +/** If set, ethdev layer will forcefully restore current promiscuous > > +mode setting. */ #define RTE_ETH_RESTORE_PROMISC RTE_BIT32(1) > > +/** If set, ethdev layer will forcefully restore current all > > +multicast mode setting. */ #define RTE_ETH_RESTORE_ALLMULTI > > +RTE_BIT32(2) /**@}*/ > > + > > +/** All configuration which can be restored by ethdev layer. */ > > +#define RTE_ETH_RESTORE_ALL (RTE_ETH_RESTORE_MAC_ADDR | \ > > + RTE_ETH_RESTORE_PROMISC | \ > > + RTE_ETH_RESTORE_ALLMULTI) > > + > > +/** > > + * @internal > > + * Fetch from the driver what kind of configuration must be restored > > +by ethdev layer, > > + * after certain operations are performed by the application (such as > rte_eth_dev_start()). > > + * > > + * @param dev > > + * Port (ethdev) handle. > > + * @param op > > + * Type of operation executed by the application. > > + * @param flags > > + * Flags indicating what configuration must be restored by ethdev la= yer. > > + */ > > +typedef void (*eth_get_restore_flags_t)(struct rte_eth_dev *dev, > > + enum rte_eth_dev_operation op, > > + uint32_t *flags); > > + > > /** > > * @internal A structure containing the functions exported by an Ether= net > driver. > > */ > > @@ -1474,6 +1515,9 @@ struct eth_dev_ops { > > eth_count_aggr_ports_t count_aggr_ports; > > /** Map a Tx queue with an aggregated port of the DPDK port */ > > eth_map_aggr_tx_affinity_t map_aggr_tx_affinity; > > + > > + /** Get configuration which ethdev should restore */ > > + eth_get_restore_flags_t get_restore_flags; > > }; > > > > /** > > @@ -2131,6 +2175,26 @@ struct rte_eth_fdir_conf { > > struct rte_eth_fdir_flex_conf flex_conf; }; > > > > +/** > > + * @internal > > + * Fetch from the driver what kind of configuration must be restored > > +by ethdev layer, > > + * using get_restore_flags() callback. > > + * > > + * If callback is not defined, it is assumed that all supported config= uration must > be restored. > > + * > > + * @param dev > > + * Port (ethdev) handle. > > + * @param op > > + * Type of operation executed by the application. > > + * @param flags > > + * Flags indicating what configuration must be restored by ethdev la= yer. > > + */ > > +__rte_internal >=20 > For new function we probably need 'rte_experimental'... > But from other side - it is internal. > Not sure what are rules here for such case. >=20 > > +void > > +rte_eth_get_restore_flags(struct rte_eth_dev *dev, > > + enum rte_eth_dev_operation op, > > + uint32_t *flags); > > + > > #ifdef __cplusplus > > } > > #endif > > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index > > 1669055ca5..fa0469e602 100644 > > --- a/lib/ethdev/version.map > > +++ b/lib/ethdev/version.map > > @@ -358,4 +358,5 @@ INTERNAL { > > rte_eth_switch_domain_alloc; > > rte_eth_switch_domain_free; > > rte_flow_fp_default_ops; > > + rte_eth_get_restore_flags; > > }; > > -- > > 2.39.5