Hi Bart, We would run into the same problem implementing this in the kernel, wouldn't we? The kernel doesn't have access to the user-space enum at compile time either. The reason that I chose to implement it this way in the first place is because there is a little bit more nuance in the kernel as to whether we are accepting wrs from a qp operating in the kernel (which would use the kernel space enum) or from a qp operating in user-space. However, this library is already intentionally translating from a user-space wr to kernel space wr. Is there a specific reason duplicating the user-space enum in the kernel would be inherently better than implementing it here? Thanks, Seth Howell -----Original Message----- From: Bart Van Assche +AFs-mailto:Bart.VanAssche+AEA-wdc.com+AF0- Sent: Monday, August 13, 2018 3:26 PM To: Howell, Seth +ADs- linux-rdma+AEA-vger.kernel.org Cc: Walker, Benjamin Subject: Re: +AFs-PATCH+AF0- RXE: Add translation for kernel space enums On Mon, 2018-08-13 at 22:19 +-0000, Howell, Seth wrote: +AD4- +-enum +AHs- +AD4- +- IB+AF8-WR+AF8-RDMA+AF8-WRITE +AD0-0x00, +AD4- +- IB+AF8-WR+AF8-RDMA+AF8-WRITE+AF8-WITH+AF8-IMM +AD0-0x01, +AD4- +- IB+AF8-WR+AF8-SEND +AD0-0x02, +AD4- +- IB+AF8-WR+AF8-SEND+AF8-WITH+AF8-IMM +AD0-0x03, +AD4- +- IB+AF8-WR+AF8-RDMA+AF8-READ +AD0-0x04, +AD4- +- IB+AF8-WR+AF8-ATOMIC+AF8-CMP+AF8-AND+AF8-SWP +AD0-0x05, +AD4- +- IB+AF8-WR+AF8-ATOMIC+AF8-FETCH+AF8-AND+AF8-ADD +AD0-0x06, +AD4- +- IB+AF8-WR+AF8-LSO +AD0-0x07, +AD4- +- IB+AF8-WR+AF8-SEND+AF8-WITH+AF8-INV +AD0-0x08, +AD4- +- IB+AF8-WR+AF8-RDMA+AF8-READ+AF8-WITH+AF8-INV +AD0-0x09, +AD4- +- IB+AF8-WR+AF8-LOCAL+AF8-INV +AD0-0x0A, +AD4- +- IB+AF8-WR+AF8-REG+AF8-MR +AD0-0x0B, +AD4- +- IB+AF8-WR+AF8-MASKED+AF8-ATOMIC+AF8-CMP+AF8-AND+AF8-SWP +AD0-0x0C, +AD4- +- IB+AF8-WR+AF8-MASKED+AF8-ATOMIC+AF8-FETCH+AF8-AND+AF8-ADD +AD0-0x0D, +AD4- +- IB+AF8-WR+AF8-REG+AF8-SIG+AF8-MR +AD0-0x0E, +AD4- +- IB+AF8-WR+AF8-INVALID +AD0-0xFF +AD4- +-+AH0AOw- Why to duplicate a kernel enum in user space? Shouldn't this translation happen in the rdma+AF8-rxe kernel driver instead of in user space? Thanks, Bart.