Re: [PATCH v2] nvmet: introduce new mdts configuration entry

From: Christoph Hellwig

Date: Tue Apr 07 2026 - 01:24:08 EST


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@xxxxxx>