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 91905427F3; Tue, 21 Mar 2023 12:55:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 804DF427F2; Tue, 21 Mar 2023 12:55:25 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 91B5B410DF; Tue, 21 Mar 2023 12:55:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679399724; x=1710935724; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=02sgew8Y9L1fEFBqraM4ZZZ6jV/YDWpTvn8IdGWsiNw=; b=LU3yG0vJxObL6lkcP1lrKXLiBelNiYcH/A+w97/k1WArCGtk0S8zlHoZ vSCRlWN63djUFVeKQwc4nGr/1mpmvaw2Ev2tS5w7KnQgTBZ4bVT3xLlkM HFuAWxC8/8CUPlzb+wLeGIcbCUDhQc+PMDB6AbKou03d7GKfKIJDxfMtQ g0vw2SLX2QN7vozxRnysz2ohHs8yhjF5fHgBDML1+gs8qP0TfEf89gSo2 4Tt/XioZNQcE9aC3fhkV7hdGap5LQTbuDfEmvJ5WRmmuBxozjWfOF7+WL 4DeHOpfRfsLNtTRxgai6mqp71Y+rffRPSdsOnVSvufZIvx8ck1/k6vUhX w==; X-IronPort-AV: E=McAfee;i="6600,9927,10655"; a="327293981" X-IronPort-AV: E=Sophos;i="5.98,278,1673942400"; d="scan'208";a="327293981" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 04:55:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10655"; a="770598218" X-IronPort-AV: E=Sophos;i="5.98,278,1673942400"; d="scan'208";a="770598218" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by FMSMGA003.fm.intel.com with ESMTP; 21 Mar 2023 04:55:22 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 21 Mar 2023 04:55:21 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.21 via Frontend Transport; Tue, 21 Mar 2023 04:55:21 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.40) 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.21; Tue, 21 Mar 2023 04:55:21 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bjrQMTo0TOSjbfmvR5BJknR3SzIIeAkFbU6EY6t95BxkxQ5OUerS74rIyYQy43H83MZ6CvdZDvTNXuxkoV7Ce4V/j0t1z1BM6uRL4BPImfINdm0sbsw2tYK/9KFvJlDlpyPfJZX+CR6sbpr9ySoL/M7pRqZXsr7FD4UuqDZSDAhJdYkYR6MLL6eNtOWzVSeGKkb7+ZUX4HkC7Wbn8vxGg/4AF8C8QvGuPZzMJOhSqd48ncFdyfpMinwxZyiU5YeXwhxjBhVc5uH51PGH+P03Nbfu151l/BtaCAyKr2mh/Pu98Uw1vpx1t+BRYAtsjlfRHhc7sFPTGnOqrvL3fWhCXg== 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=IQWiqY/T27KfoQBSbVEUEdkpF0jFk7YBJNC+aZI6Pw4=; b=XelXlXszXucXJLWuyazGCSnMsyzDytYtzTRUYCI3NgBavTA2OxoGu6H+LuFQYrOg/HOJ6Bx2GhO9gN3xwU/KlO45dw/89P4z2f8aXgLY21rp85h9p3v9YljrHk9WtYZFqnlxl3h/O4ky0W1n/6mNGatxLC4pefYr9vtHwwhKKB8n5eTHdxGisf63/gvbQjRnW1gwJVlWaxGXMnwVKr/2Q4BY4mFNm5rAnhxvTlAF5TvFsdflOFuylp9IokqJtiVJsizLKhV9xxJlqJgbrQmJa7iS0GONuKbS5OrfkZW5JKZvu+pAKV9oqrAIK64S+MJ/QvPkhSHuIWZTYJ8UNmuM7g== 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 SA3PR11MB7528.namprd11.prod.outlook.com (2603:10b6:806:317::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 11:55:19 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::2c5d:49cd:a9b4:f764]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::2c5d:49cd:a9b4:f764%7]) with mapi id 15.20.6178.037; Tue, 21 Mar 2023 11:55:19 +0000 From: "Zhang, Qi Z" To: "Ye, MingjinX" , "dev@dpdk.org" CC: "Yang, Qiming" , "stable@dpdk.org" , "Zhou, YidingX" , "Zhang, Ke1X" Subject: RE: [PATCH v5] net/ice: fix ice dcf control thread crash Thread-Topic: [PATCH v5] net/ice: fix ice dcf control thread crash Thread-Index: AQHZWxC7K+e3peQS6kWvK4+rjfE4sK8DmqgggADjKQCAAKDoYA== Date: Tue, 21 Mar 2023 11:55:19 +0000 Message-ID: References: <20230317050936.5513-1-mingjinx.ye@intel.com> <20230320094030.18949-1-mingjinx.ye@intel.com> In-Reply-To: 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_|SA3PR11MB7528:EE_ x-ms-office365-filtering-correlation-id: 09446e7d-e6e4-4426-ce85-08db2a0324bb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 955L9mwePsJ00vNdb3P4RoNa4Sc6e+FaNbz/mCiYZS2kONI3SRysHNxqWvtUGCSbsMUThkl306qPdx0BtxKuOaCOkqxPr+t1T6g13MKwdvwi9GMCAkgsRyc6yJwwD/3JcvluEAm3KEwR2Kbg7JHyubtCDCdMtNcOsWG1NO+8RsqtWcJIy8KMZ/44M0k7QE4mJYKYQCqUPJLK07jwVXcCQkN6QnELtRe0bH0ZMyVemFVjOj3sjzOwBHfaf9O+tcgTJifo9xb7rVmWd2B3WskMlGJ7JyeLedg6gtRvnFs3cJPhV21kyvJmTjcwudYbaah2HLPaE4GRW5/+uHyyOzXgiKvNFrPHcbgaXrrpC+S4z4O9sEqTyqZfuL8GhHCjzhJO6UttTT5n/FXW/qXpN7IMvs+xDrKF/0yb0MsnCX+gsXLwt30ttAeRNb7J47esELoRgR2ICW9IfYWTsWeWiUQblMtdUdR8+31F1NSHjnntzJmd6L+TxcqUYhl+/Mlf9/rW2PPneyKcjuUDYQUu0j4ScFkTogp7Td8mCY8bamaaY/4dnMh1iK+UMSDeJ6JR70GiiDODdNgZsJVG+SLu+00Hu0nc0uL4AEI7tg/VH5GUJIrgQAFtOK9eNuBypmBMjvLkKLq15UFdMYv8vK/XBXkAyUKILEsTyeaRCrfXMWLariB9APmyPPFigSEV3uG/9zBTKYj5ucOA0dLlICG9mrbX7b3mXR+k5oZISjdsnOqFi9Y= 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:(13230025)(396003)(39860400002)(346002)(376002)(366004)(136003)(451199018)(7696005)(107886003)(71200400001)(186003)(4326008)(478600001)(83380400001)(110136005)(66476007)(316002)(66446008)(76116006)(450100002)(8676002)(66946007)(64756008)(66556008)(9686003)(53546011)(6506007)(26005)(54906003)(41300700001)(52536014)(8936002)(5660300002)(38100700002)(122000001)(82960400001)(2906002)(55016003)(86362001)(38070700005)(33656002)(21314003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?MTBsNlJ2a1AvRk5CY2lzejRybzRmRXdlQ1RuRENXaFZONUpsSWZoLzBY?= =?iso-2022-jp?B?UHNDb2huaXRHbGNUMGxoQUcyV3piOHEyNmdzT3lqRXB2UEJSRThsN3Ew?= =?iso-2022-jp?B?NmkvTWN3aFBOQU9GMmJXczgxNGV5MW1GWnU3bHBZQW5JS1RlakdVdkFN?= =?iso-2022-jp?B?NlF2YzVjNFRIdlpId0tvejFEbDY0TW1MREJzT0RmUkpOMWR3SWwrR3RH?= =?iso-2022-jp?B?dkNXVW1mTGhJNm5PdVNnOG56YzdYbXpzYjFtL25mR3BnZkNZdEpNWGpv?= =?iso-2022-jp?B?VmZHMUFkZ29qcStvYVk5MU5uZXMvZWlyYW9QRzNSOWNjbm9VMW5RQ1U1?= =?iso-2022-jp?B?c1ZJZVdrMS9CYUVqSmZTQzkvZFpaM2NiRW9jYllqb1BRT0FGTjhBSENH?= =?iso-2022-jp?B?Mk9FdzVXY1pIdVVycjVwWEpKMzg4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2022-jp?B?cSsvYUswTEp3LytGZlVJMzlYdHFiZk92eGU0dmtxZ1ZkUEx1MkFDbXk3?= =?iso-2022-jp?B?blJqcA==?= Content-Type: text/plain; charset="iso-2022-jp" 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: 09446e7d-e6e4-4426-ce85-08db2a0324bb X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Mar 2023 11:55:19.2301 (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: NzCIijyGw346gvqakb8IsjWwerdnA82k3MxgqMnWJMzX/ejPu5z4J/GCNrVwfIUxT9q8f1EV0YJ5E1gOgjy2+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR11MB7528 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, March 21, 2023 10:08 AM > To: Zhang, Qi Z ; dev@dpdk.org > Cc: Yang, Qiming ; stable@dpdk.org; Zhou, YidingX > ; Zhang, Ke1X > Subject: RE: [PATCH v5] net/ice: fix ice dcf control thread crash >=20 > Hi Qi, here is my new solution, can you give me some good suggestions. > 1. remove the 'vc_event_msg_cb =3D=3D NULL' related processing and let ea= ch > 'ice-rest' thread, end normally. > 2. Define vsi_update_thread_num as rte_atomic32_t. >=20 > > -----Original Message----- > > From: Zhang, Qi Z > > Sent: 2023=1B$BG/=1B(B3=1B$B7n=1B(B20=1B$BF|=1B(B 20:53 > > To: Ye, MingjinX ; dev@dpdk.org > > Cc: Yang, Qiming ; stable@dpdk.org; Zhou, > > YidingX ; Zhang, Ke1X > > Subject: RE: [PATCH v5] net/ice: fix ice dcf control thread crash >=20 > > > for (;;) { > > > + if (hw->vc_event_msg_cb =3D=3D NULL) > > > + break; > > Can you explain why this is required, seems it not related with your > > commit log > The purpose of this is to bring all 'ice-reset' threads to a quick end wh= en hw > is released. I don't understand, the vc_event_msg_cb was initialized in ice_dcf_dev_init= and never be reset why we need this check, anything I missed? >=20 > > > > > > - rte_intr_enable(pci_dev->intr_handle); > > > - ice_dcf_enable_irq0(hw); > > > + if (hw->vc_event_msg_cb !=3D NULL) { > > > + rte_intr_enable(pci_dev->intr_handle); > > > + ice_dcf_enable_irq0(hw); > > > > Same question as above > These are called when HW releases the resource. Therefore, there is no ne= ed > to call. >=20 > > > + rte_spinlock_lock(&dcf_hw->vsi_thread_lock); > > > + dcf_hw->vsi_update_thread_num++; > > > + rte_spinlock_unlock(&dcf_hw->vsi_thread_lock); > > > > I think you can define vsi_update_thread_num as rte_atomic32_t and use > > rte_atomic32_add/sub > At first I chose the rte_atomic32_t option, which is not very elegant usi= ng > spinlock. > The 'checkpatches.sh' script gives a warning ('Using rte_atomicNN_xxx') w= hen > it is executed. I saw the comment on line 89 of the script (# refrain fro= m new > additions of 16/32/64 bits rte_atomicNN_xxx()), so I went with the spinlo= ck > solution. You are right, rte_atomicNN_xxx will be deprecated, and should not be used We can use the gcc build-in function __atomic_fetch_add/sub as an alternati= ve, sp >=20 >=20