From: Varun Prakash <varun@chelsio.com>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: Christoph Hellwig <hch@lst.de>, linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvmet-tcp: fix data digest pointer calculation
Date: Thu, 28 Oct 2021 16:19:48 +0530 [thread overview]
Message-ID: <20211028104947.GA1690@chelsio.com> (raw)
In-Reply-To: <9dc338a1-d047-0d48-15cd-317b637d5491@grimberg.me>
On Thu, Oct 28, 2021 at 11:26:02AM +0300, Sagi Grimberg wrote:
>
> >>>>>>diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
> >>>>>>index 07ee347..d641bfa 100644
> >>>>>>--- a/drivers/nvme/target/tcp.c
> >>>>>>+++ b/drivers/nvme/target/tcp.c
> >>>>>>@@ -702,7 +702,7 @@ static int nvmet_try_send_ddgst(struct nvmet_tcp_cmd *cmd, bool last_in_batch)
> >>>>>> struct nvmet_tcp_queue *queue = cmd->queue;
> >>>>>> struct msghdr msg = { .msg_flags = MSG_DONTWAIT };
> >>>>>> struct kvec iov = {
> >>>>>>- .iov_base = &cmd->exp_ddgst + cmd->offset,
> >>>>>>+ .iov_base = (u8 *)&cmd->exp_ddgst + cmd->offset,
> >>>>>
> >>>>>Wouldn't be the better fix to divide cmd->offset by 4 instead of the
> >>>>>casts? I can fix this up inline if that is ok.
> >>>>
> >>>>Don't really mind, what makes it a better fix?
> >>>
> >>>I generally prefer to avoid casts as they paper over bugs.
> >>
> >>I'm fine either way.
> >
> >cmd->offset can have value 0,1,2,3. cmd->offset / 4 will always be 0.
> >If 2 bytes of digest are transmitted in the first call to kernel_sendmsg()
> >then in the second call remaining 2 bytes has to be transmitted so data digest
> >buffer pointer should increase by 2 bytes.
>
> Right, so let's just change the cast to (void *). Varun, can you respin
> the patches?
Both the patches are already applied to nvme-5.15, should I send v2 or
create a new patch for u8 * -> void * change?
next prev parent reply other threads:[~2021-10-28 10:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 17:16 [PATCH] nvmet-tcp: fix data digest pointer calculation Varun Prakash
2021-10-26 13:24 ` Sagi Grimberg
2021-10-27 5:57 ` Christoph Hellwig
2021-10-27 7:11 ` Sagi Grimberg
2021-10-27 7:13 ` Christoph Hellwig
2021-10-27 9:49 ` Sagi Grimberg
2021-10-27 14:49 ` Varun Prakash
2021-10-28 8:26 ` Sagi Grimberg
2021-10-28 10:49 ` Varun Prakash [this message]
2021-10-28 14:00 ` Christoph Hellwig
2021-10-28 14:07 ` Sagi Grimberg
2021-10-27 21:37 ` Keith Busch
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=20211028104947.GA1690@chelsio.com \
--to=varun@chelsio.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