From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Richardson, Bruce" <bruce.richardson@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH v2 1/4] net/i40e: fix buffer leak on Rx reconfiguration
Date: Fri, 1 Sep 2023 07:12:14 +0000 [thread overview]
Message-ID: <DM4PR11MB599476A2CE7C2926B2447E8DD7E4A@DM4PR11MB5994.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230831123337.871496-2-bruce.richardson@intel.com>
> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson@intel.com>
> Sent: Thursday, August 31, 2023 8:34 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH v2 1/4] net/i40e: fix buffer leak on Rx reconfiguration
>
> When reconfiguring a single queue on a device, the mbuf initializer value was
> not getting set, and remained at zero. This lead to mbuf leaks as the refcount
> was incorrect (0), so on free it wrapped around to UINT16_MAX. When
> setting up the mbuf initializer, also ensure that the queue is explicitly marked
> as using a vector function by setting the "rx_using_sse" flag.
>
> Fixes: a3c83a2527e1 ("net/i40e: enable runtime queue setup")
> Cc: qi.z.zhang@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> drivers/net/i40e/i40e_rxtx.c | 6 ++++++
> drivers/net/i40e/i40e_rxtx_vec_common.h | 1 +
> 2 files changed, 7 insertions(+)
>
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index
> b4f65b58fa..d96bbbb677 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -1918,6 +1918,12 @@ i40e_dev_rx_queue_setup_runtime(struct
> rte_eth_dev *dev,
> if (use_def_burst_func)
> ad->rx_bulk_alloc_allowed = false;
> i40e_set_rx_function(dev);
> +
> + if (ad->rx_vec_allowed && i40e_rxq_vec_setup(rxq)) {
> + PMD_DRV_LOG(ERR, "Failed vector rx setup.");
> + return -EINVAL;
> + }
> +
> return 0;
> } else if (ad->rx_vec_allowed && !rte_is_power_of_2(rxq-
> >nb_rx_desc)) {
> PMD_DRV_LOG(ERR, "Vector mode is allowed, but
> descriptor"
> diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h
> b/drivers/net/i40e/i40e_rxtx_vec_common.h
> index fe1a6ec75e..8b745630e4 100644
> --- a/drivers/net/i40e/i40e_rxtx_vec_common.h
> +++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
> @@ -201,6 +201,7 @@ i40e_rxq_vec_setup_default(struct i40e_rx_queue
> *rxq)
> rte_compiler_barrier();
> p = (uintptr_t)&mb_def.rearm_data;
> rxq->mbuf_initializer = *(uint64_t *)p;
> + rxq->rx_using_sse = 1;
I saw some further code clean can be done by leveraging this change.
> return 0;
> }
>
> --
> 2.39.2
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
next prev parent reply other threads:[~2023-09-01 7:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230830155919.592390-1-bruce.richardson@intel.com>
2023-08-30 15:59 ` [PATCH " Bruce Richardson
2023-08-30 15:59 ` [PATCH 2/4] net/iavf: fix buffer leak on Tx queue stop Bruce Richardson
2023-08-30 15:59 ` [PATCH 3/4] net/iavf: fix restart of Rx queue on reconfigure Bruce Richardson
[not found] ` <20230831123337.871496-1-bruce.richardson@intel.com>
2023-08-31 12:33 ` [PATCH v2 1/4] net/i40e: fix buffer leak on Rx reconfiguration Bruce Richardson
2023-09-01 7:12 ` Zhang, Qi Z [this message]
2023-08-31 12:33 ` [PATCH v2 2/4] net/iavf: fix buffer leak on Tx queue stop Bruce Richardson
2023-09-04 2:17 ` Lu, Wenzhuo
2023-09-04 2:30 ` Zhang, Qi Z
2023-08-31 12:33 ` [PATCH v2 3/4] net/iavf: fix restart of Rx queue on reconfigure Bruce Richardson
2023-09-04 1:15 ` Zhang, Qi Z
2023-09-04 1:30 ` Zhang, Qi Z
2023-09-04 7:54 ` Bruce Richardson
2023-09-05 0:02 ` Zhang, Qi Z
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=DM4PR11MB599476A2CE7C2926B2447E8DD7E4A@DM4PR11MB5994.namprd11.prod.outlook.com \
--to=qi.z.zhang@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/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).