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 1DBCAA0548; Mon, 26 Apr 2021 03:34:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ADDBD41131; Mon, 26 Apr 2021 03:34:11 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 7C0E841110; Mon, 26 Apr 2021 03:34:10 +0200 (CEST) IronPort-SDR: ZweSj13mgafKJY50e8uGfgSxi9uajL8XoTpQHgJEL5F/jvX5AFFzVWkMouauByLPZUwRiQbk2W 01RWdLC5TeAQ== X-IronPort-AV: E=McAfee;i="6200,9189,9965"; a="195820644" X-IronPort-AV: E=Sophos;i="5.82,251,1613462400"; d="scan'208";a="195820644" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2021 18:34:09 -0700 IronPort-SDR: 0/GfF7ZtN3+/HeHYBJ/onjMDxmofKTaU7yc+PWQt72nfOF4JDA20QIS6uNtpPcg9bbjqxdoV2J CR9l4tInuVCA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,251,1613462400"; d="scan'208";a="422417164" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga008.fm.intel.com with ESMTP; 25 Apr 2021 18:34:09 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sun, 25 Apr 2021 18:34:09 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sun, 25 Apr 2021 18:34:08 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.2106.2 via Frontend Transport; Sun, 25 Apr 2021 18:34:08 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.42) 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.2106.2; Sun, 25 Apr 2021 18:34:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oDtNzmElJyZTG3EoZq/+JK8HIR5VNmtA4OK++uDaFxV7pzKgn8ZTLDsfW99ewgKFdfHFXJWDc06ONwsyzxebQi25yojF2PXC7kJKx5+Q4VePM35MqX7S14FhFvcEhXYCHQq5YSSbqU6T4iuQeSGbyH83f3j0xWxUJV4BsOh/L+JFvWOZDLu7rT6Q5O0nqTdT5VajEAzDc49AT4HnGSdBXNaVpEGDaKgBho+5t66ir6zmE7MpOm/fg9HlEELlQ/svPp/DQNoOi4qK2px8+YpXYBHv1CGddP1vieDvmMpBsWhOAfDIsjXLmsSSLy7He+tdbARz5Tj5ZoHsRCE7iIpNdg== 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-SenderADCheck; bh=MMte8c91YlGrjEv1uIljaSkF/S1+FOYd9iwNmQeOGpk=; b=iJkDZS6UW8YDN1JGw20f/HfFzf+GLc7WRlvO9x3iCL+jADCPnim6WynojRoAtTW2o+FY+BAXzQfP0d4/x7uaGggGC3tam+DWLUkqWPFFl4Dd7sUoWwPz/D+/daGfKJuxA9wp7Y6R/+K0oEQBSDBuGoHtUSZ5jnlaZCgnTwwC1geRLbGBqh/zYeDjKh+5Yc5plw+hbylxmbd3WoomY1UZbZFKkozt/+mMlwOPkSGuCCsGk9HCSP7ZdthkK4giH8VaP33PmJC+hTE89XypoXIE9VXjarbjExDtThA856puz/x+5dyZDLy0HIGWyzD7sGz9+L76ue7FBQ5JuAOInqbmAA== 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=MMte8c91YlGrjEv1uIljaSkF/S1+FOYd9iwNmQeOGpk=; b=KlG1JAxPA9pinH7uiEA/WvPwJekfl4eQeDze9zFn3jLofmxEC/dPAZv3kWwYaI+KqPuDqgvbtzBIVWaMdlUAHdIxVR4n6CKPESDKvqYZny0wy26nASKCTR5VJJfp5b1Ulz1x2PkZ68SXjcDHJ3SV9x/nPEN7DWPp5Nw9mf3m0+A= Received: from MN2PR11MB3807.namprd11.prod.outlook.com (2603:10b6:208:f0::24) by BL1PR11MB5400.namprd11.prod.outlook.com (2603:10b6:208:311::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Mon, 26 Apr 2021 01:34:04 +0000 Received: from MN2PR11MB3807.namprd11.prod.outlook.com ([fe80::e554:7a73:44fd:37b7]) by MN2PR11MB3807.namprd11.prod.outlook.com ([fe80::e554:7a73:44fd:37b7%6]) with mapi id 15.20.4065.027; Mon, 26 Apr 2021 01:34:04 +0000 From: "Xing, Beilei" To: "Zhang, AlvinX" , "Wu, Jingjing" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v2] net/iavf: fix PF returning error Thread-Index: AQHXOaYr3q2AIEtLqEevg4yzZb9bDarGBRwg Date: Mon, 26 Apr 2021 01:34:04 +0000 Message-ID: References: <20210425050454.12324-1-alvinx.zhang@intel.com> <20210425073934.14884-1-alvinx.zhang@intel.com> In-Reply-To: <20210425073934.14884-1-alvinx.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.54] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 63466d0b-4f1d-47ac-36e4-08d908536099 x-ms-traffictypediagnostic: BL1PR11MB5400: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IKGOtubZrYZ/Qv2kKYTlh8FKz1wfdaTtevRUh5StR7gmmzKFCnkTs5LDhGUFgfU+YTlJxyJCqhMMbSl6lIw//cumBkN/6h1OHYtmXoRN4SuQUuu0uw3gQMWUtkqftRNd+ggo8c0Kji161Vtgff0JGMpgF65STIjnDsDlQ6qhAZn94IV7/96T4zsLBe03xlSDhsX7gFZbzUM3PENN64yqRxHi2cRXZbhLrtfi0LOX+f7ow4qDeYfITX83oTf56uz3Z2V8IXfElzu9GBOh6hISBPLczh2uZ8ifPe5KlBb9IAduJmaZ4h7RKStTFAVnI1nMh8ejgbQW8QC35RBCFf97UCqgbMnexe1cctmSYd0+PvlOueWSXA2T9WitJjBXDDeCi7q10wydqillaHYVk2xoZeQvqy9dC/dkn6BpngpmHjSyjJyQBVeQ5Vd0X9JTqvD1z2pHG+qnXUlrQyxuVx8CByPNqOm0/YrLhBmYPMZil3BGRlTwqp5N8Sv7FkxN/7mgBbf6plF53eW/cvBiwF0nKwqkTY0USl5oCjdj1NNB1O62KIhzSq43VlNswjClEfMyfPPhTyqgx03++5G1/3y+bugAcVgWAdl/exw92jicrTg= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB3807.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(39860400002)(396003)(376002)(366004)(136003)(38100700002)(53546011)(52536014)(7696005)(33656002)(6506007)(186003)(4326008)(450100002)(2906002)(86362001)(122000001)(26005)(316002)(8676002)(9686003)(478600001)(71200400001)(110136005)(55016002)(54906003)(64756008)(66556008)(66446008)(66476007)(66946007)(76116006)(5660300002)(8936002)(6636002)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?csQ5HcK0IHs82xKPGMiMp9vBoRysjaKNTVRa9n0VXAPgBsMQRHgOFURbRBYM?= =?us-ascii?Q?IWjg+JgtHRRgyY5S1zZ/ydU0zTjlp/4l11kanhGGctsEtC+9Y7Qu8ew+PJzO?= =?us-ascii?Q?ueQ+duHUFqw4iMMBpKJ+mFmDhu94AbUKDQ7fR4ee3WbhOhhi/eKRjCa3aZXx?= =?us-ascii?Q?wTbJWXcCypoqeT3Tz6+FBf0m/Bw1Vbak7u2jCymXefzNoUOsL+VfgHMDBvOp?= =?us-ascii?Q?jTNlwkVl0by6j4DCOfEEihK6mgNYiH592MiNo/1BJwSJt9SiHq3oJNIs4MvR?= =?us-ascii?Q?M5zi7OMoEoYjvoqs4t1AEVXn2d3lNBiCBgUiCaWfBjBv5lIyrFx6CO5JvN/J?= =?us-ascii?Q?/jKAQO8pt3TPm+LibsBfJH8LcmaC5J3u1r7Xfkys3fw8g1jt89kKTCrjWXx3?= =?us-ascii?Q?VHfAFBj/jcj6VQPoOX3Y7NeAmrbiuwISWXdqjwDmJLFGbDi1hNLp89miP1+c?= =?us-ascii?Q?D4WnGvWKi+ZV8BCV/JXL5bABbhZ4XSimYgGrGNlDQK2DoFaumjT6XdEB7HQ8?= =?us-ascii?Q?UJ1RDNqjYH/gcbKofb6cLF5iQTz/RG+nC5Q97DHgJm98+uD2fJaAWIMHTpD+?= =?us-ascii?Q?sJ+NWcU81ZS3GSYcpeKlGsqMLnxq0WDxb9Qf4+JQgMiV6QYXCaEtOUjdl1pS?= =?us-ascii?Q?lHEGdTx/rY3GgUOSGIGYSTHNFSfQQpTYJ5oX3mgFAZPAb9EGdiJD/2oeDFcc?= =?us-ascii?Q?yEsvqSIf166acGi0n6fA36ceWoybIfeTH5H1S7LqZod21SULtAth7Mi9JCub?= =?us-ascii?Q?ty33Qesac1XdaatlHsLM+N/XCTiTeeOsKEuRrJ1ygb2aH4jByD9iw8knU7gH?= =?us-ascii?Q?7pPjs0sQAc9JWMjA+OHAU6CWBMsLKaMZ/SDveprbJCi2mknIR1w1tRH9oinH?= =?us-ascii?Q?sa6GrzIaSXy0z88sWtT0MSt4iuU+Vngt5cKgMQQeb8ZXDbxbR8IIsWCz+4OL?= =?us-ascii?Q?zVdQOqwHd7WybtJ4+4sN9POz/9Tu1ACnrj2uWxYhn834CFiE5GV1e+q970xX?= =?us-ascii?Q?QloLy4OvdHlmPAIPox0GC7qivTb/0Y+TnyZ40voi9zAFj1uBAJp4mgImrDBB?= =?us-ascii?Q?TQTHoDiH057j/EnypWXCYD8RU+JLYKeoPYbzCr79bwI7DDnhClSZPkmOU9oB?= =?us-ascii?Q?j3uNr1Y7TgsosDXspwH+hklIQW8u6apdEnDY/vnXPAN2zbMbGQYjy603kDJc?= =?us-ascii?Q?z9JdZAfrI6kkYyt5aRGe6lN1pOUipuCQhrdvaJPkRfMBzY7ncNHHmXvg5jz5?= =?us-ascii?Q?nE0LRGPXIpkeIlIBqfp4a+OwR3JvUvZk1E79jC+4jDcVF54CFgqZ5Ltx9VMV?= =?us-ascii?Q?yJ8=3D?= 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: MN2PR11MB3807.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63466d0b-4f1d-47ac-36e4-08d908536099 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Apr 2021 01:34:04.2699 (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: h5Nh2FTSjL2+NMBCZ4VYGmuzL+GvoWKLiKZMd2vg/tQPzwerpOI/0H/dZMs0XE6hw0Z01Ln5kxOQa6ckl8TqNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5400 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] net/iavf: fix PF returning error 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: Zhang, AlvinX > Sent: Sunday, April 25, 2021 3:40 PM > To: Wu, Jingjing ; Xing, Beilei > Cc: dev@dpdk.org; Zhang, AlvinX ; stable@dpdk.org > Subject: [PATCH v2] net/iavf: fix PF returning error >=20 > When the command sent by VF to PF fails, iavf may need to run different c= ode > paths according to the specific reason of the failure (not supported or o= ther > reasons). >=20 > This patch adds support of identifying PF return error type. >=20 > Fixes: 22b123a36d07 ("net/avf: initialize PMD") > Cc: stable@dpdk.org >=20 > Signed-off-by: Alvin Zhang > --- >=20 > v2: Refine codes according to comments. > --- > drivers/net/iavf/iavf.h | 4 ++-- > drivers/net/iavf/iavf_vchnl.c | 18 ++++++++++++------ > 2 files changed, 14 insertions(+), 8 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index > d1ae5a3..4a2e203 100644 > --- a/drivers/net/iavf/iavf.h > +++ b/drivers/net/iavf/iavf.h > @@ -144,7 +144,7 @@ struct iavf_info { > uint64_t supported_rxdid; > uint8_t *proto_xtr; /* proto xtr type for all queues */ > volatile enum virtchnl_ops pend_cmd; /* pending command not > finished */ > - uint32_t cmd_retval; /* return value of the cmd response from PF */ > + int cmd_retval; /* return value of the cmd response from PF */ > uint8_t *aq_resp; /* buffer to store the adminq response from PF */ >=20 > /* Event from pf */ > @@ -264,7 +264,7 @@ struct iavf_cmd_info { > * _atomic_set_cmd successfully. > */ > static inline void > -_notify_cmd(struct iavf_info *vf, uint32_t msg_ret) > +_notify_cmd(struct iavf_info *vf, int msg_ret) > { > vf->cmd_retval =3D msg_ret; > rte_wmb(); > diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.= c index > 45096cb..f2b46f1 100644 > --- a/drivers/net/iavf/iavf_vchnl.c > +++ b/drivers/net/iavf/iavf_vchnl.c > @@ -228,13 +228,19 @@ > rte_delay_ms(ASQ_DELAY_MS); > /* If don't read msg or read sys event, continue */ > } while (i++ < MAX_TRY_TIMES); > - /* If there's no response is received, clear command */ > - if (i >=3D MAX_TRY_TIMES || > - vf->cmd_retval !=3D VIRTCHNL_STATUS_SUCCESS) { > - err =3D -1; > - PMD_DRV_LOG(ERR, "No response or return failure > (%d)" > - " for cmd %d", vf->cmd_retval, args->ops); > + > + if (i >=3D MAX_TRY_TIMES) { > + PMD_DRV_LOG(ERR, "No response for cmd %d", args- > >ops); > _clear_cmd(vf); > + err =3D -EIO; > + } else if (vf->cmd_retval =3D=3D > + VIRTCHNL_STATUS_ERR_NOT_SUPPORTED) { > + PMD_DRV_LOG(ERR, "Cmd %d not supported", args- > >ops); > + err =3D -ENOTSUP; > + } else if (vf->cmd_retval !=3D VIRTCHNL_STATUS_SUCCESS) { > + PMD_DRV_LOG(ERR, "Return failure %d for cmd %d", > + vf->cmd_retval, args->ops); > + err =3D -EINVAL; > } > break; > } > -- > 1.8.3.1 Acked-by: Beilei Xing