Commit 84e3b19a authored by Gary Leshner's avatar Gary Leshner Committed by Jason Gunthorpe

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/20200511160600.173205.27508.stgit@awfm-01.aw.intel.comReviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarGary Leshner <Gary.S.Leshner@intel.com>
Signed-off-by: default avatarKaike Wan <kaike.wan@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 438d7dda
/* /*
* Copyright(c) 2015 - 2018 Intel Corporation. * Copyright(c) 2015 - 2020 Intel Corporation.
* *
* This file is provided under a dual BSD/GPLv2 license. When using or * This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license. * redistributing this file, you may do so under either license.
...@@ -67,10 +67,6 @@ ...@@ -67,10 +67,6 @@
#include "debugfs.h" #include "debugfs.h"
#include "fault.h" #include "fault.h"
uint kdeth_qp;
module_param_named(kdeth_qp, kdeth_qp, uint, S_IRUGO);
MODULE_PARM_DESC(kdeth_qp, "Set the KDETH queue pair prefix");
uint num_vls = HFI1_MAX_VLS_SUPPORTED; uint num_vls = HFI1_MAX_VLS_SUPPORTED;
module_param(num_vls, uint, S_IRUGO); module_param(num_vls, uint, S_IRUGO);
MODULE_PARM_DESC(num_vls, "Set number of Virtual Lanes to use (1-8)"); 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) ...@@ -14119,21 +14115,12 @@ static void init_early_variables(struct hfi1_devdata *dd)
static void init_kdeth_qp(struct hfi1_devdata *dd) static void init_kdeth_qp(struct hfi1_devdata *dd)
{ {
/* user changed the KDETH_QP */
if (kdeth_qp != 0 && kdeth_qp >= 0xff) {
/* out of range or illegal value */
dd_dev_err(dd, "Invalid KDETH queue pair prefix, ignoring");
kdeth_qp = 0;
}
if (kdeth_qp == 0) /* not set, or failed range check */
kdeth_qp = DEFAULT_KDETH_QP;
write_csr(dd, SEND_BTH_QP, write_csr(dd, SEND_BTH_QP,
(kdeth_qp & SEND_BTH_QP_KDETH_QP_MASK) << (RVT_KDETH_QP_PREFIX & SEND_BTH_QP_KDETH_QP_MASK) <<
SEND_BTH_QP_KDETH_QP_SHIFT); SEND_BTH_QP_KDETH_QP_SHIFT);
write_csr(dd, RCV_BTH_QP, write_csr(dd, RCV_BTH_QP,
(kdeth_qp & RCV_BTH_QP_KDETH_QP_MASK) << (RVT_KDETH_QP_PREFIX & RCV_BTH_QP_KDETH_QP_MASK) <<
RCV_BTH_QP_KDETH_QP_SHIFT); RCV_BTH_QP_KDETH_QP_SHIFT);
} }
......
...@@ -72,13 +72,6 @@ ...@@ -72,13 +72,6 @@
* compilation unit * compilation unit
*/ */
/*
* If a packet's QP[23:16] bits match this value, then it is
* a PSM packet and the hardware will expect a KDETH header
* following the BTH.
*/
#define DEFAULT_KDETH_QP 0x80
/* driver/hw feature set bitmask */ /* driver/hw feature set bitmask */
#define HFI1_CAP_USER_SHIFT 24 #define HFI1_CAP_USER_SHIFT 24
#define HFI1_CAP_MASK ((1UL << HFI1_CAP_USER_SHIFT) - 1) #define HFI1_CAP_MASK ((1UL << HFI1_CAP_USER_SHIFT) - 1)
......
/* /*
* Copyright(c) 2015-2017 Intel Corporation. * Copyright(c) 2015-2020 Intel Corporation.
* *
* This file is provided under a dual BSD/GPLv2 license. When using or * This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license. * 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) ...@@ -1264,7 +1264,7 @@ static int get_base_info(struct hfi1_filedata *fd, unsigned long arg, u32 len)
memset(&binfo, 0, sizeof(binfo)); memset(&binfo, 0, sizeof(binfo));
binfo.hw_version = dd->revision; binfo.hw_version = dd->revision;
binfo.sw_version = HFI1_KERN_SWVERSION; binfo.sw_version = HFI1_KERN_SWVERSION;
binfo.bthqp = kdeth_qp; binfo.bthqp = RVT_KDETH_QP_PREFIX;
binfo.jkey = uctxt->jkey; binfo.jkey = uctxt->jkey;
/* /*
* If more than 64 contexts are enabled the allocated credit * If more than 64 contexts are enabled the allocated credit
......
#ifndef _HFI1_KERNEL_H #ifndef _HFI1_KERNEL_H
#define _HFI1_KERNEL_H #define _HFI1_KERNEL_H
/* /*
* Copyright(c) 2015-2018 Intel Corporation. * Copyright(c) 2015-2020 Intel Corporation.
* *
* This file is provided under a dual BSD/GPLv2 license. When using or * This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license. * redistributing this file, you may do so under either license.
...@@ -2250,7 +2250,6 @@ extern int num_user_contexts; ...@@ -2250,7 +2250,6 @@ extern int num_user_contexts;
extern unsigned long n_krcvqs; extern unsigned long n_krcvqs;
extern uint krcvqs[]; extern uint krcvqs[];
extern int krcvqsset; extern int krcvqsset;
extern uint kdeth_qp;
extern uint loopback; extern uint loopback;
extern uint quick_linkup; extern uint quick_linkup;
extern uint rcv_intr_timeout; extern uint rcv_intr_timeout;
......
// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
/* /*
* Copyright(c) 2018 Intel Corporation. * Copyright(c) 2018 - 2020 Intel Corporation.
* *
*/ */
...@@ -194,7 +194,7 @@ void tid_rdma_opfn_init(struct rvt_qp *qp, struct tid_rdma_params *p) ...@@ -194,7 +194,7 @@ void tid_rdma_opfn_init(struct rvt_qp *qp, struct tid_rdma_params *p)
{ {
struct hfi1_qp_priv *priv = qp->priv; struct hfi1_qp_priv *priv = qp->priv;
p->qp = (kdeth_qp << 16) | priv->rcd->ctxt; p->qp = (RVT_KDETH_QP_PREFIX << 16) | priv->rcd->ctxt;
p->max_len = TID_RDMA_MAX_SEGMENT_SIZE; p->max_len = TID_RDMA_MAX_SEGMENT_SIZE;
p->jkey = priv->rcd->jkey; p->jkey = priv->rcd->jkey;
p->max_read = TID_RDMA_MAX_READ_SEGS_PER_REQ; p->max_read = TID_RDMA_MAX_READ_SEGS_PER_REQ;
......
/* /*
* Copyright(c) 2015 - 2018 Intel Corporation. * Copyright(c) 2015 - 2020 Intel Corporation.
* *
* This file is provided under a dual BSD/GPLv2 license. When using or * This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license. * redistributing this file, you may do so under either license.
...@@ -1863,9 +1863,8 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd) ...@@ -1863,9 +1863,8 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
dd->verbs_dev.rdi.dparms.qpn_start = 0; dd->verbs_dev.rdi.dparms.qpn_start = 0;
dd->verbs_dev.rdi.dparms.qpn_inc = 1; dd->verbs_dev.rdi.dparms.qpn_inc = 1;
dd->verbs_dev.rdi.dparms.qos_shift = dd->qos_shift; dd->verbs_dev.rdi.dparms.qos_shift = dd->qos_shift;
dd->verbs_dev.rdi.dparms.qpn_res_start = kdeth_qp << 16; dd->verbs_dev.rdi.dparms.qpn_res_start = RVT_KDETH_QP_BASE;
dd->verbs_dev.rdi.dparms.qpn_res_end = dd->verbs_dev.rdi.dparms.qpn_res_end = RVT_AIP_QP_MAX;
dd->verbs_dev.rdi.dparms.qpn_res_start + 65535;
dd->verbs_dev.rdi.dparms.max_rdma_atomic = HFI1_MAX_RDMA_ATOMIC; dd->verbs_dev.rdi.dparms.max_rdma_atomic = HFI1_MAX_RDMA_ATOMIC;
dd->verbs_dev.rdi.dparms.psn_mask = PSN_MASK; dd->verbs_dev.rdi.dparms.psn_mask = PSN_MASK;
dd->verbs_dev.rdi.dparms.psn_shift = PSN_SHIFT; dd->verbs_dev.rdi.dparms.psn_shift = PSN_SHIFT;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define DEF_RDMAVT_INCQP_H #define DEF_RDMAVT_INCQP_H
/* /*
* Copyright(c) 2016 - 2019 Intel Corporation. * Copyright(c) 2016 - 2020 Intel Corporation.
* *
* This file is provided under a dual BSD/GPLv2 license. When using or * This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license. * redistributing this file, you may do so under either license.
...@@ -68,6 +68,33 @@ ...@@ -68,6 +68,33 @@
#define RVT_R_RSP_SEND 0x08 #define RVT_R_RSP_SEND 0x08
#define RVT_R_COMM_EST 0x10 #define RVT_R_COMM_EST 0x10
/*
* If a packet's QP[23:16] bits match this value, then it is
* a PSM packet and the hardware will expect a KDETH header
* following the BTH.
*/
#define RVT_KDETH_QP_PREFIX 0x80
#define RVT_KDETH_QP_SUFFIX 0xffff
#define RVT_KDETH_QP_PREFIX_MASK 0x00ff0000
#define RVT_KDETH_QP_PREFIX_SHIFT 16
#define RVT_KDETH_QP_BASE (u32)(RVT_KDETH_QP_PREFIX << \
RVT_KDETH_QP_PREFIX_SHIFT)
#define RVT_KDETH_QP_MAX (u32)(RVT_KDETH_QP_BASE + RVT_KDETH_QP_SUFFIX)
/*
* If a packet's LNH == BTH and DEST QPN[23:16] in the BTH match this
* prefix value, then it is an AIP packet with a DETH containing the entropy
* value in byte 4 following the BTH.
*/
#define RVT_AIP_QP_PREFIX 0x81
#define RVT_AIP_QP_SUFFIX 0xffff
#define RVT_AIP_QP_PREFIX_MASK 0x00ff0000
#define RVT_AIP_QP_PREFIX_SHIFT 16
#define RVT_AIP_QP_BASE (u32)(RVT_AIP_QP_PREFIX << \
RVT_AIP_QP_PREFIX_SHIFT)
#define RVT_AIP_QPN_MAX BIT(RVT_AIP_QP_PREFIX_SHIFT)
#define RVT_AIP_QP_MAX (u32)(RVT_AIP_QP_BASE + RVT_AIP_QPN_MAX - 1)
/* /*
* Bit definitions for s_flags. * Bit definitions for s_flags.
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment