ib_rdma.c revision 16e76cdd6e3cfaac7d91c3b0644ee1bc6cf52347
/*
*/
/*
* This file contains code imported from the OFED rds source file ib_rdma.c
* Oracle elects to have and use the contents of ib_rdma.c under and governed
* by the OpenIB.org BSD license (see below for full license text). However,
* the following notice accompanied the original version of this file:
*/
/*
* Copyright (c) 2006 Oracle. 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
* 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 is stored as mr->r_trans_private.
*/
struct rdsv3_ib_mr {
struct rdsv3_ib_device *m_device;
unsigned int m_inval:1;
struct rdsv3_scatterlist *sg;
unsigned int sg_len;
int sg_dma_len;
/* DDI pinned memory */
/* IBTF type definitions */
};
/*
* delayed freed fmr's
*/
struct rdsv3_fmr_pool {
};
*rds_ibdev);
static struct rdsv3_ib_device *
{
struct rdsv3_ib_device *rds_ibdev;
struct rdsv3_ib_ipaddr *i_ipaddr;
list) {
return (rds_ibdev);
}
}
}
return (NULL);
}
static int
{
struct rdsv3_ib_ipaddr *i_ipaddr;
if (!i_ipaddr)
return (-ENOMEM);
return (0);
}
static void
{
list) {
break;
}
}
if (to_free) {
}
RDSV3_DPRINTF4("rdsv3_ib_remove_ipaddr",
}
int
{
struct rdsv3_ib_device *rds_ibdev_old;
if (rds_ibdev_old)
}
void
struct rdsv3_connection *conn)
{
/* conn was previously on the nodev_conns_list */
}
void
struct rdsv3_connection *conn)
{
/* place conn on nodev_conns_list */
RDSV3_DPRINTF4("rdsv3_ib_remove_conn",
}
void
{
/* avoid calling conn_destroy with irqs off */
}
}
void
{
return;
if (pool) {
}
}
int
{
struct rdsv3_fmr_pool *pool;
RDSV3_DPRINTF4("rdsv3_ib_create_mr_pool",
"Enter: ibdev: %p", rds_ibdev);
return (-ENOMEM);
}
/* setup FMR pool attributes */
/* create the FMR pool */
if (ibt_status != IBT_SUCCESS) {
return (-ENOMEM);
}
RDSV3_DPRINTF2("rdsv3_ib_create_mr_pool",
return (0);
}
void
struct rdsv3_info_rdma_connection *iinfo)
{
}
void *
{
struct rdsv3_ib_device *rds_ibdev;
int ret;
return (ibmr);
/* pin user memory pages */
if (ret != 0) {
return (ibmr);
}
/* transpose umem_cookie to buf structure for rdsv3_ib_map_fmr() */
if (ret == 0) {
RDSV3_DPRINTF4("rdsv3_ib_get_mr",
return (ibmr);
} else { /* error return */
ret);
}
}
static struct rdsv3_ib_mr *
{
struct rdsv3_ib_mr *ibmr;
if (rds_ibdev->fmr_pool_hdl) {
KM_SLEEP);
return (ibmr);
}
}
static int
{
/* LINTED E_FUNC_SET_NOT_USED */
/* setup ibt_map_mem_area attributes */
/* map user buffer to HCA address */
if (ibt_status != IBT_SUCCESS) {
return (-ENOMEM);
}
/* use a free entry from FMR pool to register the specified memory */
if (ibt_status != IBT_SUCCESS) {
if (ibt_status == IBT_INSUFF_RESOURCE) {
return (-ENOBUFS);
}
return (-EINVAL);
}
return (0);
}
void
{
/* LINTED E_FUNC_SET_NOT_USED */
void *l_trans_private = trans_private;
/* LINTED E_FUNC_SET_NOT_USED */
int l_direction = direction;
/* FMR Sync not needed in Solaris on PCI-ex systems */
}
void
rdsv3_ib_flush_mrs(void)
{
struct rdsv3_ib_device *rds_ibdev;
if (rds_ibdev->fmr_pool_hdl) {
(void) rdsv3_ib_flush_mr_pool(rds_ibdev,
rds_ibdev->fmr_pool_hdl, 0);
}
}
}
static void
{
/* return the fmr to the IBTF pool */
}
void
rdsv3_ib_drain_mrlist_fn(void *data)
{
unsigned int inval;
struct rdsv3_ib_mr *ibmr;
int i;
inval = 0;
i = 0;
for (;;) {
if (ibmr)
if (!ibmr)
break;
inval = 1;
}
i++;
}
if (inval)
}
void
{
ibmr, invalidate);
/* save af_thr at local as ibmr might be freed at mutex_exit */
}
static int
{
/* LINTED E_FUNC_SET_NOT_USED */
int l_free_all = free_all;
pool_hdl);
return (0);
}