Skip to contentSkip to conversation

nvme-tcp: fix nvme_tcp_term_pdu to match spec

PATCH Applied Caleb Sander 3 participants 3 messages Mar 20, 2023 – Mar 22, 2023 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-tcp: fix nvme_tcp_term_pdu to match spec

The FEI field of C2HTermReq/H2CTermReq is 4 bytes but not 4-byte-aligned in the NVMe/TCP specification (it is located at offset 10 in the PDU). Split it into two 16-bit integers in struct nvme_tcp_term_pdu so no padding is inserted. There should also be 10 reserved bytes after. There are currently no users of this type.

Fixes fc221d05447aa6db ("nvme-tcp: Add protocol header")
---
 include/linux/nvme-tcp.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
include/linux/nvme-tcp.h +3 -2
index 75470159a194..57ebe1267f7f 100644
@@ -113,12 +113,13 @@ struct nvme_tcp_icresp_pdu {
  * @fei:           fatal error information
  */
 struct nvme_tcp_term_pdu {
 	struct nvme_tcp_hdr	hdr;
 	__le16			fes;
-	__le32			fei;
-	__u8			rsvd[8];
+	__le16			feil;
+	__le16			feiu;
+	__u8			rsvd[10];
 };
 
 /**
  * struct nvme_tcp_cmd_pdu - nvme tcp command capsule pdu
  *
Signature · 1 line
2.25.1