Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions arch/riscv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,25 @@ config SMP

If you don't know what to do here, say N.

config HIGHMEM
bool "High Memory Support"
depends on MMU
select KMAP_LOCAL
select KMAP_LOCAL_NON_LINEAR_PTE_ARRAY
help
The address space of ARM processors is only 4 Gigabytes large
and it has to accommodate user address space, kernel address
space as well as some memory mapped IO. That means that, if you
have a large amount of physical memory and/or IO, not all of the
memory can be "permanently mapped" by the kernel. The physical
memory that is not permanently mapped is called "high memory".

Depending on the selected kernel/user memory split, minimum
vmalloc space and actual amount of RAM, you may not need this
option which should result in a slightly faster kernel.

If unsure, say n.

config SCHED_MC
bool "Multi-core scheduler support"
depends on SMP
Expand Down
38 changes: 19 additions & 19 deletions drivers/infiniband/hw/hfi1/Kconfig
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# SPDX-License-Identifier: GPL-2.0-only
config INFINIBAND_HFI1
tristate "Cornelis OPX Gen1 support"
depends on X86_64 && INFINIBAND_RDMAVT && I2C && !UML
select MMU_NOTIFIER
select CRC32
select I2C_ALGOBIT
help
This is a low-level driver for Cornelis OPX Gen1 adapter.
tristate "Cornelis OPX Gen1 support"
depends on ( X86_64 || RISCV ) && INFINIBAND_RDMAVT && I2C && !UML
select MMU_NOTIFIER
select CRC32
select I2C_ALGOBIT
help
This is a low-level driver for Cornelis OPX Gen1 adapter.
config HFI1_DEBUG_SDMA_ORDER
bool "HFI1 SDMA Order debug"
depends on INFINIBAND_HFI1
default n
help
This is a debug flag to test for out of order
sdma completions for unit testing
bool "HFI1 SDMA Order debug"
depends on INFINIBAND_HFI1
default n
help
This is a debug flag to test for out of order
sdma completions for unit testing
config SDMA_VERBOSITY
bool "Config SDMA Verbosity"
depends on INFINIBAND_HFI1
default n
help
This is a configuration flag to enable verbose
SDMA debug
bool "Config SDMA Verbosity"
depends on INFINIBAND_HFI1
default n
help
This is a configuration flag to enable verbose
SDMA debug
14 changes: 11 additions & 3 deletions drivers/infiniband/hw/hfi1/hfi.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
/*
* Copyright(c) 2020-2023 Cornelis Networks, Inc.
* Copyright(c) 2024 Tactical Computing Labs, LLC
* Copyright(c) 2020 Cornelis Networks, Inc.
* Copyright(c) 2015-2020 Intel Corporation.
*/

Expand Down Expand Up @@ -1378,6 +1379,8 @@ struct hfi1_devdata {
#define PT_INVALID 3

struct tid_rb_node;
struct mmu_rb_node;
struct mmu_rb_handler;

/* Private data for file operations */
struct hfi1_filedata {
Expand Down Expand Up @@ -2175,7 +2178,11 @@ struct pci_dev *get_pci_dev(struct rvt_dev_info *rdi);
*/
static inline void flush_wc(void)
{
#if defined(CONFIG_X86_64)
asm volatile("sfence" : : : "memory");
#elif defined(CONFIG_RISCV)
asm volatile("fence rw,rw" : : : "memory");
#endif
}

void handle_eflags(struct hfi1_packet *packet);
Expand Down Expand Up @@ -2425,7 +2432,8 @@ static inline bool hfi1_need_drop(struct hfi1_devdata *dd)
int hfi1_tempsense_rd(struct hfi1_devdata *dd, struct hfi1_temp *temp);

#define DD_DEV_ENTRY(dd) __string(dev, dev_name(&(dd)->pcidev->dev))
#define DD_DEV_ASSIGN(dd) __assign_str(dev)
//#define DD_DEV_ASSIGN(dd) __assign_str(dev, dev_name(&(dd)->pcidev->dev))
#define DD_DEV_ASSIGN(dd) __string(dev, dev_name(&(dd)->pcidev->dev))

static inline void hfi1_update_ah_attr(struct ib_device *ibdev,
struct rdma_ah_attr *attr)
Expand Down
1 change: 1 addition & 0 deletions drivers/infiniband/hw/qib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ ib_qib-$(CONFIG_PCI_MSI) += qib_iba6120.o

ib_qib-$(CONFIG_X86_64) += qib_wc_x86_64.o
ib_qib-$(CONFIG_PPC64) += qib_wc_ppc64.o
ib_qib-$(CONFIG_RISCV) += qib_wc_riscv.o
ib_qib-$(CONFIG_DEBUG_FS) += qib_debugfs.o
6 changes: 5 additions & 1 deletion drivers/infiniband/hw/qib/qib.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _QIB_KERNEL_H
#define _QIB_KERNEL_H
/*
* Copyright(c) 2024 Tactical Computing Labs, LLC
* Copyright (c) 2012 - 2017 Intel Corporation. All rights reserved.
* Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
* Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
Expand Down Expand Up @@ -321,7 +322,7 @@ struct qib_verbs_txreq {
* These 7 values (SDR, DDR, and QDR may be ORed for auto-speed
* negotiation) are used for the 3rd argument to path_f_set_ib_cfg
* with cmd QIB_IB_CFG_SPD_ENB, by direct calls or via sysfs. They
* are also the possible values for qib_link_speed_enabled and active
* are also the the possible values for qib_link_speed_enabled and active
* The values were chosen to match values used within the IB spec.
*/
#define QIB_IB_SDR 1
Expand Down Expand Up @@ -1359,6 +1360,7 @@ static inline u32 qib_get_rcvhdrtail(const struct qib_ctxtdata *rcd)
* sysfs interface.
*/

extern const char ib_qib_version[];
extern const struct attribute_group qib_attr_group;
extern const struct attribute_group *qib_attr_port_groups[];

Expand Down Expand Up @@ -1402,6 +1404,8 @@ static inline void qib_flush_wc(void)
{
#if defined(CONFIG_X86_64)
asm volatile("sfence" : : : "memory");
#elif defined(CONFIG_RISCV)
asm volatile("fence rw,rw" : : : "memory");
#else
wmb(); /* no reorder around wc flush */
#endif
Expand Down
59 changes: 59 additions & 0 deletions drivers/infiniband/hw/qib/qib_wc_riscv.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright(c) 2024 Tactical Computing Labs, LLC
* Copyright (c) 2006, 2007, 2008 QLogic Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/*
* This file is conditionally built on RISCV only. It is dervied from the
* PowerPC version.
*/

#include "qib.h"

/**
* qib_enable_wc - enable write combining for MMIO writes to the device
* @dd: qlogic_ib device
*
* Nothing to do on RISCV, so just return without error.
*/
int qib_enable_wc(struct qib_devdata *dd)
{
return 0;
}

/**
* qib_unordered_wc - indicate whether write combining is unordered
*
*/
int qib_unordered_wc(void)
{
return 1;
}
12 changes: 6 additions & 6 deletions drivers/infiniband/sw/rdmavt/Kconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: GPL-2.0-only
config INFINIBAND_RDMAVT
tristate "RDMA verbs transport library"
depends on INFINIBAND_VIRT_DMA
depends on X86_64
depends on PCI
help
This is a common software verbs provider for RDMA networks.
tristate "RDMA verbs transport library"
depends on INFINIBAND_VIRT_DMA
depends on ( X86_64 || RISCV )
depends on PCI
help
This is a common software verbs provider for RDMA networks.
16 changes: 13 additions & 3 deletions drivers/infiniband/sw/rdmavt/qp.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
// SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause
/*
* Copyright(c) 2024 Tactical Computing Labs, LLC
* Copyright(c) 2024 Cornelis Networks, Inc.
* Copyright(c) 2016 - 2020 Intel Corporation.
*/

Expand Down Expand Up @@ -85,19 +87,25 @@ EXPORT_SYMBOL(ib_rvt_state_ops);
static int rvt_wss_llc_size(void)
{
/* assume that the boot CPU value is universal for all CPUs */
#if defined(CONFIG_X86_64)
return boot_cpu_data.x86_cache_size;
#elif defined(CONFIG_RISCV)
return 64;
#endif
}

/* platform specific: cacheless copy */
static void cacheless_memcpy(void *dst, void *src, size_t n)
{
#if defined(CONFIG_X86_64)
/*
* Use the only available X64 cacheless copy. Add a __user cast
* to quiet sparse. The src agument is already in the kernel so
* there are no security issues. The extra fault recovery machinery
* is not invoked.
*/
__copy_user_nocache(dst, (void __user *)src, n);
__copy_user_nocache(dst, (void __user *)src, n, 0);
#endif
}

void rvt_wss_exit(struct rvt_dev_info *rdi)
Expand Down Expand Up @@ -464,6 +472,8 @@ void rvt_qp_exit(struct rvt_dev_info *rdi)
if (qps_inuse)
rvt_pr_err(rdi, "QP memory leak! %u still in use\n",
qps_inuse);
if (!rdi->qp_dev)
return;

kfree(rdi->qp_dev->qp_table);
free_qpn_table(&rdi->qp_dev->qpn_table);
Expand Down Expand Up @@ -2038,7 +2048,7 @@ static int rvt_post_one_wr(struct rvt_qp *qp,
wqe = rvt_get_swqe_ptr(qp, qp->s_head);

/* cplen has length from above */
memcpy(&wqe->ud_wr, wr, cplen);
memcpy(&wqe->wr, wr, cplen);

wqe->length = 0;
j = 0;
Expand Down
14 changes: 7 additions & 7 deletions drivers/infiniband/ulp/opa_vnic/Kconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# SPDX-License-Identifier: GPL-2.0-only
config INFINIBAND_OPA_VNIC
tristate "Cornelis OPX VNIC support"
depends on X86_64 && INFINIBAND
help
This is Omni-Path Express (OPX) Virtual Network Interface Controller (VNIC)
driver for Ethernet over Omni-Path feature. It implements the HW
independent VNIC functionality. It interfaces with Linux stack for
data path and IB MAD for the control path.
tristate "Cornelis OPX VNIC support"
depends on ( X86_64 || RISCV) && INFINIBAND
help
This is Omni-Path Express (OPX) Virtual Network Interface Controller (VNIC)
driver for Ethernet over Omni-Path feature. It implements the HW
independent VNIC functionality. It interfaces with Linux stack for
data path and IB MAD for the control path.