From: Long Li <longli@microsoft.com>
To: Wei Hu <weh@microsoft.com>, "dev@dpdk.org" <dev@dpdk.org>,
Ferruh Yigit <ferruh.yigit@amd.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH 1/1] net/mana: add 32 bit short doorbell
Date: Wed, 13 Sep 2023 21:11:07 +0000 [thread overview]
Message-ID: <PH7PR21MB3263EB10D278B4632EF982E1CEF0A@PH7PR21MB3263.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20230909122347.2043969-1-weh@microsoft.com>
> Subject: [PATCH 1/1] net/mana: add 32 bit short doorbell
>
> Add 32 bit short doorbell support. Ring short doorbell when running in 32 bit
> applicactions.
>
> Cc: stable@dpdk.org
>
> Signed-off-by: Wei Hu <weh@microsoft.com>
Please send this patch to
Ferruh Yigit <ferruh.yigit@amd.com>
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
> drivers/net/mana/gdma.c | 95
> +++++++++++++++++++++++++++++++++++++++++
> drivers/net/mana/mana.h | 25 +++++++++++
> drivers/net/mana/rx.c | 52 ++++++++++++++++++++++
> drivers/net/mana/tx.c | 28 ++++++++++++
> 4 files changed, 200 insertions(+)
>
> diff --git a/drivers/net/mana/gdma.c b/drivers/net/mana/gdma.c index
> 65685fe236..d1da025d1b 100644
> --- a/drivers/net/mana/gdma.c
> +++ b/drivers/net/mana/gdma.c
> @@ -166,6 +166,97 @@ gdma_post_work_request(struct
> mana_gdma_queue *queue,
> return 0;
> }
>
> +#ifdef RTE_ARCH_32
> +union gdma_short_doorbell_entry {
> + uint32_t as_uint32;
> +
> + struct {
> + uint32_t tail_ptr_incr : 16; /* Number of CQEs */
> + uint32_t id : 12;
> + uint32_t reserved : 3;
> + uint32_t arm : 1;
> + } cq;
> +
> + struct {
> + uint32_t tail_ptr_incr : 16; /* In number of bytes */
> + uint32_t id : 12;
> + uint32_t reserved : 4;
> + } rq;
> +
> + struct {
> + uint32_t tail_ptr_incr : 16; /* In number of bytes */
> + uint32_t id : 12;
> + uint32_t reserved : 4;
> + } sq;
> +
> + struct {
> + uint32_t tail_ptr_incr : 16; /* Number of EQEs */
> + uint32_t id : 12;
> + uint32_t reserved : 3;
> + uint32_t arm : 1;
> + } eq;
> +}; /* HW DATA */
> +
> +enum {
> + DOORBELL_SHORT_OFFSET_SQ = 0x10,
> + DOORBELL_SHORT_OFFSET_RQ = 0x410,
> + DOORBELL_SHORT_OFFSET_CQ = 0x810,
> + DOORBELL_SHORT_OFFSET_EQ = 0xFF0,
> +};
> +
> +/*
> + * Write to hardware doorbell to notify new activity.
> + */
> +int
> +mana_ring_short_doorbell(void *db_page, enum gdma_queue_types
> queue_type,
> + uint32_t queue_id, uint32_t tail_incr, uint8_t arm) {
> + uint8_t *addr = db_page;
> + union gdma_short_doorbell_entry e = {};
> +
> + if ((queue_id & ~GDMA_SHORT_DB_QID_MASK) ||
> + (tail_incr & ~GDMA_SHORT_DB_INC_MASK)) {
> + DP_LOG(ERR, "%s: queue_id %u or "
> + "tail_incr %u overflowed, queue type %d",
> + __func__, queue_id, tail_incr, queue_type);
This should never happen.
What does "overflowed" mean? Is it a hardware error or software error? If this is a software error, the calling code needs to make sure it never overflows when using short doorbells.
Thanks,
Long
next prev parent reply other threads:[~2023-09-13 21:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-09 12:23 Wei Hu
2023-09-13 21:11 ` Long Li [this message]
2023-09-14 5:11 ` Wei Hu
2023-09-18 18:02 ` Ferruh Yigit
2023-09-19 3:38 ` Wei Hu
2023-09-19 11:27 ` Ferruh Yigit
2023-09-20 3:11 ` Wei Hu
2023-09-18 20:01 ` Long Li
2023-09-19 2:13 ` Wei Hu
2023-09-19 19:23 ` Long Li
2023-09-20 8:10 ` Wei Hu
2023-09-20 17:28 ` Long Li
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=PH7PR21MB3263EB10D278B4632EF982E1CEF0A@PH7PR21MB3263.namprd21.prod.outlook.com \
--to=longli@microsoft.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=stable@dpdk.org \
--cc=weh@microsoft.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).