DPDK patches and discussions
 help / color / mirror / Atom feed
From: Alexander Kozyrev <akozyrev@nvidia.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	Timothy McDaniel <timothy.mcdaniel@intel.com>,
	Beilei Xing <beilei.xing@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Qiming Yang <qiming.yang@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>,
	Haiyue Wang <haiyue.wang@intel.com>,
	Matan Azrad <matan@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	Slava Ovsiienko <viacheslavo@nvidia.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>
Cc: "ciara.loftus@intel.com" <ciara.loftus@intel.com>
Subject: Re: [dpdk-dev] [21.08 PATCH v1 1/2] power: invert the monitor check
Date: Wed, 12 May 2021 17:57:13 +0000	[thread overview]
Message-ID: <DM5PR12MB2405A8370237494146AFF33EAF529@DM5PR12MB2405.namprd12.prod.outlook.com> (raw)
In-Reply-To: <e7d434d6-e160-29ce-e34e-d9fef41807ec@intel.com>

On 11-May-2021 11:39 AM, Anatoly Burakov wrote:
> 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 <anatoly.burakov@intel.com>
> > ---
> 
> <snip>
> 
> > 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 :)

It is hard to mess up with endianness when you only have 1 byte :)


  reply	other threads:[~2021-05-12 17:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 15:31 Anatoly Burakov
2021-05-11 15:31 ` [dpdk-dev] [21.08 PATCH v1 2/2] net/af_xdp: add power monitor support Anatoly Burakov
2021-05-11 15:37   ` Burakov, Anatoly
2021-05-12 10:43   ` Loftus, Ciara
2021-06-01 15:02   ` Liang Ma
2021-05-11 15:39 ` [dpdk-dev] [21.08 PATCH v1 1/2] power: invert the monitor check Burakov, Anatoly
2021-05-12 17:57   ` Alexander Kozyrev [this message]
2021-05-11 16:28 ` McDaniel, Timothy
2021-05-25  9:15 ` Liu, Yong
2021-05-27 13:06   ` Burakov, Anatoly
2021-05-28  1:07     ` Liu, Yong
2021-05-28  9:09       ` Ananyev, Konstantin
2021-06-01 14:21         ` Burakov, Anatoly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM5PR12MB2405A8370237494146AFF33EAF529@DM5PR12MB2405.namprd12.prod.outlook.com \
    --to=akozyrev@nvidia.com \
    --cc=anatoly.burakov@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=ciara.loftus@intel.com \
    --cc=dev@dpdk.org \
    --cc=haiyue.wang@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=matan@nvidia.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=shahafs@nvidia.com \
    --cc=timothy.mcdaniel@intel.com \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).