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 D6667A0C4D; Mon, 6 Sep 2021 03:49:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF99F410E9; Mon, 6 Sep 2021 03:49:16 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 7B15A40C35; Mon, 6 Sep 2021 03:49:14 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10098"; a="305416280" X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="305416280" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2021 18:49:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="430402660" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga003.jf.intel.com with ESMTP; 05 Sep 2021 18:49:00 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) 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.2242.12; Sun, 5 Sep 2021 18:49:00 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Sun, 5 Sep 2021 18:49:00 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Sun, 5 Sep 2021 18:48:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UDxOG2oOsmAc8bb9AkavfE0kbpNGvo5CjAaRg4fyNY/mECG5Oue8EHFuXLDC6Ff2gTW3emnN5p5YyYzTvZlHw74cuSDBhUDD4O30YnJe1w+f3Xfx8KlD94MZudVIRNhNLxUEcXZPx8G4ULLjsNAeRsmw0KMl345kQJlWCPqnvKsRDzWOzDnRallbWmUCMfJHKZzUjYfvBzmnpZwyn5pt1OoqZqL4m92FqZyokHM2817LbnheAC7xCw7yYVUXSSwwfKgi+cZOLTvHETW0BNyJuKrGMjBUv7G17+uwogVjIM1dlQu/Yy0dQOlDBoIUABw0suHbYTDQj5GDi84q3kl5rg== 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; bh=7CKhnPFESsZR8BE/MIo2siLIaGEkAPq6OL7dw3INTc0=; b=IdWQLdoTlLmbdP7NsDDC7xUKeAnHhrrkcg9YxYt/kMztQgdZ4TYs2LLBSOhl/Z2DmHpgIV+4T9Aaucc4jLtjFSdnZTrOXi4kB/A23+w/oiAQQm8LkKIEAzueIekT+3Llk3qnBZAhxzfQxJfmu3tBE8Y2/J63RymNCBjOK8xTYnmTJEGHWJkr/62UJ5Bd4M5Nc9gbq81Popnc4iiNQX+DlF3gVquiSd7Msz5qr2ZvjApl8HdFOvzijhJB/uxpiuUdFdcvAmrIo22ZMrlBtiWnT7Mzxdm6HelSzi8LyoU1XcGDy7e3skyVk5qAvEG2ZJK5mLHa9L8OeJLOyCnthWew7Q== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7CKhnPFESsZR8BE/MIo2siLIaGEkAPq6OL7dw3INTc0=; b=Kr6HvQj8zrdcVWuybYqbqOY8J5Q6vkagqxCrri9N0dTFqwAaYNBRCv/6PgyFnpRVLGcEd2YjNqjOeaPH1Na+oe/Z7x52ONIN+VOATZHfmXKv1oIaap5mNrCDixI4RjHS55uzuzXKscPVkTx5Si2v6hEgmeqJiwzZCYJRc66nYDE= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN8PR11MB3730.namprd11.prod.outlook.com (2603:10b6:408:84::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.21; Mon, 6 Sep 2021 01:48:56 +0000 Received: from BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::dcf0:d9f6:8024:1879]) by BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::dcf0:d9f6:8024:1879%6]) with mapi id 15.20.4478.025; Mon, 6 Sep 2021 01:48:56 +0000 From: "Wang, Haiyue" To: Qiming Chen , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [PATCH] net/ixgbe: fix probability of obtaining mailbox lock failure Thread-Index: AQHXnkQIalENTNglTUCXinkHcUuwxquWRe8A Date: Mon, 6 Sep 2021 01:48:55 +0000 Message-ID: References: <20210831084051.6300-1-chenqiming_huawei@163.com> In-Reply-To: <20210831084051.6300-1-chenqiming_huawei@163.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.0.76 authentication-results: 163.com; dkim=none (message not signed) header.d=none;163.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dcaf7eb8-8a26-4e2a-687f-08d970d87cf3 x-ms-traffictypediagnostic: BN8PR11MB3730: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: e3EaYxpr4wzWfaU+6fA+xrMndq1BwzSkX/zb8Ed1yTJCVwaXR+jbdpTOWZNID1hFksR46zMBABaTZ/N9juBUvTYAKo32137z8kJiwE99G4eqNDk359rl/PqNSpREIYF9Tm9j7dddjSCgYBKSFm8sprGxNyMux2MOeaDBfOmmWgnUfYxElZmHM2ENJc8thvmswBYe6KafE9ohXknRuSnhI+wK7pVcKB7Q5CCDZnZhQO0ozV1Ud8UMGFFeUK7ahW4TRUoSBHpz1JTWiA8vqQC5HLR4Uxf3v3m5DqNBDveWLrhXfsD7hMweqiUZKR/rrhNEMnXgRSlL2GFuGLY0q11xwvtkb0S3Z3HGHlqlM0AX2WvUd/ygI6Rsb32Y9f6TAqKUd5BBzQbPX4V6jxg2y6f8TXFpIE0lHlIyIm1JzVMRXtsGeuRtvjVX3M08yZG+93JJZ4tE8ZKH1tRhRzL/LkmLaqkCSRlFdH0jve2x+lY2mgI07F+Vdhxog8rEA83Z9KevswdZ1SwnuCSH1EnBAC0pgUxGwejcoqRGfBRdwfO5Uotzi7ApP9qzGeeuaQ3AUNlsafcUvJx4DiEphAnuXKLhvnSZMGdBkCkF44vhFyiEFB4Gqfs+Cgr0SpQqi4LgwuB1E2dAfxUcCmIsmv7mNERccvV3GvklUswLjk7w9QAuNiqUUoGi/AxBvPEmdyXj5rnbRPkzqMJNFj0xcaPUBv6G6g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR11MB3795.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(76116006)(2906002)(122000001)(71200400001)(55016002)(9686003)(83380400001)(66476007)(6506007)(53546011)(8936002)(38070700005)(26005)(110136005)(186003)(8676002)(7696005)(316002)(38100700002)(15650500001)(52536014)(64756008)(508600001)(66556008)(5660300002)(4326008)(66446008)(33656002)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ULCPeDaLYvgEj9ZO3aNJf3y22sjvmrSpSW0g+kpMeFfPQwQSZDfV/2iPBtTy?= =?us-ascii?Q?KlAKKQVPAFbmSaYJUmfKkIPZKhFHeldZaeEOMmTpXgxtYq+CWln7+ave/uLK?= =?us-ascii?Q?R/wXJSJsTTm7Cu4PFUM5VcqN+M/W1hx8A1jawM6T/qPTRrl1C/yT91CALx2O?= =?us-ascii?Q?8yuiGmFRTFZ+gwtU4OEtkUPo8Vyi3IN3d/KpRMTzjq7yvkbakI9Tlxts5iQW?= =?us-ascii?Q?56wEd+36QAfuq0kPdsqqNftmP1tULnNrM7WvHfvWa1sGu7kJVVgz9k6E8W7y?= =?us-ascii?Q?StFQpVChWrfapPLJTTUnJJUNCbOYayWsD1ByjdHnl/eMbW2MO5tE2fMQ7sWh?= =?us-ascii?Q?YyFyoDKwcTczqT/qPg70bSDEgRQzvoAdbAI00UA66guX+/eOROoL8dX5y3fG?= =?us-ascii?Q?1Ekte98YYq1UcvxbnXTcp3rosjikKYnkjBbVUrSuZLJyPjfgEO71ReuXLocN?= =?us-ascii?Q?6fFXGM+WJmW5lxDE9urh0i4GMYoH7r7qMPl8QvKkfD4Ecv/2U8f0WmIRPZOh?= =?us-ascii?Q?j1s2PmLKjYDrd6sTXjEFaa2iTV3Zrq6OaOaMMce33p3LFyHkZDslc5jWFLC/?= =?us-ascii?Q?s0xny5UfYClTQ8Y80GGPvfXSHqMNdUULYjQF65UX8F9cZAkkruMzry9xpaNy?= =?us-ascii?Q?NrBFwLBfEzKxOF+kPRoFldYIdpa8wXyBE0kTf60Js5RCgjJ4DZ+eHMM6Vgny?= =?us-ascii?Q?k62pi5iObr9qpwzbRF+Kx2fJWX2LGFTV8XqtoAvkZ4Hx1ttJHmt77Sx6f7Xm?= =?us-ascii?Q?wWlREFW0ue2cM1axjNMQ44CnrAbS59j8jCGlYfUGHbGHyl97BDrqypkrNJns?= =?us-ascii?Q?CjzHDtjdwPtz+CxI4qqnoRlfs2nlHJJEdn969UmL75Holnkcl+E2A2DDjIt7?= =?us-ascii?Q?gwaMBMADg/5acZKtWzP4TcxpNbyngpVJKLANjItlCufE8703cF6GIuXtMZmb?= =?us-ascii?Q?ZP2ob0D7jCtO889rdSH44y9SIXCZPjxoMUI3BT02CsQXEhj8330v6rDRK6FR?= =?us-ascii?Q?dNzPJZGJ3/sp/Pq2fz3Mu+qy+PwHuv0263QkYH9C7BVEvJFgQL6CHcLHlXX+?= =?us-ascii?Q?d9YlVIARb2jC5jmAvhvbM+RscN57nftd3KODtfsmzmDrqT1nblcHe4Q5QXnD?= =?us-ascii?Q?889ZS4HLmFYLabTFzB+trzW9D1hTSNMztcDWExU7wqiFwn0zg4wk/6b9Addo?= =?us-ascii?Q?hr2OeUNU9UmCUm+omtAtI5veaPrKycXQPLO+74JHPW2B+9JFezDQOvopunIf?= =?us-ascii?Q?zbeZVN17yE+8Xlksu9zk8aAfUWSlHs+i9Ci3Nb1Wq6aToCKvTYVoE3KhrNpU?= =?us-ascii?Q?XBThebqaMekIub+MYvTvp5CN?= x-ms-exchange-transport-forked: True 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: BN8PR11MB3795.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcaf7eb8-8a26-4e2a-687f-08d970d87cf3 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Sep 2021 01:48:55.7171 (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: Egr8oqNL3tAaz4xR6obyXIqA98vMIsX8AcZbxyhorm5Ti5H7eeESyTtZJIndbyGdee/i68Xca7R8mC9ltBvBlQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3730 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix probability of obtaining mailbox lock failure 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 Sender: "dev" > -----Original Message----- > From: Qiming Chen > Sent: Tuesday, August 31, 2021 16:41 > To: dev@dpdk.org > Cc: Wang, Haiyue ; Qiming Chen ; stable@dpdk.org > Subject: [PATCH] net/ixgbe: fix probability of obtaining mailbox lock fai= lure >=20 > Ifconfig pf port up/down, after several times, the dpdk vf driver may fai= l > to obtain the mailbox lock, resulting in configuration failure and > functional failure. In order to increase the reliability of mailbox > communication, the patch uses a trial strategy. >=20 > Fixes: abf7275bbaa2 ("ixgbe: move to drivers/net/") Should be Fixes: af75078fece3 ("first public release") > Cc: stable@dpdk.org >=20 > Signed-off-by: Qiming Chen > --- > drivers/net/ixgbe/base/ixgbe_mbx.c | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/net/ixgbe/base/ixgbe_mbx.c b/drivers/net/ixgbe/base/= ixgbe_mbx.c > index 4dddff2c58..5a14fcc7b4 100644 > --- a/drivers/net/ixgbe/base/ixgbe_mbx.c > +++ b/drivers/net/ixgbe/base/ixgbe_mbx.c > @@ -370,15 +370,23 @@ STATIC s32 ixgbe_check_for_rst_vf(struct ixgbe_hw *= hw, u16 mbx_id) > STATIC s32 ixgbe_obtain_mbx_lock_vf(struct ixgbe_hw *hw) > { > s32 ret_val =3D IXGBE_ERR_MBX; > + s32 timeout =3D hw->mbx.timeout; > + s32 usec =3D hw->mbx.usec_delay; >=20 > DEBUGFUNC("ixgbe_obtain_mbx_lock_vf"); >=20 > - /* Take ownership of the buffer */ > - IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_VFU); > + do { > + /* Take ownership of the buffer */ > + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_VFU); >=20 > - /* reserve mailbox for vf use */ > - if (ixgbe_read_v2p_mailbox(hw) & IXGBE_VFMAILBOX_VFU) > - ret_val =3D IXGBE_SUCCESS; > + /* reserve mailbox for vf use */ > + if (ixgbe_read_v2p_mailbox(hw) & IXGBE_VFMAILBOX_VFU) { > + ret_val =3D IXGBE_SUCCESS; > + break; > + } > + > + usec_delay(usec); > + } while (timeout--); >=20 > return ret_val; > } > -- > 2.30.1.windows.1