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 DA49143258; Wed, 1 Nov 2023 02:11:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C507E40647; Wed, 1 Nov 2023 02:11:44 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 85C94402ED; Wed, 1 Nov 2023 02:11:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698801102; x=1730337102; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Ndhm5WG/PXTpqHKO7e8U0sCOA69vq4iBbW3Pk0GUtuk=; b=iCt2EgyUS4i11ljymOfHizFiT4uF4ALYAKpY8uWGY31GIdFyBxXst3nv zW9to9nrGCzrGgxDiGRpJNG66+thmK0oCEaW+4Ygzmfiy69d3Stv0nrXM pSf6pVdJz+ID+JpYb5j9PlgN0xwODoOCX+L4nHLUrDVW07fpdOfyxkFAC 5Vew3YyXZ/rZLZKtApTGuJCzma+/S/ie0Byy5U6eXTQDXaNXv3eUjovJD 2Yfu3w2sFr3gCvVT0zAi3sPHCnv/7M/9S5fM/mwVgpzmsU/5eUdXznXwt fZjVd5EXRxHdHpLFo7sXjAcG+7nDRMIVqDFV4SHW2RUc16efWm4vi1FnI A==; X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="378798616" X-IronPort-AV: E=Sophos;i="6.03,266,1694761200"; d="scan'208";a="378798616" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2023 18:11:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="884390949" X-IronPort-AV: E=Sophos;i="6.03,266,1694761200"; d="scan'208";a="884390949" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 31 Oct 2023 18:11:41 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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, 31 Oct 2023 18:11:40 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) 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, 31 Oct 2023 18:11:40 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.169) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Tue, 31 Oct 2023 18:11:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cu2YmZ7SbtIQXTPmyARRP7GXpW7LwbMqtDJfzN74wkx+0Hyr9fz09yIU1RO2Epe8gRaOjPPHDNb/a0/XXtQ0uFZjZB5BH3jSCtgGhwb5uOdarT8ExJw8Srx5eCQpJ/796piGMgUf+ryE0IO2Wz7jo5heiyz2Bf4WN5ubwC8agPO0ZMeflLY5xEZo+vgendkXxN3IGxFN0Fjg7qtIF7Nh1IYTb0zUlYKiSES3vzgNhw3PlehYX3NiToyuURhsRI29IGXUdJzSqhzibFSCGcD9N9L6JzLICcag8Qi7NVRuxPF7W9DTUSFmxTmqrYuREmhRU17KKeVnJ3rxhxL1S51kZA== 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=js3DTZSBBlC+NgF9GHnb7ML4JeZZXWn2fHX+B+H/XVg=; b=oSK2b+CR9xn2DjI59MtpPFM/X2W82Cv/mJJNDJwZEc7PVrrE1Hgqd4hhhYr0Kmg/tUL6MDUJkmXS+0L8KrHpvgATmdV2E5+8lQghgGXiE9rfkiDolT+LWxhFdaBXfSwijqJ6x8SfE83W/4svF6YFUPn2ZPWlVCeXVr1TB6iriCm9dcdxYQYi75P9UYvXl8XNWak7O7S7wo2g50JZixfk8b/blQ9qgigXHJVG+/IRF9+IXrBP6GOH+xGo6cFKhSzL5qrtW1iD+ZDcFh8Xulfr+xocdfy2je5HW7bhdwKeTVhdO7gNyz6Z9Qkj4CugrUqWGNSD5Zx0+bv3FtmUIPIf+Q== 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 DM4PR11MB7279.namprd11.prod.outlook.com (2603:10b6:8:109::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.28; Wed, 1 Nov 2023 01:11:33 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::fccd:acb8:20c7:e756]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::fccd:acb8:20c7:e756%4]) with mapi id 15.20.6933.026; Wed, 1 Nov 2023 01:11:33 +0000 From: "Zhang, Qi Z" To: "Ye, MingjinX" , "dev@dpdk.org" CC: "Yang, Qiming" , "Zhou, YidingX" , "stable@dpdk.org" Subject: RE: [PATCH v2] net/ice: fix crash on closing representor ports Thread-Topic: [PATCH v2] net/ice: fix crash on closing representor ports Thread-Index: AQHaCw7VLhpLK1Ebs0GOaG13dW0srbBkqQUg Date: Wed, 1 Nov 2023 01:11:33 +0000 Message-ID: References: <20231026095112.3053582-1-mingjinx.ye@intel.com> <20231030084459.3470038-1-mingjinx.ye@intel.com> In-Reply-To: <20231030084459.3470038-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_|DM4PR11MB7279:EE_ x-ms-office365-filtering-correlation-id: a61e1ab7-ef04-4aec-b967-08dbda777cd3 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bmLgCpz1i33wFzzy0FHn4BRxIVxcujYdKjI0eQ7XY+k5/VZD9eFGa2n4vr6KIRIYVw5wCsHB2bFjtzJycApUqJKcr1lbQIp97mWMopr2IyaC6onNS+eKSboN+C+o2ZPnxF27a+KHGHOx1LdWyMPT83sdxLsV+Fe4VdGL9f3R5Pdw/wQdWyxEieUVXvciu8telrfIwsx4HlqWTZGyrs7DbK7qHOyAOcZEnBcR6Wpolq3KLiCNBH1jtltnSqHaBo1sBr8ErLyGPK4vX+Alwt25BsXCq6FMBz8BL5eqaqXruvQitUZqk+ly0LuemO8JlHH15jDJGXtWlvZQN70WWlSdTKQV/bsydwT26qZeaKuzS+2sk/kIxv96RWIuFCyOOl0X+K0xDxF1tcgvzYxB81fXen0clix2FbtpK6+S6nOGNjeXIqadgVRcOE3lQUyjN/U8OMlgOpoQV3LmTx1bFbY8m7Nke+KRxrWDT0PgcjVXhbAK3nLbmSBJB53josc5Yms69TEFGNMuARZO7Z8J++/8JjjFtfwvWrVOu6gpFCtXU7u+Y1C9F7OEjibdFGhQzY9t1N2s7lHBs5L9M6NvROeMFRhi11G5y/4d+BJRi6s4KYwFnOOqVuII/7oCwIVnIph2 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)(136003)(346002)(396003)(366004)(376002)(230922051799003)(451199024)(64100799003)(1800799009)(186009)(55016003)(9686003)(26005)(6506007)(7696005)(71200400001)(52536014)(8936002)(53546011)(83380400001)(2906002)(110136005)(66556008)(76116006)(66946007)(478600001)(66476007)(450100002)(4326008)(64756008)(8676002)(66446008)(54906003)(41300700001)(316002)(5660300002)(33656002)(38100700002)(82960400001)(122000001)(86362001)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DaJoQaYKRIOY9gyxz6z/2ZALn/cY3vWMlIh0MXdLkCpdWn0fEL7VnlNuMrNE?= =?us-ascii?Q?Bg8okgK8/fGlfpltz3qibc5mkL6HBc6HFg45XRdeZZwJopO+Ufrge+ix9Qg9?= =?us-ascii?Q?v0IXRJyZFJXC2L8w9jCB+CYlH+A19qvTmvxXuZdigAOaOGu5+rimzhPd7KUE?= =?us-ascii?Q?rG1KnmTg7RDsDaRZYzpWqXoCSrspxm/FCiuekyHsju9/I2wIpRnkEngMoy7n?= =?us-ascii?Q?uVeeqrz6q2JYy8Xis3dbLx2m/B7Pt8AnaRJgMNHX0uTclbRD7VcElvUAlNj4?= =?us-ascii?Q?QEayGYEq9bb6c3UuJpSUkGIRMo2k3d3f+dy/dKuOyw9q3oDn5iVKjED9vyVm?= =?us-ascii?Q?T4L/cdgT8Qp3yt8dPIRuJrLfQ3LTrJwB8eBqFrsiMvyJrrV2lXxDpFKFYcxN?= =?us-ascii?Q?toEEAjmu94XSfOSRs9aBq9AgC/91tpiCjmKvjLqcP5ni905iJPZ3J+YeYUBE?= =?us-ascii?Q?7APA0BAwsp15EpCNijG0hBSw4NYLkEWgFK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Q?FgpQhIhJiFMnJy7OEWGhV4FcZh3uma5DsuaxnTc/+L3qLqF2MIOrO2C2Zlrp?= =?us-ascii?Q?+HHr2LbStFMa32OihneFoqQjG/TBFN8j5Be/xMSPsK/4xmp/FG3m2HAAFbBF?= =?us-ascii?Q?5SxSminy/awvzo9lBEADfrMo/N+HUl8Wy3F5qrFVlhOeaTWIDG4MQ9GI5V8O?= =?us-ascii?Q?aSTO+um/lfdGVnAQOdl6TZnYbZTKmshFljeLyxzS?= 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: a61e1ab7-ef04-4aec-b967-08dbda777cd3 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2023 01:11:33.3218 (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: tcn0tXRNokpVBxCn+cPPSvoLsWPUVwP64ajiaUjyIkVCSFjWHVG+6SjwTw32umbMoIv58OGyzKm4L87v4CkN+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB7279 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, October 30, 2023 4:45 PM > To: dev@dpdk.org > Cc: Yang, Qiming ; Zhou, YidingX > ; Ye, MingjinX ; > stable@dpdk.org; Zhang, Qi Z > Subject: [PATCH v2] net/ice: fix crash on closing representor ports >=20 > Since the representor port needs to access the resources of the associate= d > DCF when it is closed. Therefore, the correct close port operation is to = close > all the representor ports first, and then close the associated DCF port. >=20 > If the DCF port is closed before the representor port on pmd exit. > This will result in accessing freed resources and eventually a core dump = will > occur. >=20 > This patch fixes this issue by notifying all presentor ports that DCF is = not > accessible when the DCF port is closed. > And when the presentor port is closed, it determines if the DCF resources= are > accessible. If it can't be accessed, it will report an error and return. >=20 > Fixes: 5674465a32c8 ("net/ice: add DCF VLAN handling") > Fixes: da9cdcd1f372 ("net/ice: fix crash on representor port closing") > Cc: stable@dpdk.org >=20 > Signed-off-by: Mingjin Ye > --- > v2: Reformat code to remove unneeded fixlines. > --- > drivers/net/ice/ice_dcf_ethdev.h | 1 + > drivers/net/ice/ice_dcf_vf_representor.c | 11 ++++++++--- > 2 files changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_dcf_ethdev.h > b/drivers/net/ice/ice_dcf_ethdev.h > index 4baaec4b8b..d94ef10244 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 > */ }; diff --git a/drivers/net/ice/ice_dcf_vf_representor.c > b/drivers/net/ice/ice_dcf_vf_representor.c > index b9fcfc80ad..eb49eae4e4 100644 > --- a/drivers/net/ice/ice_dcf_vf_representor.c > +++ b/drivers/net/ice/ice_dcf_vf_representor.c > @@ -45,6 +45,9 @@ ice_dcf_vf_repr_dev_start(struct rte_eth_dev *dev) > static int ice_dcf_vf_repr_dev_stop(struct rte_eth_dev *dev) { > + struct ice_dcf_vf_repr *repr =3D dev->data->dev_private; > + > + repr->dcf_valid =3D false; The fix assume the ice_dcf_vf_repr_dev_stop will be invoked during ice_dcf_= dev_stop. But what if DCF port is not closed, while only the port representor port is= stopped, should we still reset the flag? Based your description of the issue, is it better to check on a per DCF por= t flag, but not a per representer flag?