From patchwork Tue Nov 1 02:22:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xing, Beilei" X-Patchwork-Id: 119377 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 1338EA00C2; Tue, 1 Nov 2022 03:53:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB60540693; Tue, 1 Nov 2022 03:53:02 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 60E7A40685 for ; Tue, 1 Nov 2022 03:53:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667271181; x=1698807181; h=from:to:cc:subject:date:message-id:reply-to:mime-version: content-transfer-encoding; bh=LOGG8zxjjfMcLmXghOqTWXmlNP4uDl8IeOV9TliLXOE=; b=ZBj8B6e5tSR4ediKFXCDaj3wVI1duBD9wxv5rjCiVSEJoqEnrR/v0Fet QgO9jn6zunBxcOr4SnNmRNHnwWFRvYtUbHas5hsxs68q5g8rzfjVk46gB JjYWu8AuKTvp33bvhRmm/UYta2Zze9grODZsu2rFY2kYKTPApejvKMMzD s7s7D5ZLzogKaF4Xo4jorKjI+RoFeB3gh0sRLzrgXF95dtfMLD0BM4YgY X3G7so3FuMO8SL94H3EMUDWKeIsIZ0K5/+WkCe+QGdwz/l2idF9DEt5Fx XDRq0XfsPqh3X+o50i1Pfdkq/NwFfHWFEbaoS71up/KvrkD0gJhOXFEeU g==; X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="309050597" X-IronPort-AV: E=Sophos;i="5.95,229,1661842800"; d="scan'208";a="309050597" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2022 19:52:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="878955073" X-IronPort-AV: E=Sophos;i="5.95,229,1661842800"; d="scan'208";a="878955073" Received: from dpdk-beileix-3.sh.intel.com ([10.67.110.253]) by fmsmga006.fm.intel.com with ESMTP; 31 Oct 2022 19:52:50 -0700 From: beilei.xing@intel.com To: jingjing.wu@intel.com Cc: dev@dpdk.org, Beilei Xing Subject: [PATCH v2] net/idpf: fix compiling error in CentOS 7 Date: Tue, 1 Nov 2022 02:22:33 +0000 Message-Id: <20221101022233.104754-1-beilei.xing@intel.com> X-Mailer: git-send-email 2.26.2 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: , Reply-To: 20221101015444.102627-1-beilei.xing@intel.com Errors-To: dev-bounces@dpdk.org From: Beilei Xing There's build error with clang 3.4.2 in CentOS 7: drivers/net/idpf/idpf_vchnl.c:141:13: error: comparison of constant 522 with expression of type 'enum virtchnl_ops' is always false [-Werror,-Wtautological-constant-out-of-range-compare] Fixed the compiling error in the patch. Fixes: 549343c25db8 ("net/idpf: support device initialization") Signed-off-by: Beilei Xing --- drivers/net/idpf/idpf_ethdev.h | 10 +++++----- drivers/net/idpf/idpf_vchnl.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/idpf/idpf_ethdev.h b/drivers/net/idpf/idpf_ethdev.h index ccdf4abe40..1efdfe4ce0 100644 --- a/drivers/net/idpf/idpf_ethdev.h +++ b/drivers/net/idpf/idpf_ethdev.h @@ -137,7 +137,7 @@ struct idpf_adapter { struct virtchnl2_version_info virtchnl_version; struct virtchnl2_get_capabilities *caps; - volatile enum virtchnl_ops pend_cmd; /* pending command not finished */ + volatile uint32_t pend_cmd; /* pending command not finished */ uint32_t cmd_retval; /* return value of the cmd response from ipf */ uint8_t *mbx_resp; /* buffer to store the mailbox response from ipf */ @@ -195,7 +195,7 @@ notify_cmd(struct idpf_adapter *adapter, int msg_ret) adapter->cmd_retval = msg_ret; /* Return value may be checked in anither thread, need to ensure the coherence. */ rte_wmb(); - adapter->pend_cmd = VIRTCHNL_OP_UNKNOWN; + adapter->pend_cmd = VIRTCHNL2_OP_UNKNOWN; } /* clear current command. Only call in case execute @@ -206,15 +206,15 @@ clear_cmd(struct idpf_adapter *adapter) { /* Return value may be checked in anither thread, need to ensure the coherence. */ rte_wmb(); - adapter->pend_cmd = VIRTCHNL_OP_UNKNOWN; + adapter->pend_cmd = VIRTCHNL2_OP_UNKNOWN; adapter->cmd_retval = VIRTCHNL_STATUS_SUCCESS; } /* Check there is pending cmd in execution. If none, set new command. */ static inline bool -atomic_set_cmd(struct idpf_adapter *adapter, enum virtchnl_ops ops) +atomic_set_cmd(struct idpf_adapter *adapter, uint32_t ops) { - enum virtchnl_ops op_unk = VIRTCHNL_OP_UNKNOWN; + uint32_t op_unk = VIRTCHNL2_OP_UNKNOWN; bool ret = __atomic_compare_exchange(&adapter->pend_cmd, &op_unk, &ops, 0, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE); diff --git a/drivers/net/idpf/idpf_vchnl.c b/drivers/net/idpf/idpf_vchnl.c index 00ac5b2a6b..ac6486d4ef 100644 --- a/drivers/net/idpf/idpf_vchnl.c +++ b/drivers/net/idpf/idpf_vchnl.c @@ -55,7 +55,7 @@ idpf_vc_clean(struct idpf_adapter *adapter) } static int -idpf_send_vc_msg(struct idpf_adapter *adapter, enum virtchnl_ops op, +idpf_send_vc_msg(struct idpf_adapter *adapter, uint32_t op, uint16_t msg_size, uint8_t *msg) { struct idpf_ctlq_msg *ctlq_msg; @@ -118,7 +118,7 @@ idpf_read_msg_from_cp(struct idpf_adapter *adapter, uint16_t buf_len, struct idpf_ctlq_msg ctlq_msg; struct idpf_dma_mem *dma_mem = NULL; enum idpf_vc_result result = IDPF_MSG_NON; - enum virtchnl_ops opcode; + uint32_t opcode; uint16_t pending = 1; int ret; @@ -132,7 +132,7 @@ idpf_read_msg_from_cp(struct idpf_adapter *adapter, uint16_t buf_len, rte_memcpy(buf, ctlq_msg.ctx.indirect.payload->va, buf_len); - opcode = (enum virtchnl_ops)rte_le_to_cpu_32(ctlq_msg.cookie.mbx.chnl_opcode); + opcode = rte_le_to_cpu_32(ctlq_msg.cookie.mbx.chnl_opcode); adapter->cmd_retval = (enum virtchnl_status_code)rte_le_to_cpu_32(ctlq_msg.cookie.mbx.chnl_retval);