18a13362dSEric Joyner# SPDX-License-Identifier: BSD-3-Clause 2015f8cc5SEric Joyner# Copyright (c) 2024, Intel Corporation 38a13362dSEric Joyner# All rights reserved. 48a13362dSEric Joyner# 58a13362dSEric Joyner# Redistribution and use in source and binary forms, with or without 68a13362dSEric Joyner# modification, are permitted provided that the following conditions are met: 78a13362dSEric Joyner# 88a13362dSEric Joyner# 1. Redistributions of source code must retain the above copyright notice, 98a13362dSEric Joyner# this list of conditions and the following disclaimer. 108a13362dSEric Joyner# 118a13362dSEric Joyner# 2. Redistributions in binary form must reproduce the above copyright 128a13362dSEric Joyner# notice, this list of conditions and the following disclaimer in the 138a13362dSEric Joyner# documentation and/or other materials provided with the distribution. 148a13362dSEric Joyner# 158a13362dSEric Joyner# 3. Neither the name of the Intel Corporation nor the names of its 168a13362dSEric Joyner# contributors may be used to endorse or promote products derived from 178a13362dSEric Joyner# this software without specific prior written permission. 188a13362dSEric Joyner# 198a13362dSEric Joyner# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 208a13362dSEric Joyner# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 218a13362dSEric Joyner# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 228a13362dSEric Joyner# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 238a13362dSEric Joyner# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 248a13362dSEric Joyner# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 258a13362dSEric Joyner# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 268a13362dSEric Joyner# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 278a13362dSEric Joyner# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 288a13362dSEric Joyner# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 298a13362dSEric Joyner# POSSIBILITY OF SUCH DAMAGE. 308a13362dSEric Joyner 318a13362dSEric Joyner/** 328a13362dSEric Joyner * @file irdma_di_if.m 338a13362dSEric Joyner * @brief RDMA client kobject driver interface 348a13362dSEric Joyner * 358a13362dSEric Joyner * KObject methods implemented by the ice driver. These functions are called 368a13362dSEric Joyner * by the RDMA client driver to connect with the ice driver and request 378a13362dSEric Joyner * operations or notify the driver of RDMA events. 388a13362dSEric Joyner */ 398a13362dSEric Joyner#include "ice_rdma.h" 408a13362dSEric Joyner 418a13362dSEric JoynerINTERFACE irdma_di; 428a13362dSEric Joyner 438a13362dSEric Joyner/** 448a13362dSEric Joyner * reset - Request the ice driver to perform a reset 458a13362dSEric Joyner * @peer: the RDMA peer structure 468a13362dSEric Joyner * 478a13362dSEric Joyner * Called by the RDMA client driver to request a reset of the ice device. 489c30461dSEric Joyner * @return 0 on success 498a13362dSEric Joyner */ 508a13362dSEric JoynerMETHOD int reset { 518a13362dSEric Joyner struct ice_rdma_peer *peer; 528a13362dSEric Joyner}; 538a13362dSEric Joyner 548a13362dSEric Joyner/** 558a13362dSEric Joyner * msix_init - Initialize MSI-X resources for the RDMA driver 568a13362dSEric Joyner * @peer: the RDMA peer structure 578a13362dSEric Joyner * @msix_info: the requested MSI-X mapping 588a13362dSEric Joyner * 598a13362dSEric Joyner * Called by the RDMA client driver to request initialization of the MSI-X 608a13362dSEric Joyner * resources used for RDMA functionality. 619c30461dSEric Joyner * @returns ENOSYS 628a13362dSEric Joyner */ 638a13362dSEric JoynerMETHOD int msix_init { 648a13362dSEric Joyner struct ice_rdma_peer *peer; 658a13362dSEric Joyner struct ice_rdma_msix_mapping *msix_info; 668a13362dSEric Joyner}; 678a13362dSEric Joyner 688a13362dSEric Joyner/** 698a13362dSEric Joyner * qset_register_request - RDMA client interface request qset 708a13362dSEric Joyner * registration or deregistration 718a13362dSEric Joyner * @peer: the RDMA peer client structure 728a13362dSEric Joyner * @res: resources to be registered or unregistered 739c30461dSEric Joyner * @returns 0 on success, EINVAL on argument issues, ENOMEM on memory 749c30461dSEric Joyner * allocation failure, EXDEV on vsi device mismatch 758a13362dSEric Joyner */ 768a13362dSEric JoynerMETHOD int qset_register_request { 778a13362dSEric Joyner struct ice_rdma_peer *peer; 788a13362dSEric Joyner struct ice_rdma_qset_update *res; 798a13362dSEric Joyner}; 808a13362dSEric Joyner 818a13362dSEric Joyner/** 828a13362dSEric Joyner * vsi_filter_update - configure vsi information 838a13362dSEric Joyner * when opening or closing rdma driver 848a13362dSEric Joyner * @peer: the RDMA peer client structure 858a13362dSEric Joyner * @enable: enable or disable the rdma filter 869c30461dSEric Joyner * @return 0 on success, EINVAL on wrong vsi 878a13362dSEric Joyner */ 888a13362dSEric JoynerMETHOD int vsi_filter_update { 898a13362dSEric Joyner struct ice_rdma_peer *peer; 908a13362dSEric Joyner bool enable; 918a13362dSEric Joyner}; 928a13362dSEric Joyner 938a13362dSEric Joyner/** 948a13362dSEric Joyner * req_handler - handle requests incoming from RDMA driver 958a13362dSEric Joyner * @peer: the RDMA peer client structure 968a13362dSEric Joyner * @req: structure containing request 978a13362dSEric Joyner */ 988a13362dSEric JoynerMETHOD void req_handler { 998a13362dSEric Joyner struct ice_rdma_peer *peer; 1008a13362dSEric Joyner struct ice_rdma_request *req; 1018a13362dSEric Joyner}; 102