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 28EDFA0A0E; Tue, 11 May 2021 17:39:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B70C40140; Tue, 11 May 2021 17:39:36 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 6BE684003E for ; Tue, 11 May 2021 17:39:33 +0200 (CEST) IronPort-SDR: R3z4FlDeG1TG0cmQ4XUQV5IPEL2vlEMAnwDEZFbQqAsFVaiRrZXrJin4u40GXm6FUH/g7My+Hl zVzX+TCZ69VQ== X-IronPort-AV: E=McAfee;i="6200,9189,9981"; a="179066724" X-IronPort-AV: E=Sophos;i="5.82,291,1613462400"; d="scan'208";a="179066724" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2021 08:39:31 -0700 IronPort-SDR: 2A01sj5RxynHaOdwAmJrLbQEytLFJ31VondfRtkqkFXUW/nSDxQ+j08GTHqWjuOJ9JqzWG1Xd9 f41nYKCsAH5g== X-IronPort-AV: E=Sophos;i="5.82,291,1613462400"; d="scan'208";a="537074001" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.210.166]) ([10.213.210.166]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2021 08:39:29 -0700 From: "Burakov, Anatoly" To: dev@dpdk.org, Timothy McDaniel , Beilei Xing , Jingjing Wu , Qiming Yang , Qi Zhang , Haiyue Wang , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Bruce Richardson , Konstantin Ananyev Cc: ciara.loftus@intel.com References: <819ef1ace187365a615d3383e54579e3d9fb216e.1620747068.git.anatoly.burakov@intel.com> Message-ID: Date: Tue, 11 May 2021 16:39:27 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <819ef1ace187365a615d3383e54579e3d9fb216e.1620747068.git.anatoly.burakov@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [21.08 PATCH v1 1/2] power: invert the monitor check 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" On 11-May-21 4:31 PM, Anatoly Burakov wrote: > Previously, the semantics of power monitor were such that we were > checking current value against the expected value, and if they matched, > then the sleep was aborted. This is somewhat inflexible, because it only > allowed us to check for a specific value. > > We can reverse the check, and instead have monitor sleep to be aborted > if the expected value *doesn't* match what's in memory. This allows us > to both implement all currently implemented driver code, as well as > support more use cases which don't easily map to previous semantics > (such as waiting on writes to AF_XDP counter value). > > This commit also adjusts all current driver implementations to match the > new semantics. > > Signed-off-by: Anatoly Burakov > --- > diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c > index 6cd71a44eb..3cbbe5bf59 100644 > --- a/drivers/net/mlx5/mlx5_rx.c > +++ b/drivers/net/mlx5/mlx5_rx.c > @@ -282,7 +282,7 @@ int mlx5_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc) > return -rte_errno; > } > pmc->addr = &cqe->op_own; > - pmc->val = !!idx; > + pmc->val = !idx; > pmc->mask = MLX5_CQE_OWNER_MASK; > pmc->size = sizeof(uint8_t); > return 0; Both previous and current code seem suspicious to me, as no attention is paid to endianness of the code. I would appreciate if mlx5 maintainers chimed in here :) -- Thanks, Anatoly