From: "Jayatheerthan, Jay" <jay.jayatheerthan@intel.com>
To: "Naga Harish K, S V" <s.v.naga.harish.k@intel.com>,
"jerinj@marvell.com" <jerinj@marvell.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] eventdev/rx_adapter: fix wrr buffer overrun issue
Date: Mon, 18 Oct 2021 11:09:26 +0000 [thread overview]
Message-ID: <DM6PR11MB4348F9297220FDED8522FC6BFDBC9@DM6PR11MB4348.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20211018082541.2742861-1-s.v.naga.harish.k@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
> -----Original Message-----
> From: Naga Harish K, S V <s.v.naga.harish.k@intel.com>
> Sent: Monday, October 18, 2021 1:56 PM
> To: jerinj@marvell.com; Jayatheerthan, Jay <jay.jayatheerthan@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH] eventdev/rx_adapter: fix wrr buffer overrun issue
>
> when a poll queue is removed from a rx_adapter instance, the wrr poll
> array is recomputed. The wrr array length is reduced in this case. The
> next wrr position to poll is stored in wrr_pos variable of rx_adapter
> instance. This wrr_pos can become invalid in some cases after wrr is
> recomputed. Using this variable to get the next queue and device pair
> may leed to wrr buffer overruns.
>
> Resetting the wrr_pos to zero after recomputation of wrr array fixes
> the buffer overrun issue.
>
> Fixes: 9c38b704d280 ("eventdev: add eth Rx adapter implementation")
>
> Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
> ---
> lib/eventdev/rte_event_eth_rx_adapter.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
> index bd68b8efe1..82a652d305 100644
> --- a/lib/eventdev/rte_event_eth_rx_adapter.c
> +++ b/lib/eventdev/rte_event_eth_rx_adapter.c
> @@ -2773,6 +2773,11 @@ rte_event_eth_rx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id,
> rx_adapter->eth_rx_poll = rx_poll;
> rx_adapter->wrr_sched = rx_wrr;
> rx_adapter->wrr_len = nb_wrr;
> + /*
> + * reset next poll start position (wrr_pos) to avoid buffer
> + * overrun when wrr_len is reduced in case of queue delete
> + */
> + rx_adapter->wrr_pos = 0;
> rx_adapter->num_intr_vec += num_intr_vec;
>
> if (dev_info->nb_dev_queues == 0) {
> --
> 2.25.1
next prev parent reply other threads:[~2021-10-18 11:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 8:25 Naga Harish K S V
2021-10-18 11:09 ` Jayatheerthan, Jay [this message]
2021-10-20 9:25 ` Jerin Jacob
-- strict thread matches above, loose matches on Subject: below --
2021-10-18 8:20 Naga Harish K S V
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=DM6PR11MB4348F9297220FDED8522FC6BFDBC9@DM6PR11MB4348.namprd11.prod.outlook.com \
--to=jay.jayatheerthan@intel.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=s.v.naga.harish.k@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).