* [PATCH 1/2] IB/uverbs: Move enum ib_raw_packet_caps to uapi @ 2022-03-19 17:03 Xiao Yang 2022-03-19 17:03 ` [PATCH 2/2] IB/uverbs: Move part of enum ib_device_cap_flags " Xiao Yang 2022-03-21 13:14 ` [PATCH 1/2] IB/uverbs: Move enum ib_raw_packet_caps " Jason Gunthorpe 0 siblings, 2 replies; 4+ messages in thread From: Xiao Yang @ 2022-03-19 17:03 UTC (permalink / raw) To: jgg, leon; +Cc: linux-rdma, Xiao Yang This enum are used by ibv_query_device_ex(3) so it should be defined in include/uapi/rdma/ib_user_verbs.h. Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com> --- include/rdma/ib_verbs.h | 22 +++++++++++++++------- include/uapi/rdma/ib_user_verbs.h | 7 +++++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 69d883f7fb41..e5455f6e0d82 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1620,20 +1620,28 @@ struct ib_srq { struct rdma_restrack_entry res; }; +/* This enum is shared with userspace */ enum ib_raw_packet_caps { - /* Strip cvlan from incoming packet and report it in the matching work + /* + * Strip cvlan from incoming packet and report it in the matching work * completion is supported. */ - IB_RAW_PACKET_CAP_CVLAN_STRIPPING = (1 << 0), - /* Scatter FCS field of an incoming packet to host memory is supported. + IB_RAW_PACKET_CAP_CVLAN_STRIPPING = + IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING, + /* + * Scatter FCS field of an incoming packet to host memory is supported. */ - IB_RAW_PACKET_CAP_SCATTER_FCS = (1 << 1), + IB_RAW_PACKET_CAP_SCATTER_FCS = + IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS, /* Checksum offloads are supported (for both send and receive). */ - IB_RAW_PACKET_CAP_IP_CSUM = (1 << 2), - /* When a packet is received for an RQ with no receive WQEs, the + IB_RAW_PACKET_CAP_IP_CSUM = + IB_UVERBS_RAW_PACKET_CAP_IP_CSUM, + /* + * When a packet is received for an RQ with no receive WQEs, the * packet processing is delayed. */ - IB_RAW_PACKET_CAP_DELAY_DROP = (1 << 3), + IB_RAW_PACKET_CAP_DELAY_DROP = + IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP, }; enum ib_wq_type { diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index 7ee73a0652f1..0660405ca2cb 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/rdma/ib_user_verbs.h @@ -1298,4 +1298,11 @@ struct ib_uverbs_ex_modify_cq { #define IB_DEVICE_NAME_MAX 64 +enum ib_uverbs_raw_packet_caps { + IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING = (1 << 0), + IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS = (1 << 1), + IB_UVERBS_RAW_PACKET_CAP_IP_CSUM = (1 << 2), + IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP = (1 << 3), +}; + #endif /* IB_USER_VERBS_H */ -- 2.23.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] IB/uverbs: Move part of enum ib_device_cap_flags to uapi 2022-03-19 17:03 [PATCH 1/2] IB/uverbs: Move enum ib_raw_packet_caps to uapi Xiao Yang @ 2022-03-19 17:03 ` Xiao Yang 2022-03-21 13:18 ` Jason Gunthorpe 2022-03-21 13:14 ` [PATCH 1/2] IB/uverbs: Move enum ib_raw_packet_caps " Jason Gunthorpe 1 sibling, 1 reply; 4+ messages in thread From: Xiao Yang @ 2022-03-19 17:03 UTC (permalink / raw) To: jgg, leon; +Cc: linux-rdma, Xiao Yang Part of enum ib_device_cap_flags are used by ibv_query_device(3) or ibv_query_device_ex(3), so we define them in include/uapi/rdma/ib_user_verbs.h and only expose them to userspace. Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com> --- drivers/infiniband/core/uverbs_cmd.c | 6 +- include/rdma/ib_verbs.h | 82 +++++++++++++++++++--------- include/uapi/rdma/ib_user_verbs.h | 31 +++++++++++ 3 files changed, 91 insertions(+), 28 deletions(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 6b6393176b3c..ca1045c28fad 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -337,7 +337,8 @@ static void copy_query_dev_fields(struct ib_ucontext *ucontext, resp->hw_ver = attr->hw_ver; resp->max_qp = attr->max_qp; resp->max_qp_wr = attr->max_qp_wr; - resp->device_cap_flags = lower_32_bits(attr->device_cap_flags); + resp->device_cap_flags = lower_32_bits(attr->device_cap_flags & + UVERBS_DEVICE_CAP_FLAGS_MASK); resp->max_sge = min(attr->max_send_sge, attr->max_recv_sge); resp->max_sge_rd = attr->max_sge_rd; resp->max_cq = attr->max_cq; @@ -3618,7 +3619,8 @@ static int ib_uverbs_ex_query_device(struct uverbs_attr_bundle *attrs) resp.timestamp_mask = attr.timestamp_mask; resp.hca_core_clock = attr.hca_core_clock; - resp.device_cap_flags_ex = attr.device_cap_flags; + resp.device_cap_flags_ex = attr.device_cap_flags & + UVERBS_DEVICE_CAP_FLAGS_MASK; resp.rss_caps.supported_qpts = attr.rss_caps.supported_qpts; resp.rss_caps.max_rwq_indirection_tables = attr.rss_caps.max_rwq_indirection_tables; diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index e5455f6e0d82..54f0045942ca 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -219,22 +219,41 @@ enum rdma_link_layer { IB_LINK_LAYER_ETHERNET, }; +#define UVERBS_DEVICE_CAP_FLAGS_MASK 0x1427B67FFF + enum ib_device_cap_flags { - IB_DEVICE_RESIZE_MAX_WR = (1 << 0), - IB_DEVICE_BAD_PKEY_CNTR = (1 << 1), - IB_DEVICE_BAD_QKEY_CNTR = (1 << 2), - IB_DEVICE_RAW_MULTI = (1 << 3), - IB_DEVICE_AUTO_PATH_MIG = (1 << 4), - IB_DEVICE_CHANGE_PHY_PORT = (1 << 5), - IB_DEVICE_UD_AV_PORT_ENFORCE = (1 << 6), - IB_DEVICE_CURR_QP_STATE_MOD = (1 << 7), - IB_DEVICE_SHUTDOWN_PORT = (1 << 8), - /* Not in use, former INIT_TYPE = (1 << 9),*/ - IB_DEVICE_PORT_ACTIVE_EVENT = (1 << 10), - IB_DEVICE_SYS_IMAGE_GUID = (1 << 11), - IB_DEVICE_RC_RNR_NAK_GEN = (1 << 12), - IB_DEVICE_SRQ_RESIZE = (1 << 13), - IB_DEVICE_N_NOTIFY_CQ = (1 << 14), + IB_DEVICE_RESIZE_MAX_WR = + IB_UVERBS_DEVICE_RESIZE_MAX_WR, + IB_DEVICE_BAD_PKEY_CNTR = + IB_UVERBS_DEVICE_BAD_PKEY_CNTR, + IB_DEVICE_BAD_QKEY_CNTR = + IB_UVERBS_DEVICE_BAD_QKEY_CNTR, + IB_DEVICE_RAW_MULTI = + IB_UVERBS_DEVICE_RAW_MULTI, + IB_DEVICE_AUTO_PATH_MIG = + IB_UVERBS_DEVICE_AUTO_PATH_MIG, + IB_DEVICE_CHANGE_PHY_PORT = + IB_UVERBS_DEVICE_CHANGE_PHY_PORT, + IB_DEVICE_UD_AV_PORT_ENFORCE = + IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE, + IB_DEVICE_CURR_QP_STATE_MOD = + IB_UVERBS_DEVICE_CURR_QP_STATE_MOD, + IB_DEVICE_SHUTDOWN_PORT = + IB_UVERBS_DEVICE_SHUTDOWN_PORT, + /* + * IB_DEVICE_INIT_TYPE = + * IB_UVERBS_DEVICE_INIT_TYPE, (not in use) + */ + IB_DEVICE_PORT_ACTIVE_EVENT = + IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT, + IB_DEVICE_SYS_IMAGE_GUID = + IB_UVERBS_DEVICE_SYS_IMAGE_GUID, + IB_DEVICE_RC_RNR_NAK_GEN = + IB_UVERBS_DEVICE_RC_RNR_NAK_GEN, + IB_DEVICE_SRQ_RESIZE = + IB_UVERBS_DEVICE_SRQ_RESIZE, + IB_DEVICE_N_NOTIFY_CQ = + IB_UVERBS_DEVICE_N_NOTIFY_CQ, /* * This device supports a per-device lkey or stag that can be @@ -245,7 +264,8 @@ enum ib_device_cap_flags { */ IB_DEVICE_LOCAL_DMA_LKEY = (1 << 15), /* Reserved, old SEND_W_INV = (1 << 16),*/ - IB_DEVICE_MEM_WINDOW = (1 << 17), + IB_DEVICE_MEM_WINDOW = + IB_UVERBS_DEVICE_MEM_WINDOW, /* * Devices should set IB_DEVICE_UD_IP_SUM if they support * insertion of UDP and TCP checksum on outgoing UD IPoIB @@ -253,9 +273,11 @@ enum ib_device_cap_flags { * incoming messages. Setting this flag implies that the * IPoIB driver may set NETIF_F_IP_CSUM for datagram mode. */ - IB_DEVICE_UD_IP_CSUM = (1 << 18), + IB_DEVICE_UD_IP_CSUM = + IB_UVERBS_DEVICE_UD_IP_CSUM, IB_DEVICE_UD_TSO = (1 << 19), - IB_DEVICE_XRC = (1 << 20), + IB_DEVICE_XRC = + IB_UVERBS_DEVICE_XRC, /* * This device supports the IB "base memory management extension", @@ -266,13 +288,18 @@ enum ib_device_cap_flags { * IB_WR_RDMA_READ_WITH_INV verb for RDMA READs that invalidate the * stag. */ - IB_DEVICE_MEM_MGT_EXTENSIONS = (1 << 21), + IB_DEVICE_MEM_MGT_EXTENSIONS = + IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS, IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1 << 22), - IB_DEVICE_MEM_WINDOW_TYPE_2A = (1 << 23), - IB_DEVICE_MEM_WINDOW_TYPE_2B = (1 << 24), - IB_DEVICE_RC_IP_CSUM = (1 << 25), + IB_DEVICE_MEM_WINDOW_TYPE_2A = + IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A, + IB_DEVICE_MEM_WINDOW_TYPE_2B = + IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B, + IB_DEVICE_RC_IP_CSUM = + IB_UVERBS_DEVICE_RC_IP_CSUM, /* Deprecated. Please use IB_RAW_PACKET_CAP_IP_CSUM. */ - IB_DEVICE_RAW_IP_CSUM = (1 << 26), + IB_DEVICE_RAW_IP_CSUM = + IB_UVERBS_DEVICE_RAW_IP_CSUM, /* * Devices should set IB_DEVICE_CROSS_CHANNEL if they * support execution of WQEs that involve synchronization @@ -280,16 +307,19 @@ enum ib_device_cap_flags { * by hardware. */ IB_DEVICE_CROSS_CHANNEL = (1 << 27), - IB_DEVICE_MANAGED_FLOW_STEERING = (1 << 29), + IB_DEVICE_MANAGED_FLOW_STEERING = + IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING, IB_DEVICE_INTEGRITY_HANDOVER = (1 << 30), IB_DEVICE_ON_DEMAND_PAGING = (1ULL << 31), IB_DEVICE_SG_GAPS_REG = (1ULL << 32), IB_DEVICE_VIRTUAL_FUNCTION = (1ULL << 33), /* Deprecated. Please use IB_RAW_PACKET_CAP_SCATTER_FCS. */ - IB_DEVICE_RAW_SCATTER_FCS = (1ULL << 34), + IB_DEVICE_RAW_SCATTER_FCS = + IB_UVERBS_DEVICE_RAW_SCATTER_FCS, IB_DEVICE_RDMA_NETDEV_OPA = (1ULL << 35), /* The device supports padding incoming writes to cacheline. */ - IB_DEVICE_PCI_WRITE_END_PADDING = (1ULL << 36), + IB_DEVICE_PCI_WRITE_END_PADDING = + IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING, IB_DEVICE_ALLOW_USER_UNREG = (1ULL << 37), }; diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index 0660405ca2cb..18a0678d3aec 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/rdma/ib_user_verbs.h @@ -1298,6 +1298,37 @@ struct ib_uverbs_ex_modify_cq { #define IB_DEVICE_NAME_MAX 64 +enum ib_uverbs_device_cap_flags { + IB_UVERBS_DEVICE_RESIZE_MAX_WR = (1 << 0), + IB_UVERBS_DEVICE_BAD_PKEY_CNTR = (1 << 1), + IB_UVERBS_DEVICE_BAD_QKEY_CNTR = (1 << 2), + IB_UVERBS_DEVICE_RAW_MULTI = (1 << 3), + IB_UVERBS_DEVICE_AUTO_PATH_MIG = (1 << 4), + IB_UVERBS_DEVICE_CHANGE_PHY_PORT = (1 << 5), + IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE = (1 << 6), + IB_UVERBS_DEVICE_CURR_QP_STATE_MOD = (1 << 7), + IB_UVERBS_DEVICE_SHUTDOWN_PORT = (1 << 8), + /* IB_UVERBS_DEVICE_INIT_TYPE = (1 << 9), (not in use) */ + IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT = (1 << 10), + IB_UVERBS_DEVICE_SYS_IMAGE_GUID = (1 << 11), + IB_UVERBS_DEVICE_RC_RNR_NAK_GEN = (1 << 12), + IB_UVERBS_DEVICE_SRQ_RESIZE = (1 << 13), + IB_UVERBS_DEVICE_N_NOTIFY_CQ = (1 << 14), + IB_UVERBS_DEVICE_MEM_WINDOW = (1 << 17), + IB_UVERBS_DEVICE_UD_IP_CSUM = (1 << 18), + IB_UVERBS_DEVICE_XRC = (1 << 20), + IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS = (1 << 21), + IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A = (1 << 23), + IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B = (1 << 24), + IB_UVERBS_DEVICE_RC_IP_CSUM = (1 << 25), + /* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_IP_CSUM. */ + IB_UVERBS_DEVICE_RAW_IP_CSUM = (1 << 26), + IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING = (1 << 29), + /* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS. */ + IB_UVERBS_DEVICE_RAW_SCATTER_FCS = (1ULL << 34), + IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING = (1ULL << 36), +}; + enum ib_uverbs_raw_packet_caps { IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING = (1 << 0), IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS = (1 << 1), -- 2.23.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] IB/uverbs: Move part of enum ib_device_cap_flags to uapi 2022-03-19 17:03 ` [PATCH 2/2] IB/uverbs: Move part of enum ib_device_cap_flags " Xiao Yang @ 2022-03-21 13:18 ` Jason Gunthorpe 0 siblings, 0 replies; 4+ messages in thread From: Jason Gunthorpe @ 2022-03-21 13:18 UTC (permalink / raw) To: Xiao Yang; +Cc: leon, linux-rdma On Sun, Mar 20, 2022 at 01:03:51AM +0800, Xiao Yang wrote: > Part of enum ib_device_cap_flags are used by ibv_query_device(3) > or ibv_query_device_ex(3), so we define them in > include/uapi/rdma/ib_user_verbs.h and only expose them to userspace. > > Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com> > drivers/infiniband/core/uverbs_cmd.c | 6 +- > include/rdma/ib_verbs.h | 82 +++++++++++++++++++--------- > include/uapi/rdma/ib_user_verbs.h | 31 +++++++++++ > 3 files changed, 91 insertions(+), 28 deletions(-) > > diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c > index 6b6393176b3c..ca1045c28fad 100644 > +++ b/drivers/infiniband/core/uverbs_cmd.c > @@ -337,7 +337,8 @@ static void copy_query_dev_fields(struct ib_ucontext *ucontext, > resp->hw_ver = attr->hw_ver; > resp->max_qp = attr->max_qp; > resp->max_qp_wr = attr->max_qp_wr; > - resp->device_cap_flags = lower_32_bits(attr->device_cap_flags); > + resp->device_cap_flags = lower_32_bits(attr->device_cap_flags & > + UVERBS_DEVICE_CAP_FLAGS_MASK); > resp->max_sge = min(attr->max_send_sge, attr->max_recv_sge); > resp->max_sge_rd = attr->max_sge_rd; > resp->max_cq = attr->max_cq; > @@ -3618,7 +3619,8 @@ static int ib_uverbs_ex_query_device(struct uverbs_attr_bundle *attrs) > > resp.timestamp_mask = attr.timestamp_mask; > resp.hca_core_clock = attr.hca_core_clock; > - resp.device_cap_flags_ex = attr.device_cap_flags; > + resp.device_cap_flags_ex = attr.device_cap_flags & > + UVERBS_DEVICE_CAP_FLAGS_MASK; > resp.rss_caps.supported_qpts = attr.rss_caps.supported_qpts; > resp.rss_caps.max_rwq_indirection_tables = > attr.rss_caps.max_rwq_indirection_tables; > diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h > index e5455f6e0d82..54f0045942ca 100644 > +++ b/include/rdma/ib_verbs.h > @@ -219,22 +219,41 @@ enum rdma_link_layer { > IB_LINK_LAYER_ETHERNET, > }; > > +#define UVERBS_DEVICE_CAP_FLAGS_MASK 0x1427B67FFF This needs to be expressed as a | of constants > enum ib_device_cap_flags { > - IB_DEVICE_RESIZE_MAX_WR = (1 << 0), > - IB_DEVICE_BAD_PKEY_CNTR = (1 << 1), > - IB_DEVICE_BAD_QKEY_CNTR = (1 << 2), > - IB_DEVICE_RAW_MULTI = (1 << 3), > - IB_DEVICE_AUTO_PATH_MIG = (1 << 4), > - IB_DEVICE_CHANGE_PHY_PORT = (1 << 5), > - IB_DEVICE_UD_AV_PORT_ENFORCE = (1 << 6), > - IB_DEVICE_CURR_QP_STATE_MOD = (1 << 7), > - IB_DEVICE_SHUTDOWN_PORT = (1 << 8), > - /* Not in use, former INIT_TYPE = (1 << 9),*/ > - IB_DEVICE_PORT_ACTIVE_EVENT = (1 << 10), > - IB_DEVICE_SYS_IMAGE_GUID = (1 << 11), > - IB_DEVICE_RC_RNR_NAK_GEN = (1 << 12), > - IB_DEVICE_SRQ_RESIZE = (1 << 13), > - IB_DEVICE_N_NOTIFY_CQ = (1 << 14), > + IB_DEVICE_RESIZE_MAX_WR = > + IB_UVERBS_DEVICE_RESIZE_MAX_WR, > + IB_DEVICE_BAD_PKEY_CNTR = > + IB_UVERBS_DEVICE_BAD_PKEY_CNTR, > + IB_DEVICE_BAD_QKEY_CNTR = > + IB_UVERBS_DEVICE_BAD_QKEY_CNTR, > + IB_DEVICE_RAW_MULTI = > + IB_UVERBS_DEVICE_RAW_MULTI, > + IB_DEVICE_AUTO_PATH_MIG = > + IB_UVERBS_DEVICE_AUTO_PATH_MIG, > + IB_DEVICE_CHANGE_PHY_PORT = > + IB_UVERBS_DEVICE_CHANGE_PHY_PORT, > + IB_DEVICE_UD_AV_PORT_ENFORCE = > + IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE, > + IB_DEVICE_CURR_QP_STATE_MOD = > + IB_UVERBS_DEVICE_CURR_QP_STATE_MOD, > + IB_DEVICE_SHUTDOWN_PORT = > + IB_UVERBS_DEVICE_SHUTDOWN_PORT, > + /* > + * IB_DEVICE_INIT_TYPE = > + * IB_UVERBS_DEVICE_INIT_TYPE, (not in use) > + */ > + IB_DEVICE_PORT_ACTIVE_EVENT = > + IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT, > + IB_DEVICE_SYS_IMAGE_GUID = > + IB_UVERBS_DEVICE_SYS_IMAGE_GUID, > + IB_DEVICE_RC_RNR_NAK_GEN = > + IB_UVERBS_DEVICE_RC_RNR_NAK_GEN, > + IB_DEVICE_SRQ_RESIZE = > + IB_UVERBS_DEVICE_SRQ_RESIZE, > + IB_DEVICE_N_NOTIFY_CQ = > + IB_UVERBS_DEVICE_N_NOTIFY_CQ, > > /* > * This device supports a per-device lkey or stag that can be > @@ -245,7 +264,8 @@ enum ib_device_cap_flags { > */ > IB_DEVICE_LOCAL_DMA_LKEY = (1 << 15), > /* Reserved, old SEND_W_INV = (1 << 16),*/ > - IB_DEVICE_MEM_WINDOW = (1 << 17), > + IB_DEVICE_MEM_WINDOW = > + IB_UVERBS_DEVICE_MEM_WINDOW, > /* > * Devices should set IB_DEVICE_UD_IP_SUM if they support > * insertion of UDP and TCP checksum on outgoing UD IPoIB > @@ -253,9 +273,11 @@ enum ib_device_cap_flags { > * incoming messages. Setting this flag implies that the > * IPoIB driver may set NETIF_F_IP_CSUM for datagram mode. > */ > - IB_DEVICE_UD_IP_CSUM = (1 << 18), > + IB_DEVICE_UD_IP_CSUM = > + IB_UVERBS_DEVICE_UD_IP_CSUM, > IB_DEVICE_UD_TSO = (1 << 19), > - IB_DEVICE_XRC = (1 << 20), > + IB_DEVICE_XRC = > + IB_UVERBS_DEVICE_XRC, > > /* > * This device supports the IB "base memory management extension", > @@ -266,13 +288,18 @@ enum ib_device_cap_flags { > * IB_WR_RDMA_READ_WITH_INV verb for RDMA READs that invalidate the > * stag. > */ > - IB_DEVICE_MEM_MGT_EXTENSIONS = (1 << 21), > + IB_DEVICE_MEM_MGT_EXTENSIONS = > + IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS, > IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1 << 22), > - IB_DEVICE_MEM_WINDOW_TYPE_2A = (1 << 23), > - IB_DEVICE_MEM_WINDOW_TYPE_2B = (1 << 24), > - IB_DEVICE_RC_IP_CSUM = (1 << 25), > + IB_DEVICE_MEM_WINDOW_TYPE_2A = > + IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A, > + IB_DEVICE_MEM_WINDOW_TYPE_2B = > + IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B, > + IB_DEVICE_RC_IP_CSUM = > + IB_UVERBS_DEVICE_RC_IP_CSUM, > /* Deprecated. Please use IB_RAW_PACKET_CAP_IP_CSUM. */ > - IB_DEVICE_RAW_IP_CSUM = (1 << 26), > + IB_DEVICE_RAW_IP_CSUM = > + IB_UVERBS_DEVICE_RAW_IP_CSUM, > /* > * Devices should set IB_DEVICE_CROSS_CHANNEL if they > * support execution of WQEs that involve synchronization > @@ -280,16 +307,19 @@ enum ib_device_cap_flags { > * by hardware. > */ > IB_DEVICE_CROSS_CHANNEL = (1 << 27), > - IB_DEVICE_MANAGED_FLOW_STEERING = (1 << 29), > + IB_DEVICE_MANAGED_FLOW_STEERING = > + IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING, > IB_DEVICE_INTEGRITY_HANDOVER = (1 << 30), > IB_DEVICE_ON_DEMAND_PAGING = (1ULL << 31), > IB_DEVICE_SG_GAPS_REG = (1ULL << 32), > IB_DEVICE_VIRTUAL_FUNCTION = (1ULL << 33), > /* Deprecated. Please use IB_RAW_PACKET_CAP_SCATTER_FCS. */ > - IB_DEVICE_RAW_SCATTER_FCS = (1ULL << 34), > + IB_DEVICE_RAW_SCATTER_FCS = > + IB_UVERBS_DEVICE_RAW_SCATTER_FCS, > IB_DEVICE_RDMA_NETDEV_OPA = (1ULL << 35), > /* The device supports padding incoming writes to cacheline. */ > - IB_DEVICE_PCI_WRITE_END_PADDING = (1ULL << 36), > + IB_DEVICE_PCI_WRITE_END_PADDING = > + IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING, > IB_DEVICE_ALLOW_USER_UNREG = (1ULL << 37), > }; This should be reformatted, no reason to have a = indented way out like that > +enum ib_uverbs_device_cap_flags { > + IB_UVERBS_DEVICE_RESIZE_MAX_WR = (1 << 0), > + IB_UVERBS_DEVICE_BAD_PKEY_CNTR = (1 << 1), > + IB_UVERBS_DEVICE_BAD_QKEY_CNTR = (1 << 2), > + IB_UVERBS_DEVICE_RAW_MULTI = (1 << 3), > + IB_UVERBS_DEVICE_AUTO_PATH_MIG = (1 << 4), > + IB_UVERBS_DEVICE_CHANGE_PHY_PORT = (1 << 5), > + IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE = (1 << 6), > + IB_UVERBS_DEVICE_CURR_QP_STATE_MOD = (1 << 7), > + IB_UVERBS_DEVICE_SHUTDOWN_PORT = (1 << 8), > + /* IB_UVERBS_DEVICE_INIT_TYPE = (1 << 9), (not in use) */ > + IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT = (1 << 10), > + IB_UVERBS_DEVICE_SYS_IMAGE_GUID = (1 << 11), > + IB_UVERBS_DEVICE_RC_RNR_NAK_GEN = (1 << 12), > + IB_UVERBS_DEVICE_SRQ_RESIZE = (1 << 13), > + IB_UVERBS_DEVICE_N_NOTIFY_CQ = (1 << 14), > + IB_UVERBS_DEVICE_MEM_WINDOW = (1 << 17), > + IB_UVERBS_DEVICE_UD_IP_CSUM = (1 << 18), > + IB_UVERBS_DEVICE_XRC = (1 << 20), > + IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS = (1 << 21), > + IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A = (1 << 23), > + IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B = (1 << 24), > + IB_UVERBS_DEVICE_RC_IP_CSUM = (1 << 25), > + /* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_IP_CSUM. */ > + IB_UVERBS_DEVICE_RAW_IP_CSUM = (1 << 26), > + IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING = (1 << 29), > + /* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS. */ > + IB_UVERBS_DEVICE_RAW_SCATTER_FCS = (1ULL << 34), > + IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING = (1ULL << 36), > +}; Also please drop the horizontal alignment for new code > + > enum ib_uverbs_raw_packet_caps { > IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING = (1 << 0), > IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS = (1 << 1), ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] IB/uverbs: Move enum ib_raw_packet_caps to uapi 2022-03-19 17:03 [PATCH 1/2] IB/uverbs: Move enum ib_raw_packet_caps to uapi Xiao Yang 2022-03-19 17:03 ` [PATCH 2/2] IB/uverbs: Move part of enum ib_device_cap_flags " Xiao Yang @ 2022-03-21 13:14 ` Jason Gunthorpe 1 sibling, 0 replies; 4+ messages in thread From: Jason Gunthorpe @ 2022-03-21 13:14 UTC (permalink / raw) To: Xiao Yang; +Cc: leon, linux-rdma On Sun, Mar 20, 2022 at 01:03:50AM +0800, Xiao Yang wrote: > diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h > index 7ee73a0652f1..0660405ca2cb 100644 > +++ b/include/uapi/rdma/ib_user_verbs.h > @@ -1298,4 +1298,11 @@ struct ib_uverbs_ex_modify_cq { > > #define IB_DEVICE_NAME_MAX 64 > > +enum ib_uverbs_raw_packet_caps { > + IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING = (1 << 0), > + IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS = (1 << 1), > + IB_UVERBS_RAW_PACKET_CAP_IP_CSUM = (1 << 2), > + IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP = (1 << 3), > +}; Doesn't need the () but it is OK otheriwse Thanks, Jason ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-03-21 13:19 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-03-19 17:03 [PATCH 1/2] IB/uverbs: Move enum ib_raw_packet_caps to uapi Xiao Yang 2022-03-19 17:03 ` [PATCH 2/2] IB/uverbs: Move part of enum ib_device_cap_flags " Xiao Yang 2022-03-21 13:18 ` Jason Gunthorpe 2022-03-21 13:14 ` [PATCH 1/2] IB/uverbs: Move enum ib_raw_packet_caps " Jason Gunthorpe
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.