Skip to content

Commit

Permalink
Merge branch 'opfn' into hfi1-tid
Browse files Browse the repository at this point in the history
This series adds the OPFN feature, which is used as the negotiation
protocol by TID RDMA. This adds a totally hidden, in-band negotiation
transfer that happens on the consumer's queue pair but without the
consumer's knowledge.  For that reason, things like completions for OPFN
transfers must be filtered out of the completion queue and not sent to
the consumer.  This feature does not impact any consumer APIs, but does
impact the driver/driver wire API.

At a high level OPFN enables exchanging parameters between two hosts
using IB compare and swap requests to a special virtual address. The
request uses a reserved IB work request opcode (see patch 3).

* opfn:
  IB/hfi1: Add static trace for OPFN
  IB/hfi1: Integrate OPFN into RC transactions
  IB/hfi1, IB/rdmavt: Allow for extending of QP's s_ack_queue
  IB/hfi1: OPFN interface
  IB/hfi1: Add OPFN helper functions for TID RDMA feature
  IB/hfi1: OPFN support discovery

Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
dledford committed Jan 31, 2019
2 parents db421a5 + a131d16 commit 2a64239
Show file tree
Hide file tree
Showing 19 changed files with 1,114 additions and 141 deletions.
1 change: 1 addition & 0 deletions drivers/infiniband/hw/hfi1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ hfi1-y := \
mad.o \
mmu_rb.o \
msix.o \
opfn.o \
pcie.o \
pio.o \
pio_copy.o \
Expand Down
11 changes: 11 additions & 0 deletions drivers/infiniband/hw/hfi1/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -5222,6 +5222,17 @@ int is_bx(struct hfi1_devdata *dd)
return (chip_rev_minor & 0xF0) == 0x10;
}

/* return true is kernel urg disabled for rcd */
bool is_urg_masked(struct hfi1_ctxtdata *rcd)
{
u64 mask;
u32 is = IS_RCVURGENT_START + rcd->ctxt;
u8 bit = is % 64;

mask = read_csr(rcd->dd, CCE_INT_MASK + (8 * (is / 64)));
return !(mask & BIT_ULL(bit));
}

/*
* Append string s to buffer buf. Arguments curp and len are the current
* position and remaining length, respectively.
Expand Down
3 changes: 2 additions & 1 deletion drivers/infiniband/hw/hfi1/chip.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _CHIP_H
#define _CHIP_H
/*
* Copyright(c) 2015 - 2017 Intel Corporation.
* Copyright(c) 2015 - 2018 Intel Corporation.
*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
Expand Down Expand Up @@ -804,6 +804,7 @@ void clear_linkup_counters(struct hfi1_devdata *dd);
u32 hdrqempty(struct hfi1_ctxtdata *rcd);
int is_ax(struct hfi1_devdata *dd);
int is_bx(struct hfi1_devdata *dd);
bool is_urg_masked(struct hfi1_ctxtdata *rcd);
u32 read_physical_state(struct hfi1_devdata *dd);
u32 chip_to_opa_pstate(struct hfi1_devdata *dd, u32 chip_pstate);
const char *opa_lstate_name(u32 lstate);
Expand Down
3 changes: 3 additions & 0 deletions drivers/infiniband/hw/hfi1/hfi.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@

#include "chip_registers.h"
#include "common.h"
#include "opfn.h"
#include "verbs.h"
#include "pio.h"
#include "chip.h"
Expand All @@ -98,6 +99,8 @@
#define NEIGHBOR_TYPE_HFI 0
#define NEIGHBOR_TYPE_SWITCH 1

#define HFI1_MAX_ACTIVE_WORKQUEUE_ENTRIES 5

extern unsigned long hfi1_cap_mask;
#define HFI1_CAP_KGET_MASK(mask, cap) ((mask) & HFI1_CAP_##cap)
#define HFI1_CAP_UGET_MASK(mask, cap) \
Expand Down
10 changes: 9 additions & 1 deletion drivers/infiniband/hw/hfi1/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
#undef pr_fmt
#define pr_fmt(fmt) DRIVER_NAME ": " fmt

#define HFI1_MAX_ACTIVE_WORKQUEUE_ENTRIES 5
/*
* min buffers we want to have per context, after driver
*/
Expand Down Expand Up @@ -927,6 +926,8 @@ int hfi1_init(struct hfi1_devdata *dd, int reinit)
lastfail = hfi1_create_rcvhdrq(dd, rcd);
if (!lastfail)
lastfail = hfi1_setup_eagerbufs(rcd);
if (!lastfail)
lastfail = hfi1_kern_exp_rcv_init(rcd, reinit);
if (lastfail) {
dd_dev_err(dd,
"failed to allocate kernel ctxt's rcvhdrq and/or egr bufs\n");
Expand Down Expand Up @@ -1497,6 +1498,12 @@ static int __init hfi1_mod_init(void)
/* sanitize link CRC options */
link_crc_mask &= SUPPORTED_CRCS;

ret = opfn_init();
if (ret < 0) {
pr_err("Failed to allocate opfn_wq");
goto bail_dev;
}

/*
* These must be called before the driver is registered with
* the PCI subsystem.
Expand Down Expand Up @@ -1527,6 +1534,7 @@ module_init(hfi1_mod_init);
static void __exit hfi1_mod_cleanup(void)
{
pci_unregister_driver(&hfi1_pci_driver);
opfn_exit();
node_affinity_destroy_all();
hfi1_dbg_exit();

Expand Down
Loading

0 comments on commit 2a64239

Please sign in to comment.