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 DF2B543295; Mon, 6 Nov 2023 13:05:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6502A402AE; Mon, 6 Nov 2023 13:05:43 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id A6337402AA; Mon, 6 Nov 2023 13:05:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699272341; x=1730808341; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=auNsx16jO9PNBNrZ8CZFhNlw6wSoHRcE9CKgOdex8Qs=; b=QuA+RdzV50nv6pR5jz9RToZWedmlbuhgIyt8GW+/Hv5om5OfEqmWUA9T 1Hi2nwgBvkoXx4+ZWUUgHNMk+u+6ELvm+d371VhME1J7ingzDjIEeyw2t ezIZQfP4FBqtWxcyXfoCwJzyeeb7sTWokMluU+Sqrs2VDrB9OIyjCaHv2 KW+OD9t8Yqz4v9j+bx9sFSvQ/e+CUjXdhPVbsZQHaAOxun6pOQpoFXEK0 jSDVx/9FZoOisN3M56NBw0c3INKorpo3eb3CLT8XrMGfH5tgd9tzkrBL7 GD+v/2KzgKDJeOcOD8R5hfmb1KOzizLLW4x2kWG6o15dLmDHdKX/fJvEh A==; X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="368596162" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="368596162" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 04:05:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="832700030" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="832700030" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 06 Nov 2023 04:05:38 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 6 Nov 2023 04:05:38 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 6 Nov 2023 04:05:38 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Mon, 6 Nov 2023 04:05:38 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Mon, 6 Nov 2023 04:05:37 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g+f+v7OiO/Kxg3jpylOfgC1Nv8MhYf9mgtPqF6NOVEfEklwRkCtNmOYGrPtZBynYNtg/eVDn1i18GPD/egWoMvz7lLGyYEmFd/xNljFIRCgL3kD9/foC8g5mBmANDPYUezPVXhSrsnF4U/BfuSbMjHiXk3bIS6K4Jklggj88NtdCIxunoZFkvYwU8N8WyPpkJglnpNQs3dL185bavdLmYOk4ja17SMYe5PSJm7o3Ybn/cuxLbjR+HmVhd+y1uF6Ap0mXUua2JSlgIRWXjHwo2x+4ZX056TTrQ+8vBrhfNDiBLLdAJh9KNIBX0g0cx+98hpt+moP6JTCPTIR0QMujJQ== 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=3tTfCJTO/YP6Tge5QR0l7QduxC+NE1PiHlP0qSijwvI=; b=mkSM0r6XJ1+8GMP1OQpaSqobb3+sWhCejjWxEU4rI+8JPkvt/Mfocq48aAtjde/DbIF+JmcuLspYikDii5gmUNjALl5c97TqLLCatudpQWO96duAbWhu3b3vpLsjhcyNktDYuqWyuZNak+6dzXg6StNpfCXLkYV7dO3bc7h2M26r/42Mi/caXr8pqqnucr1yRRguexEYYF9Dxo/ylxX2Yu64wH/Wsz3+LcKM/fAQBKFgfpBnKBD5HLtcNVTNgeUmFATsRrCEDgclBPNpDueFuzJarZ9Q0q8YpXibIJmci8Hdk4hBzVvdMQEWWWufJcbOlcF+JTPplC03Yt2l36K9pw== 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 SJ0PR11MB4973.namprd11.prod.outlook.com (2603:10b6:a03:2de::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Mon, 6 Nov 2023 12:05:36 +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; Mon, 6 Nov 2023 12:05:35 +0000 From: "Zhang, Qi Z" To: "Ye, MingjinX" , "dev@dpdk.org" CC: "Yang, Qiming" , "Zhou, YidingX" , "stable@dpdk.org" Subject: RE: [PATCH v5] net/ice: fix crash on closing representor ports Thread-Topic: [PATCH v5] net/ice: fix crash on closing representor ports Thread-Index: AQHaEJlmSfQDsTaUyUqN49NjKJH+17BtLXEg Date: Mon, 6 Nov 2023 12:05:35 +0000 Message-ID: References: <20231102101103.3707173-1-mingjinx.ye@intel.com> <20231106100001.40213-1-mingjinx.ye@intel.com> In-Reply-To: <20231106100001.40213-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_|SJ0PR11MB4973:EE_ x-ms-office365-filtering-correlation-id: 5f17feb2-0a1d-4064-20b6-08dbdec0af4e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VavB+0pObvKd+PHGCcS2APMFmS+CLP2LUVc5t0tvc0+poDA3HGlaAu+fqIzanUzf6P8zcVXwz9kJ4dWqpX99zs0GAfKNq1PpAOUnmeJkR+A6AmytstwRVS8MjW5e0NuiOZ8A349wfu21OQ0rS4R7xI22TlVsLUmJgp5QGmtcfDYN0kdlfHzwv4pgO2p9hFxzIdUK1pn7crd2Hr2X6RkqCGIX+IJ7lbwCzK1n0zoQhqv1X81V6aNd8jCuXCF45DJ6hY7D8c3lVt6fyyhAVzaKhTMazrfJgDI0szJTQlbwwtVeDhNEjbBpVeQPzmxEr1OrIb+pDAZXhdqYw1iy0naCrXEEOyMoBqwJwbCFquy7nEc2UieAHfLu2lmpB+OAIZyBgBAb2mzhgj/att1CYgV7c0URHe3brt42Ddt982dVXHMupQlCzsJvYDN5jQT+I+iVpUbRcTQqTKMK+P6QlLEBfw6y5LW2uBqFk1qw09xrkMLdaB7iR9S5ckGabGWLhte/yc4Y5N0pgj4WlEXRTz1vUjBg9VGpdClsJnOb3JjrQug4g9h1ll13/STQnAtW28/7G5Sb6aGrxYcRRI0DctVZo4UtDIRoz6aOPF9Nz2Eh9C5MlwmrLNuYNM9BE2VWgjEo 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)(39860400002)(346002)(376002)(136003)(396003)(366004)(230922051799003)(186009)(451199024)(64100799003)(1800799009)(2906002)(33656002)(41300700001)(64756008)(66446008)(478600001)(316002)(66476007)(66556008)(7696005)(450100002)(38100700002)(8936002)(8676002)(110136005)(54906003)(52536014)(4326008)(76116006)(55016003)(66946007)(86362001)(5660300002)(38070700009)(83380400001)(122000001)(53546011)(82960400001)(6506007)(71200400001)(26005)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xN5IMT70lGcOIneQx8TXJoB9uEebVoYHIdMfhH7T2wTje2Sgf+PqFlvpaASs?= =?us-ascii?Q?yFLMIlw7ChC6gJrYU50B8W/zfPh02f5De8arQKQt8f+bcjpbGGPJ5t1Nm8bq?= =?us-ascii?Q?GD2ZRLRi7Ludkn6RE3o7WCP6PWvgUG+jEbM4A24ElunafZytTEhdL/9dhDfS?= =?us-ascii?Q?GSbPtC9FvyE6kunjNDO41Zx/8wPb9r4Q0vfMkch59rZfc75osTG9gAL5Dur3?= =?us-ascii?Q?unUm0Ynfwq5CQAy1S9FAhsREFbeDBwmdMynkciRhB0W2kYyxucY2lycqp5hJ?= =?us-ascii?Q?ybroWc70f8V5VEykYo9NpRm25L0MzGe/A0C39XHHRnAG4/dCytZF2m3P5DZa?= =?us-ascii?Q?y6MKzBeIHNrgw/imIssSLr+d23vws3e/6xClSCuekZ8i6PAHMpNkf36iy71l?= =?us-ascii?Q?um4l3t8IHG2bccTWeDrKlCQu4dR3+UBSy7rWHf0JKN7SZ7tbReJq3H+iLoVX?= =?us-ascii?Q?onKXuuodjGqEAsy2BE0JpauLosaEjk+VqMiG0GoISfKfgKRv+ENbwHch7y4b?= =?us-ascii?Q?MCFsOY2njyDsS4LdZhdDkG7xy+kg7eVTsJlubfmh/jtNLtkVKjxUDykaGcv3?= =?us-ascii?Q?A7KVtmz6MbP+rMOkWQ74JaZVE8ybBYcfR7SbWnuXjVXdi4tYix6iNgkFIqvx?= =?us-ascii?Q?/1gjPtvv9B9Bk45hDLoHFtAI6+rUcqExLBgbeWm4alGM59bEydAmrSqOouG9?= =?us-ascii?Q?ONMzdpD3/xtIo+xhfIyecb3wvOi+ytJ0DU9ah30FjbLfpT/OM1OhZTLs8LCH?= =?us-ascii?Q?ARU0D/kbSuF8/P6bBuBUk+qlxaqwIG1Zxs+HYBCW2ZffLqpg9VMWNX4cZVs2?= =?us-ascii?Q?ccz6jtaEj1UDHWmNVZyDgu/9sT9+jYfgpGMJi9y0xQDe/9VWB6IKKXJrbYj3?= =?us-ascii?Q?AjK7WO+rCV5YJjmwrKSPXnMOhTjBJchfmwhpbwS6n95tEvUq5efjL5EXFoYX?= =?us-ascii?Q?8Gomee0wcFhwSOROW+WY/3Ps9tyxyYIxdCax1KqcIkTIhCcTurqaTBGjvaKS?= =?us-ascii?Q?NGIWD4D/sAlZOvtHW2aHCioG/V6KFYq7lumZrQL4jhDy2SPsCepeUaIM41BP?= =?us-ascii?Q?0ZQMw0T1BhpbdBchworVGJb1I6/Cefuw9vi2sOLIROdwEdTfP45eFbXyQxZw?= =?us-ascii?Q?1p2A9OEHekUuE9ytSsvh9VA/bvz8/n8MoTBNo5UhBHt3f0q0+0veYcBYHRNx?= =?us-ascii?Q?aXNYH3wDk9Spf+lutuF6WEHLuv3KE3/J6+9wos/6BSpxxA7f7kDKvFfU/tSH?= =?us-ascii?Q?A+tnfEmpji++nfp+RllH3CbzfNFe6T8s1oIT4z18Xjww0rioQxZkwKUX9Bqm?= =?us-ascii?Q?QuVm9jLlSSnWocj+kqbpcvmpa87rEyzu/kYlM1ycLvy8WVlJ/n3gGtSzJkVp?= =?us-ascii?Q?XlV9TY0cBeo76O2BqGteCi2S6m5jOoj6Xfx2LieyNAmP7okfs10SlCtQ4abA?= =?us-ascii?Q?ejlXFXHBL2HeLafRUDhtRSWTYILZdWPCACmst6IC2H9VAdFQdnHKjwLsZ+XP?= =?us-ascii?Q?Z3CadyQj+/IVmIK2k4EZWsyIIxnMXu90Or984xUWNSoU9en12kUgDqmqRfYf?= =?us-ascii?Q?GmGTr0nVCeIu02wmbK3DqSi3nPRkTIfvfFuBR2Im?= 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: 5f17feb2-0a1d-4064-20b6-08dbdec0af4e X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2023 12:05:35.8831 (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: d2jJvrocDod6xcocr4S8fkjwR8aK7V4OvAevlV2G9AAnbrFzkkLAsVLBIYj0UXUzS+jw0Urb8mcpsYWDuu/irA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4973 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: Monday, November 6, 2023 6:00 PM > To: dev@dpdk.org > Cc: Yang, Qiming ; Zhou, YidingX > ; Ye, MingjinX ; > stable@dpdk.org; Zhang, Qi Z > Subject: [PATCH v5] 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: 5674465a32c8 ("net/ice: add DCF VLAN handling") > Fixes: da9cdcd1f372 ("net/ice: fix crash on representor port closing") > Fixes: 7564d5509611 ("net/ice: add DCF hardware initialization") > Fixes: c7e1a1a3bfeb ("net/ice: refactor DCF VLAN handling") > Fixes: 1a86f4dbdf42 ("net/ice: support DCF device reset") These fixlines does not make sense to me, I believe the issue comes from wh= en we enabled port representor for DCF,=20 A patch expose the issue does not imply it cause the issue. > 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. > --- > drivers/net/ice/ice_dcf_ethdev.c | 30 ++++++++++++-- > drivers/net/ice/ice_dcf_ethdev.h | 3 ++ > drivers/net/ice/ice_dcf_vf_representor.c | 50 ++++++++++++++++++++++-- > 3 files changed, 77 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_e= thdev.c > index 065ec728c2..eea24ee3a9 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 > @@ -1938,12 +1957,17 @@ ice_dcf_dev_init(struct rte_eth_dev *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..6c342798ac 100644 > --- a/drivers/net/ice/ice_dcf_vf_representor.c > +++ b/drivers/net/ice/ice_dcf_vf_representor.c > @@ -50,9 +50,32 @@ ice_dcf_vf_repr_dev_stop(struct rte_eth_dev *dev) > return 0; > } >=20 > +static bool This function return Boolean, but it never be checked. > +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; > + > + if (!repr) > + return false; Is this check necessary? If repr =3D null, means the representor port alrea= dy be closed, the function will not be called for that port. > + > + repr->dcf_valid =3D valid; > + > + return true; > +} > + > 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; > + > + if (repr->dcf_valid) { > + dcf_adapter =3D repr->dcf_eth_dev->data->dev_private; > + ice_dcf_handle_vf_repr_close(dcf_adapter, repr->vf_id); > + /* Commitment to not access DCF port resources */ > + repr->dcf_valid =3D false; This is not necessary, as you already called ice_dcf_handle_vf_repr_close t= o notify dcf. And the repr will be freed in ice_dcf_vf_repr_uninit anyway. > + } > + > return ice_dcf_vf_repr_uninit(dev); > } >=20 > @@ -111,14 +134,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 +438,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 > +513,22 @@ 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; > + 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; > + > + ice_dcf_vf_repr_set_dcf_valid(vf_rep_eth_dev, valid); > + } > +} > -- > 2.25.1