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 8446FA0548; Wed, 8 Sep 2021 05:33:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 08662410EB; Wed, 8 Sep 2021 05:33:17 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 7D5E44003E; Wed, 8 Sep 2021 05:33:15 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10100"; a="207601422" X-IronPort-AV: E=Sophos;i="5.85,276,1624345200"; d="scan'208";a="207601422" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 20:33:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,276,1624345200"; d="scan'208";a="695295640" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga005.fm.intel.com with ESMTP; 07 Sep 2021 20:33:14 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) 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.2242.12; Tue, 7 Sep 2021 20:33:13 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 7 Sep 2021 20:33:13 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.171) 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.2242.10; Tue, 7 Sep 2021 20:33:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MvK7XCNHyJ0W9Zv899SBZ2HlhPZNrPS5NpaZX/ITeX13MykTz6EX9th+1lEdeYUZo0zgSqce530fus6Sab924ZkmZ9dPhCK/WyhX8xhxBioNKuaLLQVGYSd0qOsoqFjZs6wBWlni8x5fbhsoI2BiUbSDSBEgLVjtqH1K+tntu0JNGyKcWZ08Rsij+icAEFDLXrxsthqpGnC+cY3X7XYw7bmhIRIR7SepLpo5guTS3d4k6M0lbRbByWhO77EPU/Lem1+eY9rm2YfKt2IGtm6m2TZzSYrcI80ys/NJCzCZBErcU7a6IRAX8Gl01wBohooWmnwGBB8TyOK2wsjJbb2hyQ== 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=fFUIWlQyO6WToyrOjPXRDEoc26Ra0ntMmgtj9qtkNIA=; b=NROqal5OgQ006fGp37EmRGclWtyRNmc6LwZxsAShp5cOBjQdR5iNxn1X3/0i4twJGiQpibKJ9GMDLomeO9fZGnMf+bPOC7iofRhXNnM44rv6GOWJVNb75YE9MD2ZI5uOMzAM179Ez1P18o0qwKVnTocoMs0+He3FKp1jsaZuafE727vogaEat4arZF73pkAP8N0JiS/l3/s71RZaoRxoqok4JgQ2YuxvKt+40wDzyZ6h3r1ggruwDR0lJ9Mh1BJhPPLsd+25lH6maS0rPg7NjskHI8CzzQJK7DGDjuxiLrMRQysa4QArr34luhenxmmm77/xVTZu7+0u0uGogTFeug== 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=fFUIWlQyO6WToyrOjPXRDEoc26Ra0ntMmgtj9qtkNIA=; b=KJhPoAoP1E/IeJqGU+2rLZv8ZLeY1qMPbecd28jUC7WIGDZSkyTOrqshoXnP8zGUA1Y0fM2d8KJKSvCj6j7cJcUweEU/vyjdkGInzAFRkgdOHwm9TudPnpIjs4jNlcTfQ1F1uns24ysTNKCLkyA/G2PC6xucO8IWhvwkyWRCY+c= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN6PR11MB4146.namprd11.prod.outlook.com (2603:10b6:405:7e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.23; Wed, 8 Sep 2021 03:33:12 +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.026; Wed, 8 Sep 2021 03:33:12 +0000 From: "Wang, Haiyue" To: Qiming Chen , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [PATCH v2] net/ixgbe: fix probability of obtaining mailbox lock failure Thread-Index: AQHXosYkx1iYflR1DU6dg3RBgILdK6uZfnMg Date: Wed, 8 Sep 2021 03:33:12 +0000 Message-ID: References: <20210831084051.6300-1-chenqiming_huawei@163.com> <20210906022208.9530-1-chenqiming_huawei@163.com> In-Reply-To: <20210906022208.9530-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: 2ba10156-86e9-4774-dd1d-08d9727962c2 x-ms-traffictypediagnostic: BN6PR11MB4146: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:335; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EPIB6ggw7Leu213czeyTiE0QmLA+R0061dRCr4OE6Rn7Rm0BnSVebAqCVNWwO0rLdNTTcXJTl+ans0PZNHmHgMntiELaQeu/91vTHbhd2W1pl6yYCikXcEZgikNz9z8AohQnn5eh9cUECUOB3Tp3bVApE4f+2qaLwmvmpEaPksVSEjNdMdaKd+0rWRq6NlJ3IoSgT4vFURpHlD+HrzcRdMaTy1+OA6mVB7AH8JQsnmTN7zsL49cApttnPJR+4o4YqstaQvu3T/3i7F02FL+G8QRSdWxiCPgfTPJslOPqEOYm6AfBO07kzMKTlWiCX0IwJRnueYTpNLp63xD0z1u8urik/lFLzKG2NWYuS/pQLbF1ZKI0iOop5Mn667Cl8xElsS/QnW7d7X3VGzGW/gvL4or9YD8Q4dV20x3+u+11b/ZYrT0fAcyU7l/9bb08WZ8TyvlZAbkWkJ4eOzx9a4tcP9s6YBwsYeJQ8mVypEMUHXPMi8tqQXO3Ua3FDxH/Ykhhus2vmzz/FxUItqD5BF4k7AQaysAwyTqi+5afHkm+qAZb/ggXEBleQMnYiRxnDQSowlXh/MZjBb7IvpPRcXB+StOcwMLaSAsXf84OMPU0/KiNHNhd0HlOMlLo43paH1gQ5tK1OONxJLY5NKozASoXvrhS580Z9+Vi+k/+82Tu46uwZSDblBEkwomrowKgSvHmheLe2D4ed0B6kVXmOnCGgQ== 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)(39860400002)(366004)(396003)(346002)(376002)(136003)(64756008)(76116006)(66446008)(52536014)(186003)(6506007)(4326008)(66476007)(66946007)(38070700005)(86362001)(66556008)(53546011)(7696005)(26005)(33656002)(122000001)(5660300002)(15650500001)(8936002)(110136005)(2906002)(9686003)(83380400001)(55016002)(478600001)(38100700002)(316002)(8676002)(71200400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fD7GHW8pPyNqTsxBD+jQ+WCnluglVJL15PmoJdNfeJP8O71pFtvmJ8rv5sNq?= =?us-ascii?Q?UHhUOFN10g+pq0ytqnwELc6CENffw6/qtXfb4VTqqOlmQ4hzOV4dlt1qFi4a?= =?us-ascii?Q?d2idYOIdmccM3mpX4+9RxGPUJQN9a34LTFg0Mctc+qRqWlE8W3fFGUZ7Z8it?= =?us-ascii?Q?1lPDQnuaLHXBgT7uZKcyC+WwStFSxAQzL5fy0wyKjFxFtDiJBtkpssq7dqsf?= =?us-ascii?Q?PsmmvfXvx2OgHyKN1xr7ip4wi47N5RrT0Vq4R4DWGrSaaqtyGaoO4o6F1pmy?= =?us-ascii?Q?LU0IBRs5HB60kq5oWgOKZULu995PvTEs7aE16OS2AvpWC03hnZ3sv5gGN0xj?= =?us-ascii?Q?5T9n6FtqDEaCGQtuqo7pW3xUiE+EhvltME8iHCH3NNSS0euKxnj10FJ90UtW?= =?us-ascii?Q?PsRjWLIz0qj82APO0DjfkN6BiYDf2uDo2W+ilovODI4w0BV03WHoFlRJLdEO?= =?us-ascii?Q?1AblNUek0gNMSU9nWhGN7ZUcj5Be5w6XUgslf7xmTvW8DUhiUNe+Sux3yRPD?= =?us-ascii?Q?6qjjvcW80zXg9hraLSPfcc+ASjDPPXNHpEe8USSXsHUsn2VzWXUhKpeXJslY?= =?us-ascii?Q?X/DrO+XyAS9DV9iI4oMoaV2OjuixHIykpxwMpRdRO70TCefMI6BQIuzGhJti?= =?us-ascii?Q?Dvh7GcJibaVZM4i0WqLOQH6kKRJE4RkkJoU3rfgITYQZTEOfhBiIssWKW/yq?= =?us-ascii?Q?hmyAJr5xYmo1nyCYiHwLy+IiBOMRMbziZm8yMEpfOMV80r7BBmf2p7LYadZ3?= =?us-ascii?Q?wWO+ItWwQDGHb5fwfhrRsuAdNOv8JRGMl9xld+JAPoRgixFYUW4OxDqXSLOE?= =?us-ascii?Q?bK2ECMMh/+VSs234/NIZETY2oHQGY5yet3fgMus3Bn8C2zyYzQ8uf9sV5WcF?= =?us-ascii?Q?Ty2tIP65DsC4mK4UITvrAvDMfua1q+QVCqtbI/ZdLWTTUhBftUKEzjTkmibX?= =?us-ascii?Q?ZxJNVnkSGTGFvc30SBD0ky1StfK2ABYr347jm60c/AWLRexHuff8LCuLZBKS?= =?us-ascii?Q?MMyoSYFlADrUnglZ6Xn/+CF0zixkD+BqkcWCbNa7PyP4qcOqOt+sLvEh00l6?= =?us-ascii?Q?029jqrZ7hmxy3WQrtkZvJ/uXsInqxZrUr8qD1eipIiG4gU5Md1+sNR5AcFy8?= =?us-ascii?Q?wGceDPikU1SulJ337wPdivIc2GSMq2TpuYEKnuChCRjKy6gqZLapiNHvAD6p?= =?us-ascii?Q?HmMCLw+Ex+6ZYUYxK41HvElU0TSoiq6eT345ZRZyoe7Q3EZ3jWK7MWdLsU4q?= =?us-ascii?Q?Bi/SJ7yRtQPXNC0GoKPd3mUAOM+/ihraxLvVtXifW1QYMeHTEoSTdFBwkgof?= =?us-ascii?Q?RuY=3D?= 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: 2ba10156-86e9-4774-dd1d-08d9727962c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Sep 2021 03:33:12.1723 (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: u5Myn6hdfMJDShkG1SENS+PSi3jMnT1V/0IXI5/M9Q3Tpc939VD+163HxKsv4IYWMCNYKzcVc2WYzfTSsoe2gw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB4146 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] 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: Monday, September 6, 2021 10:22 > To: dev@dpdk.org > Cc: Wang, Haiyue ; Qiming Chen ; stable@dpdk.org > Subject: [PATCH v2] net/ixgbe: fix probability of obtaining mailbox lock = failure >=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. What's your log message like after " --log-level=3Dpmd.net.ixgbe.init:8 --l= og-level=3Dpmd.net.ixgbe.driver:8" ? What I got is just a little messages, no more function call. "ifconfig PF d= own/up". testpmd> ixgbevf_intr_disable(): >> ixgbe_read_mbx(): ixgbe_read_mbx ixgbe_read_mbx_vf(): ixgbe_read_mbx_vf ixgbe_obtain_mbx_lock_vf(): ixgbe_obtain_mbx_lock_vf Port 0: reset event ixgbevf_intr_enable(): >> >=20 > Fixes: af75078fece3 ("first public release") > Cc: stable@dpdk.org >=20 > Signed-off-by: Qiming Chen > --- > v2: > Modify fixes commit > --- > 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