Skip to content

Commit 84e3b19

Browse files
gsleshnejgunthorpe
authored andcommitted
IB/hfi1: Remove module parameter for KDETH qpns
The module parameter for KDETH qpns is being removed in favor of always using the default value of 0x80 as the qpn prefix. Defines have been added for various KDETH values including the prefix of 0x80. The reserved range now starts at the base value for KDETH qpns (0x80) and extends up to and including the last qpn for other reserved QP prefixed types. Adjust other QP prefixed define names to match KDETH defined names. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Dennis Dalessandro <[email protected]> Reviewed-by: Mike Marciniszyn <[email protected]> Signed-off-by: Gary Leshner <[email protected]> Signed-off-by: Kaike Wan <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 438d7dd commit 84e3b19

File tree

7 files changed

+39
-34
lines changed

7 files changed

+39
-34
lines changed

drivers/infiniband/hw/hfi1/chip.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright(c) 2015 - 2018 Intel Corporation.
2+
* Copyright(c) 2015 - 2020 Intel Corporation.
33
*
44
* This file is provided under a dual BSD/GPLv2 license. When using or
55
* redistributing this file, you may do so under either license.
@@ -67,10 +67,6 @@
6767
#include "debugfs.h"
6868
#include "fault.h"
6969

70-
uint kdeth_qp;
71-
module_param_named(kdeth_qp, kdeth_qp, uint, S_IRUGO);
72-
MODULE_PARM_DESC(kdeth_qp, "Set the KDETH queue pair prefix");
73-
7470
uint num_vls = HFI1_MAX_VLS_SUPPORTED;
7571
module_param(num_vls, uint, S_IRUGO);
7672
MODULE_PARM_DESC(num_vls, "Set number of Virtual Lanes to use (1-8)");
@@ -14119,21 +14115,12 @@ static void init_early_variables(struct hfi1_devdata *dd)
1411914115

1412014116
static void init_kdeth_qp(struct hfi1_devdata *dd)
1412114117
{
14122-
/* user changed the KDETH_QP */
14123-
if (kdeth_qp != 0 && kdeth_qp >= 0xff) {
14124-
/* out of range or illegal value */
14125-
dd_dev_err(dd, "Invalid KDETH queue pair prefix, ignoring");
14126-
kdeth_qp = 0;
14127-
}
14128-
if (kdeth_qp == 0) /* not set, or failed range check */
14129-
kdeth_qp = DEFAULT_KDETH_QP;
14130-
1413114118
write_csr(dd, SEND_BTH_QP,
14132-
(kdeth_qp & SEND_BTH_QP_KDETH_QP_MASK) <<
14119+
(RVT_KDETH_QP_PREFIX & SEND_BTH_QP_KDETH_QP_MASK) <<
1413314120
SEND_BTH_QP_KDETH_QP_SHIFT);
1413414121

1413514122
write_csr(dd, RCV_BTH_QP,
14136-
(kdeth_qp & RCV_BTH_QP_KDETH_QP_MASK) <<
14123+
(RVT_KDETH_QP_PREFIX & RCV_BTH_QP_KDETH_QP_MASK) <<
1413714124
RCV_BTH_QP_KDETH_QP_SHIFT);
1413814125
}
1413914126

drivers/infiniband/hw/hfi1/common.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@
7272
* compilation unit
7373
*/
7474

75-
/*
76-
* If a packet's QP[23:16] bits match this value, then it is
77-
* a PSM packet and the hardware will expect a KDETH header
78-
* following the BTH.
79-
*/
80-
#define DEFAULT_KDETH_QP 0x80
81-
8275
/* driver/hw feature set bitmask */
8376
#define HFI1_CAP_USER_SHIFT 24
8477
#define HFI1_CAP_MASK ((1UL << HFI1_CAP_USER_SHIFT) - 1)

drivers/infiniband/hw/hfi1/file_ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright(c) 2015-2017 Intel Corporation.
2+
* Copyright(c) 2015-2020 Intel Corporation.
33
*
44
* This file is provided under a dual BSD/GPLv2 license. When using or
55
* redistributing this file, you may do so under either license.
@@ -1264,7 +1264,7 @@ static int get_base_info(struct hfi1_filedata *fd, unsigned long arg, u32 len)
12641264
memset(&binfo, 0, sizeof(binfo));
12651265
binfo.hw_version = dd->revision;
12661266
binfo.sw_version = HFI1_KERN_SWVERSION;
1267-
binfo.bthqp = kdeth_qp;
1267+
binfo.bthqp = RVT_KDETH_QP_PREFIX;
12681268
binfo.jkey = uctxt->jkey;
12691269
/*
12701270
* If more than 64 contexts are enabled the allocated credit

drivers/infiniband/hw/hfi1/hfi.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef _HFI1_KERNEL_H
22
#define _HFI1_KERNEL_H
33
/*
4-
* Copyright(c) 2015-2018 Intel Corporation.
4+
* Copyright(c) 2015-2020 Intel Corporation.
55
*
66
* This file is provided under a dual BSD/GPLv2 license. When using or
77
* redistributing this file, you may do so under either license.
@@ -2250,7 +2250,6 @@ extern int num_user_contexts;
22502250
extern unsigned long n_krcvqs;
22512251
extern uint krcvqs[];
22522252
extern int krcvqsset;
2253-
extern uint kdeth_qp;
22542253
extern uint loopback;
22552254
extern uint quick_linkup;
22562255
extern uint rcv_intr_timeout;

drivers/infiniband/hw/hfi1/tid_rdma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
22
/*
3-
* Copyright(c) 2018 Intel Corporation.
3+
* Copyright(c) 2018 - 2020 Intel Corporation.
44
*
55
*/
66

@@ -194,7 +194,7 @@ void tid_rdma_opfn_init(struct rvt_qp *qp, struct tid_rdma_params *p)
194194
{
195195
struct hfi1_qp_priv *priv = qp->priv;
196196

197-
p->qp = (kdeth_qp << 16) | priv->rcd->ctxt;
197+
p->qp = (RVT_KDETH_QP_PREFIX << 16) | priv->rcd->ctxt;
198198
p->max_len = TID_RDMA_MAX_SEGMENT_SIZE;
199199
p->jkey = priv->rcd->jkey;
200200
p->max_read = TID_RDMA_MAX_READ_SEGS_PER_REQ;

drivers/infiniband/hw/hfi1/verbs.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright(c) 2015 - 2018 Intel Corporation.
2+
* Copyright(c) 2015 - 2020 Intel Corporation.
33
*
44
* This file is provided under a dual BSD/GPLv2 license. When using or
55
* redistributing this file, you may do so under either license.
@@ -1863,9 +1863,8 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
18631863
dd->verbs_dev.rdi.dparms.qpn_start = 0;
18641864
dd->verbs_dev.rdi.dparms.qpn_inc = 1;
18651865
dd->verbs_dev.rdi.dparms.qos_shift = dd->qos_shift;
1866-
dd->verbs_dev.rdi.dparms.qpn_res_start = kdeth_qp << 16;
1867-
dd->verbs_dev.rdi.dparms.qpn_res_end =
1868-
dd->verbs_dev.rdi.dparms.qpn_res_start + 65535;
1866+
dd->verbs_dev.rdi.dparms.qpn_res_start = RVT_KDETH_QP_BASE;
1867+
dd->verbs_dev.rdi.dparms.qpn_res_end = RVT_AIP_QP_MAX;
18691868
dd->verbs_dev.rdi.dparms.max_rdma_atomic = HFI1_MAX_RDMA_ATOMIC;
18701869
dd->verbs_dev.rdi.dparms.psn_mask = PSN_MASK;
18711870
dd->verbs_dev.rdi.dparms.psn_shift = PSN_SHIFT;

include/rdma/rdmavt_qp.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define DEF_RDMAVT_INCQP_H
33

44
/*
5-
* Copyright(c) 2016 - 2019 Intel Corporation.
5+
* Copyright(c) 2016 - 2020 Intel Corporation.
66
*
77
* This file is provided under a dual BSD/GPLv2 license. When using or
88
* redistributing this file, you may do so under either license.
@@ -68,6 +68,33 @@
6868
#define RVT_R_RSP_SEND 0x08
6969
#define RVT_R_COMM_EST 0x10
7070

71+
/*
72+
* If a packet's QP[23:16] bits match this value, then it is
73+
* a PSM packet and the hardware will expect a KDETH header
74+
* following the BTH.
75+
*/
76+
#define RVT_KDETH_QP_PREFIX 0x80
77+
#define RVT_KDETH_QP_SUFFIX 0xffff
78+
#define RVT_KDETH_QP_PREFIX_MASK 0x00ff0000
79+
#define RVT_KDETH_QP_PREFIX_SHIFT 16
80+
#define RVT_KDETH_QP_BASE (u32)(RVT_KDETH_QP_PREFIX << \
81+
RVT_KDETH_QP_PREFIX_SHIFT)
82+
#define RVT_KDETH_QP_MAX (u32)(RVT_KDETH_QP_BASE + RVT_KDETH_QP_SUFFIX)
83+
84+
/*
85+
* If a packet's LNH == BTH and DEST QPN[23:16] in the BTH match this
86+
* prefix value, then it is an AIP packet with a DETH containing the entropy
87+
* value in byte 4 following the BTH.
88+
*/
89+
#define RVT_AIP_QP_PREFIX 0x81
90+
#define RVT_AIP_QP_SUFFIX 0xffff
91+
#define RVT_AIP_QP_PREFIX_MASK 0x00ff0000
92+
#define RVT_AIP_QP_PREFIX_SHIFT 16
93+
#define RVT_AIP_QP_BASE (u32)(RVT_AIP_QP_PREFIX << \
94+
RVT_AIP_QP_PREFIX_SHIFT)
95+
#define RVT_AIP_QPN_MAX BIT(RVT_AIP_QP_PREFIX_SHIFT)
96+
#define RVT_AIP_QP_MAX (u32)(RVT_AIP_QP_BASE + RVT_AIP_QPN_MAX - 1)
97+
7198
/*
7299
* Bit definitions for s_flags.
73100
*

0 commit comments

Comments
 (0)