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 9128C41B89; Tue, 31 Jan 2023 06:21:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B78B40EF0; Tue, 31 Jan 2023 06:21:07 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 1F33640DFB; Tue, 31 Jan 2023 06:21:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675142465; x=1706678465; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=4tF25QqGtNlKmNiMclR2pIXmjwlhi5tMvKUIx7Co4GA=; b=awpahYRnETJUyVrZA0G7e9aCDMyfXuLAT7O4LX7m692GaWWSSvEB9Lo8 FKbCHyrxg5RTbTUwyd4F/VmnGtJ9BBZ4NBwgvFxmIZyLX++aOEiwSFvV3 0V2/8kCLWG1D1qGI7CjXTABIqirmTr0S5EoexjwCw7bi84QGrIvB3F8LY aQUGZmJJkOry81Y3QZRBk0fNzTEOnV1OKnlaelLI9qrO0OpYReNKIrCbJ NkHU9Q/sHWdRZJmwNqohDNtigtMRQ9LcY5qhz8cmhn8pdwbrKMp3JziiL vh/1INWNqUT4ApstftvIeTE1utru3dM2nChURAVNC0YSsAteGRT7Vn6nh w==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="311376159" X-IronPort-AV: E=Sophos;i="5.97,259,1669104000"; d="scan'208";a="311376159" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2023 21:21:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="694830648" X-IronPort-AV: E=Sophos;i="5.97,259,1669104000"; d="scan'208";a="694830648" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga008.jf.intel.com with ESMTP; 30 Jan 2023 21:21:04 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 30 Jan 2023 21:21:04 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.16; Mon, 30 Jan 2023 21:21:03 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.16 via Frontend Transport; Mon, 30 Jan 2023 21:21:03 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Mon, 30 Jan 2023 21:21:02 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Di+iYggl3k6KZ9fV5htaL8jOQvzD/KWaxXxbmfqT0dP8uSQpEQyH5vDoO7DqN+wn2UZOUpiycPch8JQKuIdn6nRGWlQoRpYyv7MRniEIK/FUnySjuXtpwD8TsPc6OUKZCjgtNTTPSvifgt8czIa7ncD8sJfsGtjnsVY+7Y3pJBSmYayEi9TeOw89/vIJty/Zhz/m/b9UceGTF/7Fd54fiYohkt48QjGbAu0YtRtZUFbvx2QodVx4oI6YDEvfteGRrPvMG5cntJntiQhsM1O9dfP5opks0gjOEeBhDE61XuDUsdAQqMXaHIz1l/+Q10oqy4Fb3ph2aMGnbKc8NMuoVQ== 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=AjLb/IT/ZG6KsIG/3lrMp6puVOHmiVYOWhry8GNgIns=; b=ZEV7Vfk5qqnn+31gSLfxLzh1dBMVvMNp8PFwjKpfGcFF2/reCWblAn570JI3bp2fTUiN1IJ9/CZV6rsy+wIxc2r7v3ObxcluaL0JBzWWj4Whrz7PPXP3akx9/0V4BJE1BR0Ok5kApEg0e+paT4A6PcmBR4VQosOHrB9KEOCqzEw1V47YpSzm8oQ/FUZy2thx876Cse6+B4/kBipEHonB2vyBKU7pa3dNbeThvi0kZ7CcMXCj8dWBaQv440ZrTF9rmx0Psko81UUYtkK565GzYf0Qzkb+vWcFywx8b2XDLzYftQ89BipCdkeA9/s361WORz1YFGrPwvdU2yuZaDZjjg== 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 SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by SJ0PR11MB4877.namprd11.prod.outlook.com (2603:10b6:a03:2d9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 05:20:59 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::c8f8:a3e1:5b23:a9c3]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::c8f8:a3e1:5b23:a9c3%5]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 05:20:59 +0000 From: "Xia, Chenbo" To: "Coquelin, Maxime" , "dev@dpdk.org" , "david.marchand@redhat.com" , "eperezma@redhat.com" CC: "stable@dpdk.org" Subject: RE: [PATCH v1 12/21] net/virtio-user: fix device starting failure handling Thread-Topic: [PATCH v1 12/21] net/virtio-user: fix device starting failure handling Thread-Index: AQHZBNSL0B2PyhsHY02e5TPkfUzNtq64XeQw Date: Tue, 31 Jan 2023 05:20:59 +0000 Message-ID: References: <20221130155639.150553-1-maxime.coquelin@redhat.com> <20221130155639.150553-13-maxime.coquelin@redhat.com> In-Reply-To: <20221130155639.150553-13-maxime.coquelin@redhat.com> Accept-Language: en-US, zh-CN 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: SN6PR11MB3504:EE_|SJ0PR11MB4877:EE_ x-ms-office365-filtering-correlation-id: a5cec069-19fa-4490-82ae-08db034af05e x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: U7e34MVEQEK1hAez7Sc83e5qtZe2GVJCLLbb9p+PeP2ZJa7BHGuP7FDG+6pqUsjTK252CF8NjSEZ8GUa2D2kE3TwoB79fxcBLMfSMWNLAAJ6vn9vzHY0EdeS2IL9HtN6J/PWPXDqlJHHFnn7rwD/Yrf2v0HejmAx3BAak96628z2jBmPBjB7QsC6O3JR060F3szpddJkaNi2Gr2mKVhXPAXNd21PcfPfqHHmY0mwhbA4csTG88RcFJ5xDWoXfAnbVSLW+EItUC8VmWsxAYMSS7Us8FEjUVKiYMf6kZW3EidCn21jDWxye65DvFfShdB+6oclINyLSEHa56hgooIDN9p3WrsUCy5renVF8ib+qfhFd+ANijtHJEno4Boow7ay41w+xMC0wJoWDZlhkvfv2XKOm92ZxhmTS0zEnKfwynwtmhfpXSnb3/wKKj18riZeElnhcbLHGQHy5oBuXuGpwW+1rWCx8Na7XgjkvUKqr3pVcvmIZMI+rslecoiN3I6kO9o87QfBkBDiYc5ZrMzvoIokO5gcsVfefc07Mf6xQ6VAI9I4Q53/CSK79clFhFRjNljGvicl2Tq1lNUt+9xk+fdefK9YGN/EiNYiQefCZkFHXmEVuaYkxKTLprU9ecC9eCNNAVwUgXmyS6olbo15Z3yCv6DybawCdazxnuT13upILoAJQcKJ7stan2y+nMSszTAoz32D9/DZqe/+iv4/TA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(136003)(39860400002)(376002)(366004)(346002)(396003)(451199018)(66946007)(110136005)(66556008)(316002)(76116006)(4326008)(66446008)(8676002)(66476007)(64756008)(41300700001)(52536014)(8936002)(5660300002)(82960400001)(38100700002)(38070700005)(86362001)(33656002)(122000001)(71200400001)(186003)(26005)(53546011)(9686003)(6506007)(55016003)(2906002)(478600001)(7696005)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?PZMKl5ZjIa7V9nE5YwR0RpN6UHxf0Z/jujHKYRub1PVmB+VYE8MtjWRWG911?= =?us-ascii?Q?/bQ8eWg02O1ClWT9/3I6us1Eyjt2+fnxvO0RROu2Fj5GouoEk3rosWuuwdUL?= =?us-ascii?Q?jzKKHhXURux8zAzX9daQKs9O3iYIVvOzXJLqp7NsrzuL3ztabHa5KGMF5OXU?= =?us-ascii?Q?56NRI1eRN/4vWBCFu8NWdftz7aTWptxXn1Y+JbZfZygGF6vG2/AUBDjSEka5?= =?us-ascii?Q?MgiHAxWRMwiAG15wjUJ2lebYjJti0S+uYhphEo9Mw+ro7Vm6ZCXTG2OC3NYc?= =?us-ascii?Q?S8+CRWAVjAcWTnUXpt732v+Ky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kr?= =?us-ascii?Q?I0P8Y4ue7bKZktVxSxyzj11wR948EoRYwleHnrTF7YprzizMRQO8hQ/oTrCs?= =?us-ascii?Q?dN0nudQfhIg2D3OSydwnCLTXLdZD4gbPiiL4SoDWBbUumCc5/147DGtMYbjf?= =?us-ascii?Q?YhUHEEjqpI2MN3MpLNOhGlMzpDyKnfznnYFaDiM69mTkjllGFvw970Rmbvgn?= =?us-ascii?Q?yUHe4xXQXebMAKkhsaRK7i9cUmqi0Mp+ymflxmENwI+MisTOWcY32eWwfVTX?= =?us-ascii?Q?IiFO+8sSmAEcguRfcPyk3/OrSVJhHdkT6ur7WlmjTMzCQY0X7t5q26XLW93q?= =?us-ascii?Q?8TqhvcgFJNdFM1RXPirBcBfZ9OU/kurJkQIcJLW0c9l+WaQX14JbnSrC0s11?= =?us-ascii?Q?LlBOUF+Uq7mkZ9K8Fq03WQ+6DmyHWlhsvVaR88yZ?= 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: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5cec069-19fa-4490-82ae-08db034af05e X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2023 05:20:59.7933 (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: 2EGYVp2/Zn4qxmidVnnTjNy1mXA4V7TRiOQRFnFzkfm2y/qMa63y1l7lNDgxPpxoutnFAEbLKDZzHBfvvAKPFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4877 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: Maxime Coquelin > Sent: Wednesday, November 30, 2022 11:57 PM > To: dev@dpdk.org; Xia, Chenbo ; > david.marchand@redhat.com; eperezma@redhat.com > Cc: Maxime Coquelin ; stable@dpdk.org > Subject: [PATCH v1 12/21] net/virtio-user: fix device starting failure > handling >=20 > If the device fails to start, read the status from the > device and return early. >=20 > Fixes: 57912824615f ("net/virtio-user: support vhost status setting") > Cc: stable@dpdk.org >=20 > Signed-off-by: Maxime Coquelin > --- > drivers/net/virtio/virtio_user_ethdev.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/virtio/virtio_user_ethdev.c > b/drivers/net/virtio/virtio_user_ethdev.c > index d32abec327..78b1ed9ace 100644 > --- a/drivers/net/virtio/virtio_user_ethdev.c > +++ b/drivers/net/virtio/virtio_user_ethdev.c > @@ -90,10 +90,15 @@ virtio_user_set_status(struct virtio_hw *hw, uint8_t > status) > if (status & VIRTIO_CONFIG_STATUS_FEATURES_OK && > ~old_status & VIRTIO_CONFIG_STATUS_FEATURES_OK) > virtio_user_dev_set_features(dev); > - if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK) > - virtio_user_start_device(dev); > - else if (status =3D=3D VIRTIO_CONFIG_STATUS_RESET) > + > + if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK) { > + if (virtio_user_start_device(dev)) { > + virtio_user_dev_update_status(dev); > + return; > + } > + } else if (status =3D=3D VIRTIO_CONFIG_STATUS_RESET) { > virtio_user_reset(hw); > + } >=20 > virtio_user_dev_set_status(dev, status); > } > -- > 2.38.1 Reviewed-by: Chenbo Xia =20