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 25D1142A02; Wed, 26 Apr 2023 12:28:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CB79442D49; Wed, 26 Apr 2023 12:28:11 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id A4C6D42D3D for ; Wed, 26 Apr 2023 12:28:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682504886; x=1714040886; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=na+DY3kJkdubMbrHkHHTx9PtdNDzHvcFhNbY3+/qo3k=; b=kNkPuwo8NqWqM/vb30amMOylFoQtA4fA8L8Rq9NJHTESCw78mW9l6CTF Mr+Fja0QpyCW5ivI7dZZQnGu1Tc8pNkwmVuMdk2c09kPnuoE74OoZ4tc8 th/X7rqMGkvkcp/ohbHsmCY0prqSSji2ZtLQFU6iqjyYvNfSNrveeZAkR nSOXAeAG8Sf4q8zO+eXZq17CUv1d1i/YSZW1cv36LtC+AWHjuDYuL+ufr dTOfa7age+GWTYWHK1G0AHYLshktAB5Hkru3Op1hLVY2JJLJmWIjB1+tR LKMICqYdYkEX6xlwY5V1yJ5k2pio7Vx3PjdqFPMjp0a5qu8fM71r8Lv/d Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10691"; a="327391526" X-IronPort-AV: E=Sophos;i="5.99,227,1677571200"; d="scan'208";a="327391526" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2023 03:28:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10691"; a="1023552705" X-IronPort-AV: E=Sophos;i="5.99,227,1677571200"; d="scan'208";a="1023552705" Received: from dpdk-wenjing-01.sh.intel.com ([10.67.118.239]) by fmsmga005.fm.intel.com with ESMTP; 26 Apr 2023 03:28:04 -0700 From: Wenjing Qiao To: jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, mingxia.liu@intel.com, Wenjing Qiao , Kazatsker Kirill , Pavan Kumar Linga Subject: [PATCH v3 07/15] common/idpf/base: add virtchnl2 error codes Date: Wed, 26 Apr 2023 06:22:51 -0400 Message-Id: <20230426102259.205992-8-wenjing.qiao@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230426102259.205992-1-wenjing.qiao@intel.com> References: <20230421084043.135503-2-wenjing.qiao@intel.com> <20230426102259.205992-1-wenjing.qiao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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; } -- 2.25.1