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 A1808427EC; Tue, 21 Mar 2023 03:08:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2722040697; Tue, 21 Mar 2023 03:08:17 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 89D3D40693; Tue, 21 Mar 2023 03:08:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679364495; x=1710900495; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=TQS7O3LP95vZVD8N+sGn/BzpbCGyXy3GirNtFu7O/pI=; b=NrifbqeoJsIETEcCmh8iUeEV6wd+TfiPZcFSY6Q/PGl1Vx08nkcThiDX a6dWzZOfZUqmqPjLB7CoZAcY6vMsMPCYCmQYfSq1tXff5/8HRjCBuDafK fBN6KA96JIfwjnPRaSUD2iybtVSZrSFnlD2cUtT6fgXR5HOemxmXij6MB 2iIKEB3Qjn6xvHJqz4MFIAccsaaTFcm/go4dY6UFq5zXXjn9Oj7FMP1DR tKyPg70KFCsNtKqF1b4EMMozUOYLaytiA6k/clyl6SFc1gHnY1HuiSX05 si55nUL6QeGJ+97VmfaLxqtgvmbXOTCfEzU7kiXeutPFI3BZYjgaSZgDK A==; X-IronPort-AV: E=McAfee;i="6600,9927,10655"; a="319224165" X-IronPort-AV: E=Sophos;i="5.98,277,1673942400"; d="scan'208";a="319224165" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2023 19:08:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10655"; a="791872943" X-IronPort-AV: E=Sophos;i="5.98,277,1673942400"; d="scan'208";a="791872943" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga002.fm.intel.com with ESMTP; 20 Mar 2023 19:08:14 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 20 Mar 2023 19:08:14 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Mon, 20 Mar 2023 19:08:14 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Mon, 20 Mar 2023 19:08:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ARKuEFAnMaKPJAq25JEcipun7jmc6i9HIYjIMRePu15hZgY33/FKNYnwO3YvFQkEF3kaUlvNCzAdrMopH/7/DEaTaPUtSZ0gm8SleJOuTkwe+OJUj2DxS2Dzv/soSMLVzQ5WUFoj+AsILqL5EsrlSCPw5mbcBDpTbdNfpVHOgdSYNfEh+l1BfkajBTNvmVvOzoP8xcDUdUPjrMHL6zeZI1Fa5jOShNuQqqVCpaixQJ+h9iLGk/TaC9PFYcKye2eJ1+AR+M5pxr4xp2zgPcUSdIbYR84Wft1euyUNXq1fVU2/eaEV0Q8QRZ8Fh89YqXyBvNN0f7UqE8vgpeq2Z/l2iw== 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=BIHksAKoFOFyh3H2rNNE2jfmul23ZqJOadF6RvMWruU=; b=J46Al/C+yKj2fgDQdhtH8NsuBmufT25yHE3iEMNShX5GogJYQJuTggU81Wso18gIS00094TUN2IflpKtnV/1tmMGHkSKjdIrOgN53xc8+JCIodA7QmrE8M8tnVlK14nv0uHcijBljA/VSubfWroCWZscxQrAFTNKYtzgtDTSIvukRWy8bUwHp/693XFM9aox6/UUcwqOIMLT+zZmWqFd4EIEBhR7ux+FmLMgZYDi0M5BLOL1eB1sUXxSUaYHzaWf3K11oRo5cSqzgU4T2FA8MXmL6igeOpMNH70iDE3Rr+xT86a+U9nSTOk0n7u2Yy3t5WLUGrI3bPn/Y/g1rl9Dgg== 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 SN7PR11MB7139.namprd11.prod.outlook.com (2603:10b6:806:2a2::14) by LV2PR11MB5976.namprd11.prod.outlook.com (2603:10b6:408:17c::13) 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 02:08:06 +0000 Received: from SN7PR11MB7139.namprd11.prod.outlook.com ([fe80::884c:13d1:1e46:ea5e]) by SN7PR11MB7139.namprd11.prod.outlook.com ([fe80::884c:13d1:1e46:ea5e%5]) with mapi id 15.20.6178.037; Tue, 21 Mar 2023 02:08:06 +0000 From: "Ye, MingjinX" 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 Thread-Topic: [PATCH v5] net/ice: fix ice dcf control thread crash Thread-Index: AQHZWxC7iue1vp/W90WTyzmmehPutK8Dn58AgADS29A= Date: Tue, 21 Mar 2023 02:08:06 +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: SN7PR11MB7139:EE_|LV2PR11MB5976:EE_ x-ms-office365-filtering-correlation-id: 691bd951-b615-4af1-5ae7-08db29b11c58 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yKVdENNl1ZWw4x6zP7SHP7PkLvWVy/C7rpxNKoRHbnpVLWHUK5PD8sSCc9Nl3CgLfoQYlT92gUEiD940SAhb/iAwMfXD6yHteQiliN2sj+wmQ1PvZzg0KFT0yfoCrwk5HU9rThWzh6JH/hTPmK/h9Y6BJVWW8bN4VdTSv3EMBwiWTgXfLwZlsLe61R9kO6KqJmtKrXyZ6DdCeLQ/dUb+7Vp/m9q1H24iAoyqki/Dt7gW27BubqCeojJcgPb2ML1anVakN0WZSNp4z1jiJwkcpPscmf/qlB87zXGZg9Brr0t4PDgluK4ddhNzk6BNcuId9Tezo4HMn6M2Vkc1kXTouzQVV1rJBaeCGRIF48gOEyA5m00GeFCOYlGDBj1yaSm2eByGyffBAMnxXHdQVdVHr5OVN6avzkR6TDCDEuywD/Kfn68xR+k/sb6d4yVItAP1+40FdgHXylg9Ai9p1wIiJ0wvabdCaY71nfjcNsjdYAdVw4fqFLyNq0EvJYKD3Fp6SxaGm9m2uMYVgdTjkqDM5FoOV8KaRYhOc8/QF/AKkM3jSbV3+SnwTaXMNkYlx7zFFyfiBBYxRq8Y6TtxsN4z904DgIbBwefKisIxs+BJaiV6Pe5B/FNmOxxxGXr1t7f+acDaiPpoI6ITkTplaGy+3cmOhJbG34B5qqxiMv7vDEM/Z1VUsVGmP6MZbCChR6lWqhNdM3QSgCpy9E+0brmkXU6tQGxtHLN8X+CLZPB+pLU= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR11MB7139.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(396003)(346002)(39860400002)(366004)(136003)(376002)(451199018)(38100700002)(7696005)(71200400001)(86362001)(54906003)(55016003)(33656002)(110136005)(316002)(66556008)(450100002)(66946007)(64756008)(4326008)(66446008)(8676002)(5660300002)(41300700001)(8936002)(52536014)(76116006)(66476007)(2906002)(478600001)(122000001)(83380400001)(107886003)(9686003)(38070700005)(186003)(6506007)(26005)(53546011)(82960400001)(21314003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?ZitwL0dXdnZnM0U4OSt6ZFI4d29Eay9sblFKbEI4T1pVU2pqbHJOdm90?= =?iso-2022-jp?B?c0Y2Y09qUXFIc29sU2Q2QzZaUWgzV092bkM1U2F3UmhvZ2tuUlhVRDNy?= =?iso-2022-jp?B?cVhOVm51RVI4SktMSld4a0xLc1krU2M3a1lvcWx3Z25ZZThGN2wyalFv?= =?iso-2022-jp?B?T1Vld1ovUjg5bWNJMERlbzM1eXBrUFlGeGFKKzQ2azdOUjQ2cm5hMk9E?= =?iso-2022-jp?B?d2xyYVhvbUtsWHMrWWVreGJXZVlNNk90cTJJODVHZmZibjZxekFXb2g2?= =?iso-2022-jp?B?bFlzcm9Bdm1tRldVTXhuV3dDQlY3b3RBWjZsaHZ3cnQyWmpUWVVQcm9L?= =?iso-2022-jp?B?bWZQd0tCVDJqTnZYaXV4SnRiQmhObXZLMFpzV2NEMjFnZGhaQ3h0SHNE?= =?iso-2022-jp?B?alQ2SXNvNjIrVjFuR0pSNUJqQnowRkZ1MW1PTzBpVjF6RW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ZraDRJZC9hWFJUNFcySWZDb1VIaUF1YWxIbWZOQWVWY3dyWER6TElZ?= =?iso-2022-jp?B?OUY1ag==?= 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: SN7PR11MB7139.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 691bd951-b615-4af1-5ae7-08db29b11c58 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Mar 2023 02:08:06.4091 (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: z9SfcnutbAxubQ1mjqYuw60vRxrEDHg4sCAYfRWcGGWHkrjVzoQ6B3IuSyr9FT8lsE7Nwf+jn7tifO0OCjOHTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR11MB5976 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 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 each= 'ice-rest' thread, end normally. 2. Define vsi_update_thread_num as rte_atomic32_t. > -----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 > > for (;;) { > > + if (hw->vc_event_msg_cb =3D=3D NULL) > > + break; > Can you explain why this is required, seems it not related with your comm= it > log The purpose of this is to bring all 'ice-reset' threads to a quick end when= hw is released. > > > > - 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); >=20 > Same question as above These are called when HW releases the resource. Therefore, there is no need= to call. > > + rte_spinlock_lock(&dcf_hw->vsi_thread_lock); > > + dcf_hw->vsi_update_thread_num++; > > + rte_spinlock_unlock(&dcf_hw->vsi_thread_lock); >=20 > 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 using spinlock. The 'checkpatches.sh' script gives a warning ('Using rte_atomicNN_xxx') when it is executed. I saw the comment on line 89 of the script (# refrain from new additions of 16/32/64 bits rte_atomicNN_xxx()), so I went with the spinlock solution.