From: Bruce Richardson <bruce.richardson@intel.com>
To: "Pai G, Sunil" <sunil.pai.g@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Laatz, Kevin" <kevin.laatz@intel.com>,
"stable@dpdk.org" <stable@dpdk.org>,
"Hu, Jiayu" <jiayu.hu@intel.com>
Subject: Re: [PATCH] dma/idxd: fix burst capacity calculation
Date: Mon, 10 Jan 2022 13:25:18 +0000 [thread overview]
Message-ID: <YdwzvhBUdCXWJ669@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <DM8PR11MB5605F2B8DFA7B6D84270F9E8BD509@DM8PR11MB5605.namprd11.prod.outlook.com>
On Mon, Jan 10, 2022 at 01:09:02PM +0000, Pai G, Sunil wrote:
> Hi Bruce, Kevin
>
> This patch seems to have uncovered a bug in the driver.
> On applying, the idxd_burst_capacity API seems to return 0 for cases even when there are batch descriptors and ring space available.
> Seems like there is a wraparound missing when calculating the descriptor ring space, causing this behavior.
>
> Below change seems to fix the issue.
>
> @@ -483,7 +496,7 @@ idxd_burst_capacity(const void *dev_private, uint16_t vchan __rte_unused)
> /* For descriptors, check for wrap-around on write but not read */
> if (idxd->ids_returned > write_idx)
> write_idx += idxd->desc_ring_mask + 1;
> - used_space = write_idx - idxd->ids_returned;
> + used_space = (write_idx - idxd->ids_returned)&idxd->desc_ring_mask;
>
> <snipped>
>
> Could we include this fix in the current patch ?
>
Hi Sunil,
what values for the write_idx and ids_returned vars give this error, and
how does masking help? I'd expect masking to increase the number of times
the function returns zero, rather than decreasing it.
/Bruce
next prev parent reply other threads:[~2022-01-10 13:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-20 17:05 Bruce Richardson
2022-01-04 17:16 ` Kevin Laatz
2022-01-05 1:32 ` Hu, Jiayu
2022-01-10 13:09 ` Pai G, Sunil
2022-01-10 13:25 ` Bruce Richardson [this message]
2022-01-10 13:44 ` Pai G, Sunil
2022-01-10 16:18 ` Bruce Richardson
2022-01-11 13:41 ` [PATCH v2 0/4] fixes for dma/idxd Bruce Richardson
2022-01-11 13:41 ` [PATCH v2 1/4] dma/idxd: fix burst capacity calculation Bruce Richardson
2022-01-11 13:41 ` [PATCH v2 2/4] dma/idxd: fix paths to driver sysfs directory Bruce Richardson
2022-01-11 16:50 ` Kevin Laatz
2022-01-11 13:41 ` [PATCH v2 3/4] dma/idxd: fix wrap-around in burst capacity calculation Bruce Richardson
2022-01-11 13:45 ` Pai G, Sunil
2022-01-11 16:50 ` Kevin Laatz
2022-01-11 13:41 ` [PATCH v2 4/4] test_dmadev: increase iterations of capacity test case Bruce Richardson
2022-01-11 16:50 ` Kevin Laatz
2022-01-20 13:06 ` [PATCH v2 0/4] fixes for dma/idxd Thomas Monjalon
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=YdwzvhBUdCXWJ669@bricha3-MOBL.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=jiayu.hu@intel.com \
--cc=kevin.laatz@intel.com \
--cc=stable@dpdk.org \
--cc=sunil.pai.g@intel.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).