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 D3695A0548; Sun, 25 Apr 2021 08:07:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9AEB140685; Sun, 25 Apr 2021 08:07:05 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 4BB154013F; Sun, 25 Apr 2021 08:07:03 +0200 (CEST) IronPort-SDR: mSKPG8BLL6k1m/QU3CfclbEgNQfAnuH75pblcHGOFBiKy6aqSprRiCFLmVia0qexz5YSW+hoPL QcmFK77cpVsQ== X-IronPort-AV: E=McAfee;i="6200,9189,9964"; a="216906889" X-IronPort-AV: E=Sophos;i="5.82,249,1613462400"; d="scan'208";a="216906889" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2021 23:07:02 -0700 IronPort-SDR: 7CJu7z8jEUuzRh/qp60gahALGqFHOm0p5hSx5uziINz0qLRxk09Vcz/mlSBI68jmEwUpJqyX38 42jpcJg/J6nA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,249,1613462400"; d="scan'208";a="446947532" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga004.fm.intel.com with ESMTP; 24 Apr 2021 23:07:02 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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.2106.2; Sat, 24 Apr 2021 23:07:01 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sat, 24 Apr 2021 23:07:01 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Sat, 24 Apr 2021 23:07:01 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.55) 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.2106.2; Sat, 24 Apr 2021 23:07:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mMzhIBc0Qkcw5wN9o9XS2tR7wiPtag+Qx9nIF7z2ZKe9jZ6EbMISj6g6ab7CrJXm54icbRASqVEKCFgQf/+HqG0HI7/TNo6SqaNyJqjc6Pc7IgPdszLiZdkCYwfZP9aEEGWSNsXWQcWAB1zf7I/JgY3UPhczFhmAWyHKr+PdclpaRVg7vntA2hHRJblx5waM9a8LJCDcRdytwpVr+qJXpaHlSwQz54/YS/SJz4KvNP3CO2jL/GsAVxhqKxT9tcU9RLKPJxXhEnT363MYcgkBED7Y+AnS68gjpDThBXuWA8lxnGtLon+ylP6pxoHYPbxpTPn75KRG5fQoUrCcSbs5iQ== 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=hcL23z7WtQurpF82d+LFDBoY2aHrwKsGDcy6Hd2d6ds=; b=G7iO0LmEUUv00DRm4+Hij46IJ3BFmg46E6kdM/IiBULHUkW5YPG0xHscwBaF3ATCduvxW4cyYNT7JHa8+OWLAUlZrkdHMXTsvkqXVEL+pCxjEm43pD9sgNO9jxBOgm+brpejdbZ40nse+4TaX4baQQoHnWt2ngy+nqQAMzNKA/bSvHLiPi/pzGobIEdDm/OpBG1egxr9LuGN4g2NLIFHnmMFxHbPloWE6cxQqh2JlK/y4tNSSGDj27KQoiVbqCS7pG98DIWh1+7MWJ+1ued4iFUU6jYIggjcs8l/0E0fzy/xOQF1D/++gUMQKMthecIMqUzyd62IwoR7+iaXHa37oA== 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=hcL23z7WtQurpF82d+LFDBoY2aHrwKsGDcy6Hd2d6ds=; b=l9+Dk/kHkjAe9d4ZomzxaRLPVzbc1+IhmbRZh58JjyMklzsKpY0zl+V9arJgx4/ATlYGzMjwZq3pdD/JEAAuu2CYP0lHUgn2TVJgHYMCt32IHbUx5ErqKHpUJ4BwG7jVkjcokNi+rhtwZok8wJjFZ765ngRQ5vrN0FiAYS3DEmg= Received: from MN2PR11MB3807.namprd11.prod.outlook.com (2603:10b6:208:f0::24) by MN2PR11MB3998.namprd11.prod.outlook.com (2603:10b6:208:137::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.23; Sun, 25 Apr 2021 06:07:00 +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.025; Sun, 25 Apr 2021 06:06:59 +0000 From: "Xing, Beilei" To: "Zhang, AlvinX" , "Wu, Jingjing" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/iavf: fix PF returning error Thread-Index: AQHXOZCRxEXjwiuJBkuif8FrvvZ046rEvYag Date: Sun, 25 Apr 2021 06:06:59 +0000 Message-ID: References: <20210425050454.12324-1-alvinx.zhang@intel.com> In-Reply-To: <20210425050454.12324-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.102.204.53] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d17020b3-80da-4671-124a-08d907b056a4 x-ms-traffictypediagnostic: MN2PR11MB3998: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ELlsaezY/OabAqxipNx3agCw0XDqEsqCUgxnWrQX/xSbNXzn9LRtPcFg0h+k7BaptGgT8WKk5gx7XEjPf5/FF7CbW03y60WvB706LCwFhs/U1rbl+OWjrVjdiUZfcl4VkDvTN5+BQzkwksoDn+cQpppPCEdShK2MqO/a8fx3lF6OxOstbzOj2P//eCrf265e8qXlydgtoDYQtb6OCsLnlqCalJt8XE4DZ6+pV6Nvga+uM/L5YNcrLJ6dYDzipaXiXZzj1Of5Hjy2FCwJCGJloW2S3gfXB2cjhX9widgx2vO5u8iJP2baGSQVhudXGNgAm3FrGJTgQERdu/5OFmY89gq4hR6fUJyeaOcHRxz4eiWm66PCKMj3GoPgmXQlOFUP8F5i9fod7dUtFnvrhdWpz4meDUMttildJRholIhH4stvL58qMNRGy+hvuZu5zb86bsP2E+VPaxamXU0p8KSrZj92KST4KqAS7LXa+p0YRLI84HR/P3hP028A6UhyoAG2qHEnQJmHOGw8Q2NdGeuqKjBoq1Mt2PCtG+oRSmPQ5/o8Xn2yRByg3HaxVM+FsyQnLM8ii06L0TDIGbWVtswYkUZRDcVOMxuYRFtaq0UAtk8= 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)(366004)(39860400002)(136003)(396003)(376002)(26005)(66946007)(64756008)(66476007)(66556008)(4326008)(66446008)(7696005)(8936002)(6636002)(86362001)(186003)(9686003)(76116006)(71200400001)(83380400001)(55016002)(53546011)(2906002)(450100002)(478600001)(33656002)(8676002)(5660300002)(122000001)(54906003)(110136005)(6506007)(316002)(38100700002)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?g0lKe1QLguebSdaRLVGulJvJrdALDpovuyWliZX9TWJlIr/wDsNZF3tfsmyn?= =?us-ascii?Q?EOItNzXwEp19a2s/OGSfhnoGJwxextY00rY5j8pPxfznfuEMi972kJeTx0Yo?= =?us-ascii?Q?lkEgEB8ZmK7JvW3EJW4rRlIWVBrEvXx8QjhP1+h/Qb7IwNjBLyk/nqeApAM8?= =?us-ascii?Q?INheF8IWw55DsF3MSjIJAD7MIcJJEciicn/978eK12zJant8tmA2lpRmYhxC?= =?us-ascii?Q?jPy92dxxGrW2lCOMOAqiLplzUyvpgg8UZ5k/YGvid5hTa/jBRB2p+yvxIXwg?= =?us-ascii?Q?KBdLzh1pk3/BmcSczsbK/gYj1i1EE/Ncv4s2VgXg1+VzGy5uKqv4JmBxW3x2?= =?us-ascii?Q?7W767DqiD5uDG8DN6oOs16/tNeTZ+mPTJNE3cQj4B6HtBR8tBTY/J5wA9sBN?= =?us-ascii?Q?OE/Zw2NARcNIMxG0BjfKcNLPCcrTxWvuNaSZklyccigGBuJ0xMeLlC2zPlDN?= =?us-ascii?Q?bVR+82gfFthNDeTLLoBbHk94NQhVK86Li85iDmyRLbzONHaDwUqASnqk1ial?= =?us-ascii?Q?arCvPYpznQFdxcn6X7G2+tlbZh22KEllBOWiS3v4uhstRV91EZWxlWtl9i3r?= =?us-ascii?Q?tnome5NVTimVmpUC0r3inpn1EVMdT6Ez/T17flCx9VxkOTxDBleI2NDWQx//?= =?us-ascii?Q?GVnIcolkegcH4013vz88nkgoxAEPbDhhf+lri0NDYCnRynrjjxDVCLolHGVv?= =?us-ascii?Q?TlS92ylPIW3SSfTT6KiGB4Ds8Y+jGG4xhkWeAQapWlGWwI+OYSVV1WCJQD0E?= =?us-ascii?Q?+rbdgnKkZ9HhiZTy9jy7nNljj5H/JxOPwjyegWjjd3aX5VncQj132sn4WUot?= =?us-ascii?Q?39SUY3ppYeVMBfv/eBbrcHqZtrL0uLdpnsE9sJFQXZOUpbr3iEiKNaEx142U?= =?us-ascii?Q?vt028+aMu3qHVARIeLAEEih/uN+B4h3QP79JlM99y0CXoHAZ7Z23y0qHu/TO?= =?us-ascii?Q?scOOYeQBuHj+bxHY7SQImiXYUtQ9H3NDkzOXFweAiXu107EK49+6meNTdATy?= =?us-ascii?Q?VD+8Ndk8e5bK3qOZZ1d2+Sw+ZlbX9ptuP/1YuuuVfqEd0tQsYlxvH/j4zNif?= =?us-ascii?Q?0NogJJxt5BrgZlBcDrJmLAjXvMlm7ctf2kyQhlSS1I7/ZQGxhldLnFDhOSy4?= =?us-ascii?Q?OBKZuzeoGEZzjX19nabBO0xTnOLK3DBe+SqI6vni1XXR11a3Dda6B3AvV6dp?= =?us-ascii?Q?DLs+5fbbBx3isDn7L9sCqW8IJw3oRYsbSshJ4DLXho4zsTKo1P852mxJDUZb?= =?us-ascii?Q?nDJaqRC6CRHXOz5iH8OS98ffjGqBnsy6JMCeLzB/oOBr3D5ziLpN6Ls7a3Ki?= =?us-ascii?Q?gW3J0ddSZEhXa1G4Tgs2d45/?= 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: d17020b3-80da-4671-124a-08d907b056a4 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2021 06:06:59.7788 (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: UNmylWjUIpKsuP94LCI9+yZGKIcKNDxj4u3qB1o+6826df/89tyjRldbIy9S/L0Q5bVlYnCr+e5q8jOUlqJHEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3998 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] 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 1:05 PM > To: Wu, Jingjing ; Xing, Beilei > Cc: dev@dpdk.org; Zhang, AlvinX ; stable@dpdk.org > Subject: [PATCH] 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 > --- > drivers/net/iavf/iavf_vchnl.c | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.= c index > 45096cb..6586fc3 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 > + (uint32_t)VIRTCHNL_STATUS_ERR_NOT_SUPPORTED) Can we change 'uint32_t cmd_retval' to 'enum virtchnl_status_code cmd_retva= l' in iavf_info structure? Then we needn't cast here. > { > + 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