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 8B410429AA; Fri, 21 Apr 2023 10:46:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E14B642D38; Fri, 21 Apr 2023 10:46:17 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id C11D842D42 for ; Fri, 21 Apr 2023 10:46:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682066775; x=1713602775; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iJS8b289BbEG/ftluEVn/OUjC0eQe2qMP8SQk1HdJwY=; b=nJLwKSGztFpPq6Su8lbNDK+pq1VDSSt+gqrlB0as/dbG6Qh6G06D2js5 j6CbJMLedcBdcqUrkuhDh4ZSi4lJ57B1y53swJCPpYnPpINCmwWIFsKXC nG/ORfBJhXCSmG0oOXL4W8LQ1+b2JZmqsn7By/SyNPqksrdk+5oiIe6tx iy4vtZF/afNEjgmHLF2eTdmf09y4xMGL3ZOop+cAbEZovATCsHQg4Hiwf DsnWRDW0w26a/O0nzgtJ0d2Tcg1zhFRKoUyUxgjRuHXVc1wrBTvo8VyaT Ncw+NnZHSjnkXZo4/sjJc436EkdKXejTR/x6vpsc/5mYvtJJNP4Cfxn2S Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="334822885" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="334822885" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 01:46:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="761501475" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="761501475" Received: from dpdk-wenjing-01.sh.intel.com ([10.67.118.239]) by fmsmga004.fm.intel.com with ESMTP; 21 Apr 2023 01:46:12 -0700 From: Wenjing Qiao To: jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, Wenjing Qiao , Charles Stoll Subject: [PATCH v2 08/15] common/idpf: swap opcode and retval location in msg struct Date: Fri, 21 Apr 2023 04:40:36 -0400 Message-Id: <20230421084043.135503-9-wenjing.qiao@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230421084043.135503-1-wenjing.qiao@intel.com> References: <20230413094502.1714755-2-wenjing.qiao@intel.com> <20230421084043.135503-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 To make the code more readable and make it clearer that the opcode goes in cookie_high and retval goes in cookie_low. Add macro definitions for filling opcode and retval. Signed-off-by: Charles Stoll Signed-off-by: Wenjing Qiao --- drivers/common/idpf/base/idpf_controlq.c | 2 ++ drivers/common/idpf/base/idpf_controlq_api.h | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/common/idpf/base/idpf_controlq.c b/drivers/common/idpf/base/idpf_controlq.c index 8e4d3ee54f..8381e4000f 100644 --- a/drivers/common/idpf/base/idpf_controlq.c +++ b/drivers/common/idpf/base/idpf_controlq.c @@ -288,6 +288,8 @@ int idpf_ctlq_deinit(struct idpf_hw *hw) * send routine via the q_msg struct / control queue specific data struct. * The control queue will hold a reference to each send message until * the completion for that message has been cleaned. + * Since all q_msgs being sent are store in native endianness, these values + * must be converted to LE before being written to the hw descriptor. */ int idpf_ctlq_send(struct idpf_hw *hw, struct idpf_ctlq_info *cq, u16 num_q_msg, struct idpf_ctlq_msg q_msg[]) diff --git a/drivers/common/idpf/base/idpf_controlq_api.h b/drivers/common/idpf/base/idpf_controlq_api.h index 32d17baadf..80be282b42 100644 --- a/drivers/common/idpf/base/idpf_controlq_api.h +++ b/drivers/common/idpf/base/idpf_controlq_api.h @@ -63,9 +63,13 @@ struct idpf_ctlq_msg { u16 status; /* when receiving a message */ }; union { +#ifndef __KERNEL__ +#define FILL_OPCODE_V1(msg, opcode) ((msg).cookie.cfg.mbx.chnl_opcode = opcode) +#define FILL_RETVAL_V1(msg, retval) ((msg).cookie.cfg.mbx.chnl_retval = retval) +#endif /* __KERNEL__ */ struct { - u32 chnl_retval; u32 chnl_opcode; + u32 chnl_retval; } mbx; } cookie; union { -- 2.25.1