endian fixes for nvmet
Subsystems (2)
Christoph Hellwig
maintainerHi all,
this fixes two endian issues in the nvmet code that were added as part of adding the PCIe endpoint support.
Christoph Hellwig
maintainerPATCH 1/2 nvmet: the result field in nvmet_alloc_ctrl_args is little endian
So use the __le32 type for it.
Fixes 6202783184bf ("nvmet: Improve nvmet_alloc_ctrl() interface and implementation")
Signed-off-by Christoph Hellwig <[email protected]>
--- drivers/nvme/target/nvmet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/nvmet.h +1 -1
@@ -589,7 +589,7 @@ struct nvmet_alloc_ctrl_args {const struct nvmet_fabrics_ops *ops;struct device *p2p_client;u32 kato; -u32 result; +__le32 result;u16 error_loc;u16 status; };
Signature · 1 line
2.45.2
Re: [PATCH 1/2] nvmet: the result field in nvmet_alloc_ctrl_args is little endian
Reviewed-by Sagi Grimberg <[email protected]>
Christoph Hellwig
maintainerPATCH 2/2 nvmet: add a missing endianess conversion in nvmet_execute_admin_connect
In reply to Christoph HellwigThe kato field is little endian on the wire, but native endian in the in-core structure, add the missing byte swap.
Fixes 6202783184bf ("nvmet: Improve nvmet_alloc_ctrl() interface and implementation")
Signed-off-by Christoph Hellwig <[email protected]>
--- drivers/nvme/target/fabrics-cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/fabrics-cmd.c +1 -1
@@ -287,7 +287,7 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req) args.subsysnqn = d->subsysnqn; args.hostnqn = d->hostnqn; args.hostid = &d->hostid; - args.kato = c->kato; + args.kato =le32_to_cpu (c->kato); ctrl =nvmet_alloc_ctrl (&args);if (!ctrl)
Signature · 1 line
2.45.2
Re: [PATCH 2/2] nvmet: add a missing endianess conversion in nvmet_execute_admin_connect
Reviewed-by Sagi Grimberg <[email protected]>
Quoted 2 lines · Christoph Hellwig
this fixes two endian issues in the nvmet code that were added as part of adding the PCIe endpoint support.
Thanks, applied to nvme-6.14.