diff options
author | Eric Joyner <erj@FreeBSD.org> | 2021-12-02 00:50:06 +0000 |
---|---|---|
committer | Eric Joyner <erj@FreeBSD.org> | 2022-05-23 23:23:49 +0000 |
commit | 8a13362d49bf07dfc654e25976d057adbe0ac9c1 (patch) | |
tree | a657c7681b0f7f1ab8730f6b68deca4dff803fbc /sys/dev/ice/irdma_if.m | |
parent | f16e38162c75015036b1c5e220b2f82a4bd94af1 (diff) |
ice(4): Add RDMA Client Interface
This allows the "irdma" driver to communicate with the ice(4)
driver to allow it access to the underlying device's hardware
resources as well as synchronize access to shared resources.
This interface already existed in the standalone out-of-tree
1.34.2 driver; this commit adds and enables it in the in-kernel
driver.
Note:
Adds hack to module Makefile to compile interface/.m files
These are required for the RDMA client interface, but they don't
build as-is like the normal .c files. The source directory doesn't
seem to be included by default, so add lines that specifically
add them as libraries so that ice_rdma.h can be found and the
interface files will compile.
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D30889
Diffstat (limited to 'sys/dev/ice/irdma_if.m')
-rw-r--r-- | sys/dev/ice/irdma_if.m | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/sys/dev/ice/irdma_if.m b/sys/dev/ice/irdma_if.m new file mode 100644 index 000000000000..84651b7cecc0 --- /dev/null +++ b/sys/dev/ice/irdma_if.m @@ -0,0 +1,106 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2021, Intel Corporation +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. 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. +# +# 3. Neither the name of the Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# $FreeBSD$ + +/** + * @file irdma_if.m + * @brief RDMA client kobject interface + * + * KOBject methods implemented by the RDMA client driver. These functions will + * be called from the ice driver to notify the RDMA client driver of device + * driver events. + */ +#include "ice_rdma.h" + +INTERFACE irdma; + +/** + * probe - Notify the RDMA client driver that a peer device has been created + * @peer: the RDMA peer structure + * + * Called by the ice driver during attach to notify the RDMA client driver + * that a new PF has been initialized. + */ +METHOD int probe { + struct ice_rdma_peer *peer; +}; + +/** + * open - Notify the RDMA client driver that a peer device has been opened + * @peer: the RDMA peer structure + * + * Called by the ice driver during the if_init routine to notify the RDMA + * client driver that a PF has been activated. + */ +METHOD int open { + struct ice_rdma_peer *peer; +}; + +/** + * close - Notify the RDMA client driver that a peer device has closed + * @peer: the RDMA peer structure + * + * Called by the ice driver during the if_stop routine to notify the RDMA + * client driver that a PF has been deactivated. + */ +METHOD int close { + struct ice_rdma_peer *peer; +}; + +/** + * remove - Notify the RDMA client driver that a peer device has been removed + * @peer: the RDMA peer structure + * + * Called by the ice driver during detach to notify the RDMA client driver + * that a PF has been removed. + */ +METHOD int remove { + struct ice_rdma_peer *peer; +} + +/** + * link_change - Notify the RDMA client driver that link status has changed + * @peer: the RDMA peer structure + * @linkstate: link status + * @baudrate: link rate in bits per second + * + * Called by the ice driver when link status changes to notify the RDMA client + * driver of the new status. + */ +METHOD void link_change { + struct ice_rdma_peer *peer; + int linkstate; + uint64_t baudrate; +} + +METHOD void event_handler { + struct ice_rdma_peer *peer; + struct ice_rdma_event *event; +} |