Skip to content

Commit 53ef499

Browse files
Weihang Lijgunthorpe
authored andcommitted
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. Link: https://lore.kernel.org/r/1606872560-17823-1-git-send-email-liweihang@huawei.com Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Weihang Li <liweihang@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent 2988ca0 commit 53ef499

7 files changed

Lines changed: 11 additions & 15 deletions

File tree

‎drivers/infiniband/hw/hns/hns_roce_cq.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "hns_roce_device.h"
3737
#include "hns_roce_cmd.h"
3838
#include "hns_roce_hem.h"
39-
#include <rdma/hns-abi.h>
4039
#include "hns_roce_common.h"
4140

4241
static int alloc_cqc(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq)

‎drivers/infiniband/hw/hns/hns_roce_device.h‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#define _HNS_ROCE_DEVICE_H
3535

3636
#include <rdma/ib_verbs.h>
37+
#include <rdma/hns-abi.h>
3738

3839
#define DRV_NAME "hns_roce"
3940

@@ -131,16 +132,6 @@ enum {
131132
SERV_TYPE_UD,
132133
};
133134

134-
enum hns_roce_qp_caps {
135-
HNS_ROCE_QP_CAP_RQ_RECORD_DB = BIT(0),
136-
HNS_ROCE_QP_CAP_SQ_RECORD_DB = BIT(1),
137-
HNS_ROCE_QP_CAP_OWNER_DB = BIT(2),
138-
};
139-
140-
enum hns_roce_cq_flags {
141-
HNS_ROCE_CQ_FLAG_RECORD_DB = BIT(0),
142-
};
143-
144135
enum hns_roce_qp_state {
145136
HNS_ROCE_QP_STATE_RST,
146137
HNS_ROCE_QP_STATE_INIT,

‎drivers/infiniband/hw/hns/hns_roce_main.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#include <rdma/ib_cache.h>
4141
#include "hns_roce_common.h"
4242
#include "hns_roce_device.h"
43-
#include <rdma/hns-abi.h>
4443
#include "hns_roce_hem.h"
4544

4645
/**

‎drivers/infiniband/hw/hns/hns_roce_pd.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
#include <linux/platform_device.h>
3434
#include <linux/pci.h>
35-
#include <uapi/rdma/hns-abi.h>
3635
#include "hns_roce_device.h"
3736

3837
static int hns_roce_pd_alloc(struct hns_roce_dev *hr_dev, unsigned long *pdn)

‎drivers/infiniband/hw/hns/hns_roce_qp.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include "hns_roce_common.h"
4040
#include "hns_roce_device.h"
4141
#include "hns_roce_hem.h"
42-
#include <rdma/hns-abi.h>
4342

4443
static void flush_work_handle(struct work_struct *work)
4544
{

‎drivers/infiniband/hw/hns/hns_roce_srq.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
#include <rdma/ib_umem.h>
7-
#include <rdma/hns-abi.h>
87
#include "hns_roce_device.h"
98
#include "hns_roce_cmd.h"
109
#include "hns_roce_hem.h"

‎include/uapi/rdma/hns-abi.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ struct hns_roce_ib_create_cq {
4343
__u32 reserved;
4444
};
4545

46+
enum hns_roce_cq_cap_flags {
47+
HNS_ROCE_CQ_FLAG_RECORD_DB = 1 << 0,
48+
};
49+
4650
struct hns_roce_ib_create_cq_resp {
4751
__aligned_u64 cqn; /* Only 32 bits used, 64 for compat */
4852
__aligned_u64 cap_flags;
@@ -69,6 +73,12 @@ struct hns_roce_ib_create_qp {
6973
__aligned_u64 sdb_addr;
7074
};
7175

76+
enum hns_roce_qp_cap_flags {
77+
HNS_ROCE_QP_CAP_RQ_RECORD_DB = 1 << 0,
78+
HNS_ROCE_QP_CAP_SQ_RECORD_DB = 1 << 1,
79+
HNS_ROCE_QP_CAP_OWNER_DB = 1 << 2,
80+
};
81+
7282
struct hns_roce_ib_create_qp_resp {
7383
__aligned_u64 cap_flags;
7484
};

0 commit comments

Comments
 (0)