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 25B2B432C6; Tue, 7 Nov 2023 13:18:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59BF940A7F; Tue, 7 Nov 2023 13:18:19 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 0A5054003C; Tue, 7 Nov 2023 13:18:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699359497; x=1730895497; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=rDLqYcpdagZ5PjmqYtPaVKk5YxCHam9VbVSF2VQjr4Y=; b=l5bxTg8MmdHFKkMfu5a1n2iAV4ecJQeFRxwCDDAIKs4PLGUk3GU/8oO+ U63aC0GNeGH5a3MIGoxR9fAY8Dn1xhok5b+bT7ZoxOZj2+Cf/n3KazYAx BRoPzeWxxjIWULQR/TQBJNPRc3Ahf+M+WR9UqZDPK7jlr5NpzoyZpKA34 /RzIcdfO+aGVqCm6RvlXnvCysur+SmzrQApRv3+J8Jaw0SgOmuhtBwfMe YRdfS5IBytp+HNGMLkClfeh2qvvoUm+sdWGuxkKjOk/uydUZPVQ/7WZaq nYl8awQ9nYYdZ2/UVQ6MrT2xvmQB3zsGDptl4022f53s75cmLyToecyOU Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="393393178" X-IronPort-AV: E=Sophos;i="6.03,283,1694761200"; d="scan'208";a="393393178" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2023 04:18:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,283,1694761200"; d="scan'208";a="3976271" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 07 Nov 2023 04:18:15 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 7 Nov 2023 04:18:14 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Tue, 7 Nov 2023 04:18:14 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Tue, 7 Nov 2023 04:18:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SDA49uzoevbg2aTjSQqcNpdwpNFnCDLhTnoX3dINpsz6bah69rWwOG3aipuahvXJt2adPrCkDw4qTvh3FxYBmvH4eGPsk/+mrEJiJtc4NPxuO4EkgM1q6q6pzx8nMAyy2p2rMNwMnc6xjVzvZFSlOw2zHY5i4jqck9ycoKF15+3o79gI5lGRuSzPZtFZF5mpsAfashhYSl6V2Ug3aa7D/TI5IoicaYMz25FlkRg8DlFqpCCmm0JDDx/vWqFxqwvirOl+N7tlTU5/yUVllLlLa6S2D+9FbVa7lsOm1gqX3p0NuFAAHOJzTR2MHzuWjhlQ9IbQ4kb4expCgFedNHis1Q== 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=HVZzGr+yv0S4EZIUQs09VLmotmWjYS12c/0+H+U/pEw=; b=QxUUhf1YCDF3PCjV1+tiNRGliLaA1HZ8wdKAG1IkdEktedndRL92B0o8Ugu2lX3deagKEPe5i5m9mAf1lpqZktJ3hDhQ4HLaGEZOvCftuD8LeuUSEivWFtQgx5P6U8zQPAZpK/x+7rRPMpwu/dWje1g2cgf7Fph515+pLLqnvDQr7dRY/61d5EuUCg7PLVAtJOCBjxeoGZQ7TYxQi6lr+gCseAV+rqNxpN11EzzI904gymqwrQLXq1WJw6bXacwAKWcfDKXjp5J3sfuVNE13T4Wqii6i/dAw1ogjUmxacUCIEt2egnPw/f1Cu9YOT0q2PspfqXHGdOEuCw2FwssvBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM4PR11MB5994.namprd11.prod.outlook.com (2603:10b6:8:5d::20) by IA0PR11MB8304.namprd11.prod.outlook.com (2603:10b6:208:48b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.27; Tue, 7 Nov 2023 12:18:12 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::62e2:b53a:6a07:f136]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::62e2:b53a:6a07:f136%6]) with mapi id 15.20.6954.024; Tue, 7 Nov 2023 12:18:12 +0000 From: "Zhang, Qi Z" To: "Ye, MingjinX" , "dev@dpdk.org" CC: "Yang, Qiming" , "stable@dpdk.org" Subject: RE: [PATCH v6] net/ice: fix crash on closing representor ports Thread-Topic: [PATCH v6] net/ice: fix crash on closing representor ports Thread-Index: AQHaEWRKFxVFsRC57UyOz440NsKA47Buwqqw Date: Tue, 7 Nov 2023 12:18:11 +0000 Message-ID: References: <20231106100001.40213-1-mingjinx.ye@intel.com> <20231107101223.225726-1-mingjinx.ye@intel.com> In-Reply-To: <20231107101223.225726-1-mingjinx.ye@intel.com> Accept-Language: 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=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB5994:EE_|IA0PR11MB8304:EE_ x-ms-office365-filtering-correlation-id: a4642601-0cda-4aeb-b000-08dbdf8b9c5f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Mkoe4XsnmVhKI5zYi2EcnwiJueoPDbRPArX3Q2uWsgc44bALsAfW/BoxNSnMJKgut1fgIFy+ei+oRIx9x68fMauhwqcXI4RfpQyhBC5Uaxe/XczU/qC39PZ92HRY1tcoyv45l5ItX3gkqIPwx1OZqpOG6k4TCbbDUUX+M1A3X0UC+9A6I2msKuiyYDWBA5v6+pJlsomAO7niUBGAi8IzYhHoYCoSH+85AohNzkuCjIvGYEXYbt98FAaRksIWqoFEBqzWzl0ocnKdsMPPvZzOp/zZF+ZH650ffTvLGl8n02IY93SUcHcGCTGboCkejGfytCu3DHl+NMKGJWebpK+MdpxVYoIa8xOqHVq7mDc1SFKazo1EKTxtQ/YEfXUkF4AVSYmt2La3V3NEgbQsGf0ZuuPtl8GnvcNJRHu8SwJgpnfDzK5JoxhsXQ61DbEy3A4ooJzzNsz8SFQBqcGWuRKvH+tV6LRhIFtjS4F/pRphm1Vb6YN7N/X5Nu4zXO0ZEYe3p+D5or7SCvnLIaZY4/7cpm2YnJ4O5xgBcQE5jFdO8iA3s+MY3WiyhXZoG7mxCd7WTeKFoNlln8n6ybVA3MR7Vrwmzw6n8ky/e9rNVBjIxcHJPKkfJ2VFaQP68VD7t0zj x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5994.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(396003)(39860400002)(376002)(346002)(366004)(230922051799003)(186009)(64100799003)(1800799009)(451199024)(6506007)(86362001)(7696005)(53546011)(8936002)(8676002)(52536014)(478600001)(4326008)(55016003)(71200400001)(450100002)(5660300002)(9686003)(66476007)(54906003)(64756008)(66446008)(33656002)(110136005)(66556008)(66946007)(316002)(76116006)(38100700002)(2906002)(26005)(83380400001)(41300700001)(82960400001)(38070700009)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?064sry+qcQxR4ClDjDy5CLdy3NBqurD4HNEN4XD80GMdQPlmE4EyrojzUhqH?= =?us-ascii?Q?wykZTZSHsWP1dwiXo0/g5d5ow3AuBsdhOv0m/Mo+CNSZKS2zccRmYnVynnPG?= =?us-ascii?Q?2cpZieaie2nIHjHeIolkKcBMZTgw7O17D5SZQScezGMfdtFkxn66JTpbq99G?= =?us-ascii?Q?IrrzRi1ooT4Ud4N8v6sFyMXafSoEtDAJyC+uhbPVq76nybQVjgtEehsp/QNC?= =?us-ascii?Q?7NbcGh+2dNi5Q30BNT8FgVEw+ri3A/Lu8d3MjhA6lgjQSqJrfRpUA5HBnxCE?= =?us-ascii?Q?NlOqyqw6ZpJiJcesoMnvbUWK76EwiVDJd3MRX1nXM8EAvMzzE3ULyoQL6y5a?= =?us-ascii?Q?QLXmVjtD7u+oRWx4D+dOmXumAEcf9MEXruMfyb8z7nAxCc5ppx+2AhCbTZpo?= =?us-ascii?Q?yFY7ihVMpNyzwgfFJPy58qDL1V+qtxPGVMDBH6PSmDGFPQkCZ9fEGkKGopSL?= =?us-ascii?Q?+W0a+NTbkGdtUCdbTnSsTfPV7GhXp8Vf5li9G6c1WAXjwY+t88L7Gt+BCiob?= =?us-ascii?Q?ltFs0aJoChBi2rpK3Sxiuq6bLYctV0upOwp7YAOoVVesYBaqTorlxlJu4OYs?= =?us-ascii?Q?E9BOV9oERs1mqf6b8twdnpS/ebrSV6iu0UG4S/MwaHGVL9dJRu1HRqNM1fxj?= =?us-ascii?Q?X2kIZ5quYAvk/Z5wMWrOlxIyMFtlSv2qdqidIHKQ35qMVxru4Q4dbXWdOp2s?= =?us-ascii?Q?5L3jCn7FG33x5O/yyokfiHcUk/X2UM8bjHEwh8tKNwxTEbuaa0fa/lZZXW3Y?= =?us-ascii?Q?Qgw4Zm1xYxh+orOHwDJNw0x9w7ddPrO0oq1ovCf9WU1ryN9hmsC10z7MFR/p?= =?us-ascii?Q?H4rpqyopchBNNEQQirOzfBOR83bsapUwWLTiwr1rJvOoK9jBykqdyop9ikJB?= =?us-ascii?Q?0TGFrJtJT+c1sbXk9VyEVuvK5Ites0KSPpjiNNAtayyNJNN1TqZSmn1/5AIk?= =?us-ascii?Q?FpY/B14ach126yUqLuFtEpYMFi9GMGvV2WLK3rvltiHmnR9fU70rNOyRz7ql?= =?us-ascii?Q?aWzGOur7mM3pLEYx2rAO6moAICe6C0eGX9Vawa1EkEHXZFLwRlGtQVQ412ZF?= =?us-ascii?Q?tqgg+ydBkTWpnLwctfzICnqUvYQtpVuOCruPnAnc5IKBprHq2jUHeHaUaNg2?= =?us-ascii?Q?facQzw7lSbfZEWWZCDh5iqSip7KYWsIoak6n6rgrktXpEEE1vnK2pnM3Mx9p?= =?us-ascii?Q?/i47lTgu9bo3BLJ6TEN3gKp3VAbN4ToeTNEz4L4jMvzHiZ8ZlkFrqspSKOog?= =?us-ascii?Q?GaWNfeOpceZ1jB4WR23bAuAYyqG5g4RrV+drlpIK4JsMiXkSMLjykEniYDht?= =?us-ascii?Q?6BxUUo8UwljkIc6n+oiLKH5LCIbLF7LBh4fg1jfFlJndEFICZCZkAxgHbbyy?= =?us-ascii?Q?QV7qULVP3E+QBOqT0HsZO6GgxrLKJTGYWprfN8ZhNUFvC42ML/xMIDNs0Xpb?= =?us-ascii?Q?qFZVWRVt7hlcEA8j3UpZq+u7O95jCCUt68cq9/8f9K7Wm+lgfdbQrn4C9kOr?= =?us-ascii?Q?ejqsKzWyvwoMA7siDdNqROsKsFSJbDxjIN0Skk326uF4ytISior+HC0z6uMg?= =?us-ascii?Q?gYBmVqH5z1WqeFVg2Algc6WQAxEkq7Kbeg7tg/xs?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5994.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4642601-0cda-4aeb-b000-08dbdf8b9c5f X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2023 12:18:11.9823 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dh1F67E7KA/sPrfcGM7GvtqN1oLPZrq84ZlbmZsVNM/0IpM4NveNiAsajVfS/QU1MwT86h9NJ8u0hZeXHNcaYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB8304 X-OriginatorOrg: intel.com 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: Ye, MingjinX > Sent: Tuesday, November 7, 2023 6:12 PM > To: dev@dpdk.org > Cc: Yang, Qiming ; Ye, MingjinX > ; stable@dpdk.org; Zhang, Qi Z > > Subject: [PATCH v6] net/ice: fix crash on closing representor ports >=20 > The data resource in struct rte_eth_dev is cleared and points to NULL whe= n > the DCF port is closed. >=20 > If the DCF representor port is closed after the DCF port is closed, a > segmentation fault occurs because the representor port accesses the data > resource released by the DCF port. >=20 > This patch fixes this issue by synchronizing the state of DCF ports and > representor ports to the peer in real time when their state changes. >=20 > Fixes: da9cdcd1f372 ("net/ice: fix crash on representor port closing") The fixline still not make sense, the issue should be already exist before = above patch. > Cc: stable@dpdk.org >=20 > Signed-off-by: Mingjin Ye > --- > v2: Reformat code to remove unneeded fixlines. > --- > v3: New solution. > --- > v4: Optimize v2 patch. > --- > v5: optimization. > --- > v6: Optimize and resolve conflicts. > --- > drivers/net/ice/ice_dcf_ethdev.c | 30 ++++++++++++-- > drivers/net/ice/ice_dcf_ethdev.h | 3 ++ > drivers/net/ice/ice_dcf_vf_representor.c | 51 ++++++++++++++++++++++-- > 3 files changed, 78 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_e= thdev.c > index 29699c2c32..5d845bba31 100644 > --- a/drivers/net/ice/ice_dcf_ethdev.c > +++ b/drivers/net/ice/ice_dcf_ethdev.c > @@ -1618,6 +1618,26 @@ ice_dcf_free_repr_info(struct ice_dcf_adapter > *dcf_adapter) > } > } >=20 > +int > +ice_dcf_handle_vf_repr_close(struct ice_dcf_adapter *dcf_adapter, > + uint16_t vf_id) > +{ > + struct ice_dcf_repr_info *vf_rep_info; > + > + if (dcf_adapter->num_reprs >=3D vf_id) { > + PMD_DRV_LOG(ERR, "Invalid VF id: %d", vf_id); > + return -1; > + } > + > + if (!dcf_adapter->repr_infos) > + return 0; > + > + vf_rep_info =3D &dcf_adapter->repr_infos[vf_id]; > + vf_rep_info->vf_rep_eth_dev =3D NULL; > + > + return 0; > +} > + > static int > ice_dcf_init_repr_info(struct ice_dcf_adapter *dcf_adapter) { @@ -1641,= 11 > +1661,10 @@ ice_dcf_dev_close(struct rte_eth_dev *dev) > if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) > return 0; >=20 > + ice_dcf_vf_repr_notify_all(adapter, false); > (void)ice_dcf_dev_stop(dev); >=20 > ice_free_queues(dev); > - > - ice_dcf_free_repr_info(adapter); > ice_dcf_uninit_parent_adapter(dev); > ice_dcf_uninit_hw(dev, &adapter->real_hw); >=20 > @@ -1835,7 +1854,7 @@ ice_dcf_dev_reset(struct rte_eth_dev *dev) > ice_dcf_reset_hw(dev, hw); > } >=20 > - ret =3D ice_dcf_dev_uninit(dev); > + ret =3D ice_dcf_dev_close(dev); > if (ret) > return ret; >=20 > @@ -1940,12 +1959,17 @@ ice_dcf_dev_init(struct rte_eth_dev *eth_dev) > ice_dcf_stats_reset(eth_dev); >=20 > dcf_config_promisc(adapter, false, false); > + ice_dcf_vf_repr_notify_all(adapter, true); > + > return 0; > } >=20 > static int > ice_dcf_dev_uninit(struct rte_eth_dev *eth_dev) { > + struct ice_dcf_adapter *adapter =3D eth_dev->data->dev_private; > + > + ice_dcf_free_repr_info(adapter); > ice_dcf_dev_close(eth_dev); >=20 > return 0; > diff --git a/drivers/net/ice/ice_dcf_ethdev.h > b/drivers/net/ice/ice_dcf_ethdev.h > index 4baaec4b8b..6dcbaac5eb 100644 > --- a/drivers/net/ice/ice_dcf_ethdev.h > +++ b/drivers/net/ice/ice_dcf_ethdev.h > @@ -60,6 +60,7 @@ struct ice_dcf_vf_repr { > struct rte_ether_addr mac_addr; > uint16_t switch_domain_id; > uint16_t vf_id; > + bool dcf_valid; >=20 > struct ice_dcf_vlan outer_vlan_info; /* DCF always handle outer VLAN > */ }; @@ -80,6 +81,8 @@ int ice_dcf_vf_repr_init(struct rte_eth_dev > *vf_rep_eth_dev, void *init_param); int ice_dcf_vf_repr_uninit(struct > rte_eth_dev *vf_rep_eth_dev); int ice_dcf_vf_repr_init_vlan(struct > rte_eth_dev *vf_rep_eth_dev); void ice_dcf_vf_repr_stop_all(struct > ice_dcf_adapter *dcf_adapter); > +void ice_dcf_vf_repr_notify_all(struct ice_dcf_adapter *dcf_adapter, > +bool valid); int ice_dcf_handle_vf_repr_close(struct ice_dcf_adapter > +*dcf_adapter, uint16_t vf_id); > bool ice_dcf_adminq_need_retry(struct ice_adapter *ad); >=20 > #endif /* _ICE_DCF_ETHDEV_H_ */ > diff --git a/drivers/net/ice/ice_dcf_vf_representor.c > b/drivers/net/ice/ice_dcf_vf_representor.c > index b9fcfc80ad..00dc322b30 100644 > --- a/drivers/net/ice/ice_dcf_vf_representor.c > +++ b/drivers/net/ice/ice_dcf_vf_representor.c > @@ -50,9 +50,30 @@ ice_dcf_vf_repr_dev_stop(struct rte_eth_dev *dev) > return 0; > } >=20 > +static int > +ice_dcf_vf_repr_set_dcf_valid(struct rte_eth_dev *dev, bool valid) { > + struct ice_dcf_vf_repr *repr =3D dev->data->dev_private; > + > + repr->dcf_valid =3D valid; > + > + return 0; > +} > + > static int > ice_dcf_vf_repr_dev_close(struct rte_eth_dev *dev) { > + struct ice_dcf_vf_repr *repr =3D dev->data->dev_private; > + struct ice_dcf_adapter *dcf_adapter; > + int err; > + > + if (repr->dcf_valid) { > + dcf_adapter =3D repr->dcf_eth_dev->data->dev_private; > + err =3D ice_dcf_handle_vf_repr_close(dcf_adapter, repr->vf_id); > + if (err) > + PMD_DRV_LOG(ERR, "VF representor invalid"); > + } > + > return ice_dcf_vf_repr_uninit(dev); > } >=20 > @@ -111,14 +132,15 @@ ice_dcf_vf_repr_link_update(__rte_unused struct > rte_eth_dev *ethdev, static __rte_always_inline struct ice_dcf_hw * > ice_dcf_vf_repr_hw(struct ice_dcf_vf_repr *repr) { > - struct ice_dcf_adapter *dcf_adapter =3D > - repr->dcf_eth_dev->data->dev_private; > + struct ice_dcf_adapter *dcf_adapter; >=20 > - if (!dcf_adapter) { > + if (!repr->dcf_valid) { > PMD_DRV_LOG(ERR, "DCF for VF representor has been > released\n"); > return NULL; > } >=20 > + dcf_adapter =3D repr->dcf_eth_dev->data->dev_private; > + > return &dcf_adapter->real_hw; > } >=20 > @@ -414,6 +436,7 @@ ice_dcf_vf_repr_init(struct rte_eth_dev > *vf_rep_eth_dev, void *init_param) > repr->dcf_eth_dev =3D param->dcf_eth_dev; > repr->switch_domain_id =3D param->switch_domain_id; > repr->vf_id =3D param->vf_id; > + repr->dcf_valid =3D true; > repr->outer_vlan_info.port_vlan_ena =3D false; > repr->outer_vlan_info.stripping_ena =3D false; > repr->outer_vlan_info.tpid =3D RTE_ETHER_TYPE_VLAN; @@ -488,3 > +511,25 @@ ice_dcf_vf_repr_stop_all(struct ice_dcf_adapter *dcf_adapter) > vf_rep_eth_dev->data->dev_started =3D 0; > } > } > + > +void > +ice_dcf_vf_repr_notify_all(struct ice_dcf_adapter *dcf_adapter, bool > +valid) { > + uint16_t vf_id; > + int err; > + struct rte_eth_dev *vf_rep_eth_dev; > + > + if (!dcf_adapter->repr_infos) > + return; > + > + for (vf_id =3D 0; vf_id < dcf_adapter->real_hw.num_vfs; vf_id++) { > + vf_rep_eth_dev =3D dcf_adapter- > >repr_infos[vf_id].vf_rep_eth_dev; > + > + if (!vf_rep_eth_dev) > + continue; > + > + err =3D ice_dcf_vf_repr_set_dcf_valid(vf_rep_eth_dev, valid); Better to rename ice_dcf_vf_repr_set_dcf_valid to ice_dcf_vf_repr_notify_o= ne make it more readable in ice_dcf_vf_repr_notify_all And it's not necessary to check the return value, it's a internal function= not an API, you can add it when it is necessary. > + if (err) > + PMD_DRV_LOG(ERR, "Failed to notify VF > representor: %d", vf_id); > + } > +} > -- > 2.25.1