Skip to contentSkip to conversation

cxl/uapi: Add warning on CXL command enum

PATCH In review [email protected] 3 participants 3 messages Dec 8, 2022 CXL

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl/uapi: Add warning on CXL command enum

From: Ira Weiny <[email protected]>

The CXL command enum is exported to user space and must maintain backwards compatibility.

Add comment that new defines must be added to the end of the list.

---
 include/uapi/linux/cxl_mem.h | 4 ++++
 1 file changed, 4 insertions(+)
include/uapi/linux/cxl_mem.h +4 -0
index c71021a2a9ed..459a3f7f764b 100644
@@ -19,6 +19,10 @@
 #define CXL_MEM_QUERY_COMMANDS _IOR(0xCE, 1, struct cxl_mem_query_commands)
 #define CXL_MEM_SEND_COMMAND _IOWR(0xCE, 2, struct cxl_send_command)
 
+/*
+ * NOTE: New defines must be added to the end of the list to preserve
+ * compatibility because this enum is exported to user space.
+ */
 #define CXL_CMDS                                                          \
 	___C(INVALID, "Invalid Command"),                                 \
 	___C(IDENTIFY, "Identify Command"),                               \

base-commit: acb704099642bc822ef2aed223a0b8db1f7ea76e

Signature · 1 line
2.37.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · On 12/7/2022 5:01 PM, [email protected] wrote:

From: Ira Weiny <[email protected]>

The CXL command enum is exported to user space and must maintain backwards compatibility.

Add comment that new defines must be added to the end of the list.

Quoted 21 lines
---
  include/uapi/linux/cxl_mem.h | 4 ++++
  1 file changed, 4 insertions(+)
include/uapi/linux/cxl_mem.h +4 -0
index c71021a2a9ed..459a3f7f764b 100644
@@ -19,6 +19,10 @@
  #define CXL_MEM_QUERY_COMMANDS _IOR(0xCE, 1, struct cxl_mem_query_commands)
  #define CXL_MEM_SEND_COMMAND _IOWR(0xCE, 2, struct cxl_send_command)
 
+/*
+ * NOTE: New defines must be added to the end of the list to preserve
+ * compatibility because this enum is exported to user space.
+ */
  #define CXL_CMDS                                                          \
  	___C(INVALID, "Invalid Command"),                                 \
  	___C(IDENTIFY, "Identify Command"),                               \

base-commit: acb704099642bc822ef2aed223a0b8db1f7ea76e

Reviewed-by
#2 lore raw
Quoted 6 lines · On Wed, 7 Dec 2022 17:27:18 -0700 Dave Jiang <[email protected]> wrote:
Quoted 5 lines · On 12/7/2022 5:01 PM, [email protected] wrote:

From: Ira Weiny <[email protected]>

The CXL command enum is exported to user space and must maintain backwards compatibility.

Quoted 6 lines
Quoted 4 lines

Add comment that new defines must be added to the end of the list.

Good to have.

Quoted 22 lines
Quoted 22 lines
---
  include/uapi/linux/cxl_mem.h | 4 ++++
  1 file changed, 4 insertions(+)
include/uapi/linux/cxl_mem.h +4 -0
index c71021a2a9ed..459a3f7f764b 100644
@@ -19,6 +19,10 @@
  #define CXL_MEM_QUERY_COMMANDS _IOR(0xCE, 1, struct cxl_mem_query_commands)
  #define CXL_MEM_SEND_COMMAND _IOWR(0xCE, 2, struct cxl_send_command)
 
+/*
+ * NOTE: New defines must be added to the end of the list to preserve
+ * compatibility because this enum is exported to user space.
+ */
  #define CXL_CMDS                                                          \
  	___C(INVALID, "Invalid Command"),                                 \
  	___C(IDENTIFY, "Identify Command"),                               \

base-commit: acb704099642bc822ef2aed223a0b8db1f7ea76e