diff mbox series

cxl/uapi: Add warning on CXL command enum

Message ID 20221208000141.701642-1-ira.weiny@intel.com
State Accepted
Commit 11ef026e467b05eac0a2ceb981d351ddc4b12216
Headers show
Series cxl/uapi: Add warning on CXL command enum | expand

Commit Message

Ira Weiny Dec. 8, 2022, 12:01 a.m. UTC
From: Ira Weiny <ira.weiny@intel.com>

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.

Suggested-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
 include/uapi/linux/cxl_mem.h | 4 ++++
 1 file changed, 4 insertions(+)


base-commit: acb704099642bc822ef2aed223a0b8db1f7ea76e

Comments

Dave Jiang Dec. 8, 2022, 12:27 a.m. UTC | #1
On 12/7/2022 5:01 PM, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
> 
> 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.
> 
> Suggested-by: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>

> ---
>   include/uapi/linux/cxl_mem.h | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/include/uapi/linux/cxl_mem.h b/include/uapi/linux/cxl_mem.h
> index c71021a2a9ed..459a3f7f764b 100644
> --- a/include/uapi/linux/cxl_mem.h
> +++ b/include/uapi/linux/cxl_mem.h
> @@ -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
Jonathan Cameron Dec. 8, 2022, 10:41 a.m. UTC | #2
On Wed, 7 Dec 2022 17:27:18 -0700
Dave Jiang <dave.jiang@intel.com> wrote:

> On 12/7/2022 5:01 PM, ira.weiny@intel.com wrote:
> > From: Ira Weiny <ira.weiny@intel.com>
> > 
> > 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.
> > 
> > Suggested-by: Dan Williams <dan.j.williams@intel.com>
> > Signed-off-by: Ira Weiny <ira.weiny@intel.com>  
> 
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Good to have.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> 
> > ---
> >   include/uapi/linux/cxl_mem.h | 4 ++++
> >   1 file changed, 4 insertions(+)
> > 
> > diff --git a/include/uapi/linux/cxl_mem.h b/include/uapi/linux/cxl_mem.h
> > index c71021a2a9ed..459a3f7f764b 100644
> > --- a/include/uapi/linux/cxl_mem.h
> > +++ b/include/uapi/linux/cxl_mem.h
> > @@ -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
diff mbox series

Patch

diff --git a/include/uapi/linux/cxl_mem.h b/include/uapi/linux/cxl_mem.h
index c71021a2a9ed..459a3f7f764b 100644
--- a/include/uapi/linux/cxl_mem.h
+++ b/include/uapi/linux/cxl_mem.h
@@ -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"),                               \