From: Christoph Hellwig <hch@lst.de>
To: shao.mingyin@zte.com.cn
Cc: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me,
linux-nvme@lists.infradead.org, justin.tee@broadcom.com,
nareshgottumukkala83@gmail.com, paul.ely@broadcom.com,
kch@nvidia.com, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 2/6] nvmet-tcp: only wait for in-capsule data for inline SGLs
Date: Thu, 12 Nov 2026 22:12:46 +0100 [thread overview]
Message-ID: <20261112211246.GB11126@lst.de> (raw)
In-Reply-To: <20261110230310932grXKWow1mHtiisyby_D4-@zte.com.cn>
On Tue, Nov 10, 2026 at 11:03:10PM +0800, shao.mingyin@zte.com.cn wrote:
> +/*
> + * Check whether the SGL of @cmd carries in-capsule data that the host
> + * will send right after the command PDU. Only the offset form of the
> + * data block descriptor is in-capsule; a regular transport SGL is
> + * fetched through an R2T instead.
> + */
> +static inline bool nvmet_tcp_sgl_is_inline(struct nvmet_tcp_cmd *cmd)
> +{
> + struct nvme_sgl_desc *sgl = &cmd->req.cmd->common.dptr.sgl;
> + u32 len = le32_to_cpu(sgl->length);
> +
> + return sgl->type == ((NVME_SGL_FMT_DATA_DESC << 4) |
> + NVME_SGL_FMT_OFFSET) &&
> + nvme_is_write(cmd->req.cmd) && len &&
> + len <= cmd->req.port->inline_data_size;
Nit: this would become much more readable if split into multiple
conditions instead of this giant compound expression.
Otherwise looks good.
next prev parent reply other threads:[~2026-11-12 21:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 15:03 [PATCH 0/6] nvme: fix transport request and queue error handling shao.mingyin
2026-11-10 15:03 ` [PATCH 1/6] nvme-loop: release the target request when SG setup fails shao.mingyin
2026-11-12 21:10 ` Christoph Hellwig
2026-11-10 15:03 ` [PATCH 2/6] nvmet-tcp: only wait for in-capsule data for inline SGLs shao.mingyin
2026-11-12 21:12 ` Christoph Hellwig [this message]
2026-11-10 15:03 ` [PATCH 3/6] nvme-tcp: require the R2T offset to match the data sent shao.mingyin
2026-11-12 21:13 ` Christoph Hellwig
2026-11-10 15:03 ` [PATCH 4/6] nvmet-fcloop: free the LS request when delivery fails shao.mingyin
2026-11-12 21:13 ` Christoph Hellwig
2026-11-10 15:03 ` [PATCH 5/6] nvmet-fc: reject duplicate queue IDs on Create Connection shao.mingyin
2026-11-12 21:13 ` Christoph Hellwig
2026-11-10 15:03 ` [PATCH 6/6] nvmet: roll back queue bindings on connection failure shao.mingyin
2026-11-12 21:14 ` Christoph Hellwig
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=20261112211246.GB11126@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=justin.tee@broadcom.com \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=nareshgottumukkala83@gmail.com \
--cc=paul.ely@broadcom.com \
--cc=sagi@grimberg.me \
--cc=shao.mingyin@zte.com.cn \
--cc=stable@vger.kernel.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
all inboxes | Powered by JetHome®