From patchwork Thu Apr 13 09:44:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjing Qiao X-Patchwork-Id: 126009 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E292242931; Thu, 13 Apr 2023 11:51:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D1EAC42D33; Thu, 13 Apr 2023 11:50:25 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id BCC504114B for ; Thu, 13 Apr 2023 11:50:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681379423; x=1712915423; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=na+DY3kJkdubMbrHkHHTx9PtdNDzHvcFhNbY3+/qo3k=; b=kcH8RwPMUh7+ZXkTq1zs+1tGiXV2sJWfm5kc61Yuq7G6eNIDoZYeXK/F muhhG4gsr0Qgkjwd8NrdyBRBNPjHz1OUeGfcjSx7a+bAbbQwzwsKvvnnf 04JJTjsY1kF6I7iL/Q6gT1NINibG0XBFeZeIg0A0I1xqEZSJPf0RgOJ8b n+enu9rgBvujJULWW4N0Ugm7eIHuK87QSFSVhvwEMPD9sBIcXR3T/u1AH Bz6HP2AOPHHTkU5Mdv3vzCXsxEThE42m0GmZPjQgWKnTWC8osxRwvkm3Z vMhZlP3g8LTbW6v4VC/Gf4iuV1GDNG1m5Np6tCUovxqNrOsTwruGevS0u A==; X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="409290430" X-IronPort-AV: E=Sophos;i="5.98,341,1673942400"; d="scan'208";a="409290430" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2023 02:50:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="778699284" X-IronPort-AV: E=Sophos;i="5.98,341,1673942400"; d="scan'208";a="778699284" Received: from dpdk-wenjing-01.sh.intel.com ([10.67.119.244]) by FMSMGA003.fm.intel.com with ESMTP; 13 Apr 2023 02:50:21 -0700 From: Wenjing Qiao To: jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, Wenjing Qiao , Kazatsker Kirill , Pavan Kumar Linga Subject: [PATCH 07/18] common/idpf: add virtchnl2 error codes Date: Thu, 13 Apr 2023 05:44:51 -0400 Message-Id: <20230413094502.1714755-8-wenjing.qiao@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413094502.1714755-1-wenjing.qiao@intel.com> References: <20230413094502.1714755-1-wenjing.qiao@intel.com> MIME-Version: 1.0 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 Virtchnl2 error codes are required for meaningful failure information sharing between CP and PF/VF. Introduce the necessary error codes. New error codes were introduced removing the old ones. So the references to the old one should be modified to avoid CI build failures. Use appropriate error codes wherever necessary. Signed-off-by: Kazatsker Kirill Signed-off-by: Pavan Kumar Linga Signed-off-by: Wenjing Qiao --- drivers/common/idpf/base/virtchnl2.h | 40 +++++++++++++++++++++------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/drivers/common/idpf/base/virtchnl2.h b/drivers/common/idpf/base/virtchnl2.h index edf3f200b3..415e90358e 100644 --- a/drivers/common/idpf/base/virtchnl2.h +++ b/drivers/common/idpf/base/virtchnl2.h @@ -12,14 +12,34 @@ #include "virtchnl2_lan_desc.h" -/* Error Codes - * Note that many older versions of various iAVF drivers convert the reported - * status code directly into an iavf_status enumeration. For this reason, it - * is important that the values of these enumerations line up. - */ -#define VIRTCHNL2_STATUS_SUCCESS 0 -#define VIRTCHNL2_STATUS_ERR_PARAM -5 -#define VIRTCHNL2_STATUS_ERR_OPCODE_MISMATCH -38 +/* VIRTCHNL2_ERROR_CODES */ +/* success */ +#define VIRTCHNL2_STATUS_SUCCESS 0 +/* Operation not permitted, used in case of command not permitted for sender */ +#define VIRTCHNL2_STATUS_ERR_EPERM 1 +/* Bad opcode - virtchnl interface problem */ +#define VIRTCHNL2_STATUS_ERR_ESRCH 3 +/* I/O error - HW access error */ +#define VIRTCHNL2_STATUS_ERR_EIO 5 +/* No such resource - Referenced resource is not allacated */ +#define VIRTCHNL2_STATUS_ERR_ENXIO 6 +/* Permission denied - Resource is not permitted to caller */ +#define VIRTCHNL2_STATUS_ERR_EACCES 13 +/* Device or resource busy - In case shared resource is in use by others */ +#define VIRTCHNL2_STATUS_ERR_EBUSY 16 +/* Object already exists and not free */ +#define VIRTCHNL2_STATUS_ERR_EEXIST 17 +/* Invalid input argument in command */ +#define VIRTCHNL2_STATUS_ERR_EINVAL 22 +/* No space left or allocation failure */ +#define VIRTCHNL2_STATUS_ERR_ENOSPC 28 +/* Parameter out of range */ +#define VIRTCHNL2_STATUS_ERR_ERANGE 34 + +/* Op not allowed in current dev mode */ +#define VIRTCHNL2_STATUS_ERR_EMODE 200 +/* State Machine error - Command sequence problem */ +#define VIRTCHNL2_STATUS_ERR_ESM 201 /* These macros are used to generate compilation errors if a structure/union * is not exactly the correct length. It gives a divide by zero error if the @@ -1445,11 +1465,11 @@ virtchnl2_vc_validate_vf_msg(__rte_unused struct virtchnl2_version_info *ver, u3 case VIRTCHNL2_OP_EVENT: case VIRTCHNL2_OP_UNKNOWN: default: - return VIRTCHNL2_STATUS_ERR_PARAM; + return VIRTCHNL2_STATUS_ERR_ESRCH; } /* few more checks */ if (err_msg_format || valid_len != msglen) - return VIRTCHNL2_STATUS_ERR_OPCODE_MISMATCH; + return VIRTCHNL2_STATUS_ERR_EINVAL; return 0; }