RDMA/hns: Move capability flags of QP and CQ to hns-abi.h
Subsystems (2)
PATCH v2 1/1 RDMA/hns: Move capability flags of QP and CQ to hns-abi.h
These flags will be returned to the userspace through ABI, so they should be defined in hns-abi.h. Furthermore, there is no need to include hns-abi.h in every source files, it just needs to be included in the common header file.
---
Changes since v1:
- Replace 'BIT(x)' with '1 << x'.
Previous Version:
v1: https://patchwork.kernel.org/project/linux-rdma/patch/[email protected]/
drivers/infiniband/hw/hns/hns_roce_cq.c | 1 - drivers/infiniband/hw/hns/hns_roce_device.h | 11 +---------- drivers/infiniband/hw/hns/hns_roce_main.c | 1 - drivers/infiniband/hw/hns/hns_roce_pd.c | 1 - drivers/infiniband/hw/hns/hns_roce_qp.c | 1 - drivers/infiniband/hw/hns/hns_roce_srq.c | 1 - include/uapi/rdma/hns-abi.h | 10 ++++++++++ 7 files changed, 11 insertions(+), 15 deletions(-)
drivers/infiniband/hw/hns/hns_roce_cq.c +0 -1
@@ -36,7 +36,6 @@#include "hns_roce_device.h" #include "hns_roce_cmd.h" #include "hns_roce_hem.h" -#include <rdma/hns-abi.h> #include "hns_roce_common.h" static int alloc_cqc (struct hns_roce_dev *hr_dev,struct hns_roce_cq *hr_cq)
drivers/infiniband/hw/hns/hns_roce_device.h +1 -10
@@ -34,6 +34,7 @@#define _HNS_ROCE_DEVICE_H#include <rdma/ib_verbs.h> +#include <rdma/hns-abi.h> #define DRV_NAME "hns_roce"
@@ -129,16 +130,6 @@ enum { SERV_TYPE_UD, }; -enum hns_roce_qp_caps { -HNS_ROCE_QP_CAP_RQ_RECORD_DB =BIT (0 ), -HNS_ROCE_QP_CAP_SQ_RECORD_DB =BIT (1 ), -HNS_ROCE_QP_CAP_OWNER_DB =BIT (2 ), -}; - -enum hns_roce_cq_flags { -HNS_ROCE_CQ_FLAG_RECORD_DB =BIT (0 ), -}; -enum hns_roce_qp_state {HNS_ROCE_QP_STATE_RST ,HNS_ROCE_QP_STATE_INIT ,
drivers/infiniband/hw/hns/hns_roce_main.c +0 -1
@@ -40,7 +40,6 @@#include <rdma/ib_cache.h> #include "hns_roce_common.h" #include "hns_roce_device.h" -#include <rdma/hns-abi.h> #include "hns_roce_hem.h" /**
drivers/infiniband/hw/hns/hns_roce_pd.c +0 -1
@@ -32,7 +32,6 @@#include <linux/platform_device.h> #include <linux/pci.h> -#include <uapi/rdma/hns-abi.h> #include "hns_roce_device.h" static int hns_roce_pd_alloc (struct hns_roce_dev *hr_dev,unsigned long *pdn)
drivers/infiniband/hw/hns/hns_roce_qp.c +0 -1
@@ -39,7 +39,6 @@#include "hns_roce_common.h" #include "hns_roce_device.h" #include "hns_roce_hem.h" -#include <rdma/hns-abi.h> static void flush_work_handle (struct work_struct *work) {
drivers/infiniband/hw/hns/hns_roce_srq.c +0 -1
@@ -4,7 +4,6 @@*/ #include <rdma/ib_umem.h> -#include <rdma/hns-abi.h> #include "hns_roce_device.h" #include "hns_roce_cmd.h" #include "hns_roce_hem.h"
include/uapi/rdma/hns-abi.h +10 -0
@@ -43,6 +43,10 @@ struct hns_roce_ib_create_cq {__u32 reserved; }; +enum hns_roce_cq_cap_flags { +HNS_ROCE_CQ_FLAG_RECORD_DB =1 <<0 , +}; +struct hns_roce_ib_create_cq_resp {__aligned_u64 cqn;/* Only 32 bits used, 64 for compat */ __aligned_u64 cap_flags;
@@ -69,6 +73,12 @@ struct hns_roce_ib_create_qp {__aligned_u64 sdb_addr; }; +enum hns_roce_qp_cap_flags { +HNS_ROCE_QP_CAP_RQ_RECORD_DB =1 <<0 , +HNS_ROCE_QP_CAP_SQ_RECORD_DB =1 <<1 , +HNS_ROCE_QP_CAP_OWNER_DB =1 <<2 , +}; +struct hns_roce_ib_create_qp_resp {__aligned_u64 cap_flags; };
Signature · 1 line
2.8.1
Quoted 14 lines · Weihang Li
These flags will be returned to the userspace through ABI, so they should be defined in
hns-abi.h. Furthermore, there is no need to includehns-abi.hin every source files, it just needs to be included in the common header file.Reported-by kernel test robot <[email protected]>Signed-off-by Weihang Li <[email protected]>---
Changes since v1:
- Replace 'BIT(x)' with '1 << x'.Previous Version:
v1: https://patchwork.kernel.org/project/linux-rdma/patch/[email protected]/
Quoted 8 lines
drivers/infiniband/hw/hns/hns_roce_cq.c | 1 - drivers/infiniband/hw/hns/hns_roce_device.h | 11 +---------- drivers/infiniband/hw/hns/hns_roce_main.c | 1 - drivers/infiniband/hw/hns/hns_roce_pd.c | 1 - drivers/infiniband/hw/hns/hns_roce_qp.c | 1 - drivers/infiniband/hw/hns/hns_roce_srq.c | 1 - include/uapi/rdma/hns-abi.h | 10 ++++++++++ 7 files changed, 11 insertions(+), 15 deletions(-)
Applied to for-next, thanks
Jason