[PATCH v2] nvmet: introduce new mdts configuration entry

Christoph Hellwig hch at lst.de
Mon Apr 6 22:23:58 PDT 2026


On Thu, Apr 02, 2026 at 01:21:08PM +0000, Aurelien Aptel wrote:
> +static inline u8 nvmet_ctrl_mdts(struct nvmet_req *req)
> +{
> +	struct nvmet_ctrl *ctrl = req->sq->ctrl;
> +	u8 mdts;
> +
> +	/* Limit MDTS according to port config or transport capability */
> +	mdts = req->port->mdts;
> +	if (ctrl->ops->get_mdts)
> +		mdts = min_not_zero(ctrl->ops->get_mdts(ctrl), mdts);
> +
> +	return mdts;

This could be simplified a little more:

/* Limit MDTS according to port config or transport capability */
+static inline u8 nvmet_ctrl_mdts(struct nvmet_req *req)
{
	struct nvmet_ctrl *ctrl = req->sq->ctrl;
	u8 mdts = req->port->mdts;

	if (!ctrl->ops->get_mdts)
		return mdts;
	return min_not_zero(ctrl->ops->get_mdts(ctrl), mdts);
}

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch at lst.de>



More information about the Linux-nvme mailing list