From: Slava Ovsiienko <viacheslavo@mellanox.com>
To: Matan Azrad <matan@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Raslan Darawsheh <rasland@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix transmit doorbell register write barrier
Date: Sun, 22 Sep 2019 10:13:37 +0000 [thread overview]
Message-ID: <AM4PR05MB326547B372D132483BDC988AD28A0@AM4PR05MB3265.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <AM0PR0502MB4019053F7AD8265AF2D35B5AD28A0@AM0PR0502MB4019.eurprd05.prod.outlook.com>
> -----Original Message-----
> From: Matan Azrad <matan@mellanox.com>
> Sent: Sunday, September 22, 2019 9:59
> To: Slava Ovsiienko <viacheslavo@mellanox.com>; dev@dpdk.org
> Cc: Raslan Darawsheh <rasland@mellanox.com>
> Subject: RE: [PATCH] net/mlx5: fix transmit doorbell register write barrier
>
> Hi Slava
>
> Questions inline.
>
[.. skipped ...]
> > + /* Check the doorbell register mapping type. */
> > + cmd = txq_ctrl->uar_mmap_offset / page_size;
> > + cmd >>= MLX5_UAR_MMAP_CMD_SHIFT;
> > + cmd &= MLX5_UAR_MMAP_CMD_MASK;
> > + if (cmd == MLX5_MMAP_GET_NC_PAGES_CMD)
> > + txq_ctrl->txq.db_nc = 1;
>
> Are you sure we can't retrieve the value in compile time?
It is deduced by rdma_core library in runtime,
grounding on the MLX5_SHUT_UP_BF environment variable.
This variable is checked by rdma library in ibv device open calls
(both verbs/dv).
>
> > #ifndef RTE_ARCH_64
> > /* Assign an UAR lock according to UAR page number */
> > lock_idx = (txq_ctrl->uar_mmap_offset / page_size) & @@ -281,6
> > +289,7 @@
> > uintptr_t uar_va;
> > uintptr_t offset;
> > const size_t page_size = sysconf(_SC_PAGESIZE);
> > + unsigned int cmd;
> >
> > assert(ppriv);
> > /*
> > @@ -300,6 +309,12 @@
> > }
> > addr = RTE_PTR_ADD(addr, offset);
> > ppriv->uar_table[txq->idx] = addr;
> > + /* Check the doorbell register mapping type. */
> > + cmd = txq_ctrl->uar_mmap_offset / page_size;
> > + cmd >>= MLX5_UAR_MMAP_CMD_SHIFT;
> > + cmd &= MLX5_UAR_MMAP_CMD_MASK;
> > + if (cmd == MLX5_MMAP_GET_NC_PAGES_CMD)
> > + txq_ctrl->txq.db_nc = 1;
>
> Looks like double code.
> Maybe it is better to get the value by a MACRO?
Yes, it would be better.
WBR, Slava
prev parent reply other threads:[~2019-09-22 10:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-18 6:54 Viacheslav Ovsiienko
2019-09-22 6:58 ` Matan Azrad
2019-09-22 10:13 ` Slava Ovsiienko [this message]
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=AM4PR05MB326547B372D132483BDC988AD28A0@AM4PR05MB3265.eurprd05.prod.outlook.com \
--to=viacheslavo@mellanox.com \
--cc=dev@dpdk.org \
--cc=matan@mellanox.com \
--cc=rasland@mellanox.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).