From: Shahaf Shuler <shahafs@mellanox.com>
To: Slava Ovsiienko <viacheslavo@mellanox.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/mlx4: fix memory region cleanup routine
Date: Thu, 18 Apr 2019 18:54:52 +0000 [thread overview]
Message-ID: <AM6PR0502MB3797D61E0CE2E4B61348318CC3260@AM6PR0502MB3797.eurprd05.prod.outlook.com> (raw)
Message-ID: <20190418185452.0UaupICRFOqugVICdcZohkzAsXcr2AxYvnFAQwqaLeU@z> (raw)
In-Reply-To: <1555317658-28091-1-git-send-email-viacheslavo@mellanox.com>
Monday, April 15, 2019 11:41 AM, Viacheslav Ovsiienko:
> Subject: [dpdk-dev] [PATCH] net/mlx4: fix memory region cleanup routine
>
> mlx4 driver has a global list of Memory Regions created by device, and there
> is a ml4_mr_release() routine which makes a memory cleanup at device
> closing. The head of device MR list was fetched outside the rwlock protected
> section. Also some noticed typos are fixed.
>
> Fixes: 9797bfcce1c9 ("net/mlx4: add new memory region support")
> Cc: stable@dpdk.org
>
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> Acked-by: Yongseok Koh <yskoh@mellanox.com>
Applied to next-net-mlx, thanks.
> ---
> drivers/net/mlx4/mlx4_mr.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/mlx4/mlx4_mr.c b/drivers/net/mlx4/mlx4_mr.c index
> ad7d483..48d458a 100644
> --- a/drivers/net/mlx4/mlx4_mr.c
> +++ b/drivers/net/mlx4/mlx4_mr.c
> @@ -477,7 +477,7 @@ struct mr_update_mp_data { }
>
> /**
> - * Releass resources of detached MR having no online entry.
> + * Release resources of detached MR having no online entry.
> *
> * @param dev
> * Pointer to Ethernet device.
> @@ -527,7 +527,7 @@ struct mr_update_mp_data { }
>
> /**
> - * Create a new global Memroy Region (MR) for a missing virtual address.
> + * Create a new global Memory Region (MR) for a missing virtual address.
> * This API should be called on a secondary process, then a request is sent to
> * the primary process in order to create a MR for the address. As the global
> MR
> * list is on the shared memory, following LKey lookup should succeed unless
> the @@ -573,7 +573,7 @@ struct mr_update_mp_data { }
>
> /**
> - * Create a new global Memroy Region (MR) for a missing virtual address.
> + * Create a new global Memory Region (MR) for a missing virtual address.
> * Register entire virtually contiguous memory chunk around the address.
> * This must be called from the primary process.
> *
> @@ -682,7 +682,7 @@ struct mr_update_mp_data {
> bmp_mem = RTE_PTR_ALIGN_CEIL(mr + 1, RTE_CACHE_LINE_SIZE);
> mr->ms_bmp = rte_bitmap_init(ms_n, bmp_mem, bmp_size);
> if (mr->ms_bmp == NULL) {
> - WARN("port %u unable to initialize bitamp for a new MR of"
> + WARN("port %u unable to initialize bitmap for a new MR of"
> " address (%p).",
> dev->data->port_id, (void *)addr);
> rte_errno = EINVAL;
> @@ -820,7 +820,7 @@ struct mr_update_mp_data { }
>
> /**
> - * Create a new global Memroy Region (MR) for a missing virtual address.
> + * Create a new global Memory Region (MR) for a missing virtual address.
> * This can be called from primary and secondary process.
> *
> * @param dev
> @@ -1434,7 +1434,7 @@ struct mr_update_mp_data {
> mlx4_mr_release(struct rte_eth_dev *dev) {
> struct mlx4_priv *priv = dev->data->dev_private;
> - struct mlx4_mr *mr_next = LIST_FIRST(&priv->mr.mr_list);
> + struct mlx4_mr *mr_next;
>
> /* Remove from memory callback device list. */
> rte_rwlock_write_lock(&mlx4_shared_data->mem_event_rwlock);
> @@ -1445,6 +1445,7 @@ struct mr_update_mp_data { #endif
> rte_rwlock_write_lock(&priv->mr.rwlock);
> /* Detach from MR list and move to free list. */
> + mr_next = LIST_FIRST(&priv->mr.mr_list);
> while (mr_next != NULL) {
> struct mlx4_mr *mr = mr_next;
>
> --
> 1.8.3.1
next prev parent reply other threads:[~2019-04-18 18:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-15 8:40 Viacheslav Ovsiienko
2019-04-15 8:40 ` Viacheslav Ovsiienko
2019-04-18 18:54 ` Shahaf Shuler [this message]
2019-04-18 18:54 ` Shahaf Shuler
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=AM6PR0502MB3797D61E0CE2E4B61348318CC3260@AM6PR0502MB3797.eurprd05.prod.outlook.com \
--to=shahafs@mellanox.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=viacheslavo@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).