From: Maurizio Lombardi <mlombard@redhat.com>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: linux-nvme@lists.infradead.org, hch@lst.de, chaitanya.kulkarni@wdc.com
Subject: Re: [PATCH V2 1/3] nvmet-tcp: add an helper to free the iovec
Date: Tue, 16 Nov 2021 10:05:13 +0100 [thread overview]
Message-ID: <20211116090513.GF21836@raketa> (raw)
In-Reply-To: <eaeb64d3-1c55-27c3-3f22-e8f140164902@grimberg.me>
On Tue, Nov 16, 2021 at 11:00:56AM +0200, Sagi Grimberg wrote:
>
>
> On 11/15/21 6:31 PM, Maurizio Lombardi wrote:
> > Makes the code easier to read and to debug.
> >
> > Sets the freed pointers to NULL, it will be useful
> > when destroying the queues to understand if the
> > iovecs have been released already or not.
> >
> > Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
> > ---
> > drivers/nvme/target/tcp.c | 28 +++++++++++++++++++---------
> > 1 file changed, 19 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
> > index 84c387e4bf43..9aa81af84efa 100644
> > --- a/drivers/nvme/target/tcp.c
> > +++ b/drivers/nvme/target/tcp.c
> > @@ -166,6 +166,8 @@ static struct workqueue_struct *nvmet_tcp_wq;
> > static const struct nvmet_fabrics_ops nvmet_tcp_ops;
> > static void nvmet_tcp_free_cmd(struct nvmet_tcp_cmd *c);
> > static void nvmet_tcp_finish_cmd(struct nvmet_tcp_cmd *cmd);
> > +static void nvmet_tcp_free_iovec(struct nvmet_tcp_cmd *cmd);
> > +static void nvmet_tcp_unmap_pdu_iovec(struct nvmet_tcp_cmd *cmd);
> > static inline u16 nvmet_tcp_cmd_tag(struct nvmet_tcp_queue *queue,
> > struct nvmet_tcp_cmd *cmd)
> > @@ -297,6 +299,16 @@ static int nvmet_tcp_check_ddgst(struct nvmet_tcp_queue *queue, void *pdu)
> > return 0;
> > }
> > +static void nvmet_tcp_free_iovec(struct nvmet_tcp_cmd *cmd)
>
> I'd call it nvmet_tcp_free_cmd_buffers maybe. It is freeing
> both the data buffers, sgl vector and iovec.
Ok no problem for me, I will resubmit it.
Thanks,
Maurizio
next prev parent reply other threads:[~2021-11-16 9:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-15 16:31 [PATCH V2 0/3] Fix a race condition when performing a controller reset Maurizio Lombardi
2021-11-15 16:31 ` [PATCH V2 1/3] nvmet-tcp: add an helper to free the iovec Maurizio Lombardi
2021-11-16 9:00 ` Sagi Grimberg
2021-11-16 9:05 ` Maurizio Lombardi [this message]
2021-11-15 16:31 ` [PATCH V2 2/3] nvmet-tcp: fix a race condition between release_queue and io_work Maurizio Lombardi
2021-11-16 8:57 ` Sagi Grimberg
2021-11-15 16:31 ` [PATCH V2 3/3] nvmet-tcp: fix memory leak when performing a controller reset Maurizio Lombardi
2021-11-16 9:07 ` Sagi Grimberg
2021-11-16 9:22 ` Maurizio Lombardi
2021-11-16 10:11 ` Sagi Grimberg
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=20211116090513.GF21836@raketa \
--to=mlombard@redhat.com \
--cc=chaitanya.kulkarni@wdc.com \
--cc=hch@lst.de \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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