diff options
Diffstat (limited to 'usr/src')
29 files changed, 537 insertions, 197 deletions
diff --git a/usr/src/lib/udapl/libdat/common/dat_strerror.c b/usr/src/lib/udapl/libdat/common/dat_strerror.c index 60c1cbdc1e..add4296439 100644 --- a/usr/src/lib/udapl/libdat/common/dat_strerror.c +++ b/usr/src/lib/udapl/libdat/common/dat_strerror.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -24,13 +23,10 @@ */ /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - - /* * * MODULE: dat_strerror.c @@ -561,6 +557,9 @@ dat_strerror_minor( *message = "DAT_INVALID_ADDRESS_MALFORMED"; return (DAT_SUCCESS); } + case DAT_INVALID_RO_COOKIE: + *message = "DAT_INVALID_RO_COOKIE"; + return (DAT_SUCCESS); default: { return (DAT_INVALID_PARAMETER); diff --git a/usr/src/lib/udapl/libdat/common/udat.c b/usr/src/lib/udapl/libdat/common/udat.c index a5bce5dbbd..869c24591e 100644 --- a/usr/src/lib/udapl/libdat/common/udat.c +++ b/usr/src/lib/udapl/libdat/common/udat.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -24,12 +23,10 @@ */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * @@ -158,18 +155,21 @@ dat_ia_openv( DAT_IA_OPEN_FUNC ia_open_func; DAT_PROVIDER_INFO info; DAT_RETURN status; - DAT_OS_SIZE len; + DAT_OS_SIZE len; +#define RO_AWARE_PREFIX "RO_AWARE_" + boolean_t ro_aware_client; + const char *_name = name; dat_os_dbg_print(DAT_OS_DBG_TYPE_CONSUMER_API, "DAT Registry: dat_ia_open() called\n"); - if (UDAT_IS_BAD_POINTER(name)) { + if (UDAT_IS_BAD_POINTER(_name)) { return (DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG1)); } - len = dat_os_strlen(name); + len = dat_os_strlen(_name); - if (DAT_NAME_MAX_LENGTH < len) { + if (DAT_NAME_MAX_LENGTH <= len) { return (DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG1)); } @@ -181,7 +181,18 @@ dat_ia_openv( return (DAT_ERROR(DAT_INVALID_STATE, 0)); } - (void) dat_os_strncpy(info.ia_name, name, len); + /* Find out if this is an RO aware client and if so, strip the prefix */ + ro_aware_client = + (strncmp(RO_AWARE_PREFIX, _name, sizeof (RO_AWARE_PREFIX) - 1) == + 0); + + /* strip off the prefix from the provider's name if present */ + if (ro_aware_client) { + _name = _name + sizeof (RO_AWARE_PREFIX) - 1; + len -= sizeof (RO_AWARE_PREFIX) - 1; + } + + (void) dat_os_strncpy(info.ia_name, _name, len); info.ia_name[len] = '\0'; info.dapl_version_major = dapl_major; @@ -205,14 +216,15 @@ dat_ia_openv( dat_os_dbg_print(DAT_OS_DBG_TYPE_CONSUMER_API, "DAT Registry: dat_ia_open() provider information " "for IA name %s not found in dynamic registry\n", - name); + _name); return (status); } - return (*ia_open_func)(name, + return (*ia_open_func)((const DAT_NAME_PTR) _name, async_event_qlen, async_event_handle, - ia_handle); + ia_handle, + ro_aware_client); } diff --git a/usr/src/lib/udapl/libdat/include/dat/dat.h b/usr/src/lib/udapl/libdat/include/dat/dat.h index 3d1c4603db..71e1220f93 100644 --- a/usr/src/lib/udapl/libdat/include/dat/dat.h +++ b/usr/src/lib/udapl/libdat/include/dat/dat.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -24,15 +23,13 @@ */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _DAT_H_ #define _DAT_H_ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * * HEADER: dat.h @@ -270,7 +267,8 @@ typedef enum dat_mem_priv_flags { DAT_MEM_PRIV_REMOTE_READ_FLAG = 0x02, DAT_MEM_PRIV_LOCAL_WRITE_FLAG = 0x10, DAT_MEM_PRIV_REMOTE_WRITE_FLAG = 0x20, - DAT_MEM_PRIV_ALL_FLAG = 0x33 + DAT_MEM_PRIV_ALL_FLAG = 0x33, + DAT_MEM_PRIV_RO_DISABLE_FLAG = 0x100 } DAT_MEM_PRIV_FLAGS; /* diff --git a/usr/src/lib/udapl/libdat/include/dat/dat_error.h b/usr/src/lib/udapl/libdat/include/dat/dat_error.h index 3298250521..4746c20112 100644 --- a/usr/src/lib/udapl/libdat/include/dat/dat_error.h +++ b/usr/src/lib/udapl/libdat/include/dat/dat_error.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -24,15 +23,13 @@ */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _DAT_ERROR_H_ #define _DAT_ERROR_H_ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * * HEADER: dat_error.h @@ -377,7 +374,10 @@ typedef enum dat_return_subtype DAT_NAME_NOT_REGISTERED, DAT_MAJOR_NOT_FOUND, DAT_MINOR_NOT_FOUND, - DAT_THREAD_SAFETY_NOT_FOUND + DAT_THREAD_SAFETY_NOT_FOUND, + + /* DAT_INVALID_PARAMETER Sun specific */ + DAT_INVALID_RO_COOKIE } DAT_RETURN_SUBTYPE; diff --git a/usr/src/lib/udapl/libdat/include/dat/dat_redirection.h b/usr/src/lib/udapl/libdat/include/dat/dat_redirection.h index f380652733..938833c318 100644 --- a/usr/src/lib/udapl/libdat/include/dat/dat_redirection.h +++ b/usr/src/lib/udapl/libdat/include/dat/dat_redirection.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -24,7 +23,7 @@ */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -32,8 +31,6 @@ #ifndef _DAT_REDIRECTION_H_ #define _DAT_REDIRECTION_H_ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * * HEADER: dat_redirection.h @@ -414,7 +411,8 @@ typedef DAT_RETURN (*DAT_IA_OPEN_FUNC)( IN const DAT_NAME_PTR, /* provider */ IN DAT_COUNT, /* asynch_evd_min_qlen */ INOUT DAT_EVD_HANDLE *, /* asynch_evd_handle */ - OUT DAT_IA_HANDLE *); /* ia_handle */ + OUT DAT_IA_HANDLE *, /* ia_handle */ + IN boolean_t); /* relaxed ordering aware */ typedef DAT_RETURN (*DAT_IA_OPENV_FUNC)( IN const DAT_NAME_PTR, /* provider */ diff --git a/usr/src/lib/udapl/libdat/include/dat/udat.h b/usr/src/lib/udapl/libdat/include/dat/udat.h index 5632092131..978bc53b35 100644 --- a/usr/src/lib/udapl/libdat/include/dat/udat.h +++ b/usr/src/lib/udapl/libdat/include/dat/udat.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -24,7 +23,7 @@ */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -32,8 +31,6 @@ #ifndef _UDAT_H_ #define _UDAT_H_ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * * HEADER: udat.h @@ -65,7 +62,8 @@ typedef enum dat_mem_type DAT_MEM_TYPE_VIRTUAL = 0x00, DAT_MEM_TYPE_LMR = 0x01, /* udat specific */ - DAT_MEM_TYPE_SHARED_VIRTUAL = 0x02 + DAT_MEM_TYPE_SHARED_VIRTUAL = 0x02, + DAT_MEM_TYPE_SO_VIRTUAL = 0x03 } DAT_MEM_TYPE; /* dat handle types */ diff --git a/usr/src/uts/common/io/ib/clients/ibd/ibd.c b/usr/src/uts/common/io/ib/clients/ibd/ibd.c index b41a46cf19..fe904905af 100644 --- a/usr/src/uts/common/io/ib/clients/ibd/ibd.c +++ b/usr/src/uts/common/io/ib/clients/ibd/ibd.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -268,7 +268,7 @@ static struct modlinkage ibd_modlinkage = { * data). */ static struct ibt_clnt_modinfo_s ibd_clnt_modinfo = { - IBTI_V2, + IBTI_V_CURR, IBT_NETWORK, ibd_async_handler, NULL, diff --git a/usr/src/uts/common/io/ib/clients/rds/rdsib_ib.c b/usr/src/uts/common/io/ib/clients/rds/rdsib_ib.c index 380ad1af17..651836bf77 100644 --- a/usr/src/uts/common/io/ib/clients/rds/rdsib_ib.c +++ b/usr/src/uts/common/io/ib/clients/rds/rdsib_ib.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* @@ -85,7 +85,7 @@ static void rds_async_handler(void *clntp, ibt_hca_hdl_t hdl, ibt_async_code_t code, ibt_async_event_t *event); static struct ibt_clnt_modinfo_s rds_ib_modinfo = { - IBTI_V2, + IBTI_V_CURR, IBT_NETWORK, rds_async_handler, NULL, diff --git a/usr/src/uts/common/io/ib/ibtl/ibtl_cq.c b/usr/src/uts/common/io/ib/ibtl/ibtl_cq.c index 36b3dbb0c6..6a8142d328 100644 --- a/usr/src/uts/common/io/ib/ibtl/ibtl_cq.c +++ b/usr/src/uts/common/io/ib/ibtl/ibtl_cq.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,10 +19,9 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" #include <sys/ib/ibtl/impl/ibtl.h> @@ -204,12 +202,13 @@ ibt_free_cq(ibt_cq_hdl_t ibt_cq) * ibt_query_cq() - Returns the size of the cq */ ibt_status_t -ibt_query_cq(ibt_cq_hdl_t ibt_cq, uint32_t *entries_p) +ibt_query_cq(ibt_cq_hdl_t ibt_cq, uint32_t *entries_p, uint_t *count_p, + uint_t *usec_p, ibt_cq_handler_id_t *hid_p) { IBTF_DPRINTF_L3(ibtf_cq, "ibt_query_cq(%p)", ibt_cq); return (IBTL_CQ2CIHCAOPS_P(ibt_cq)->ibc_query_cq(IBTL_CQ2CIHCA(ibt_cq), - ibt_cq->cq_ibc_cq_hdl, entries_p)); + ibt_cq->cq_ibc_cq_hdl, entries_p, count_p, usec_p, hid_p)); } @@ -225,6 +224,17 @@ ibt_resize_cq(ibt_cq_hdl_t ibt_cq, uint32_t new_sz, uint32_t *real_sz) ibt_cq->cq_ibc_cq_hdl, new_sz, real_sz)); } +ibt_status_t +ibt_modify_cq(ibt_cq_hdl_t ibt_cq, uint_t count, uint_t usec, + ibt_cq_handler_id_t hid) +{ + IBTF_DPRINTF_L3(ibtf_cq, "ibt_modify_cq(%p, %d, %d, %d)", ibt_cq, count, + usec, hid); + + return (IBTL_CQ2CIHCAOPS_P(ibt_cq)->ibc_modify_cq(IBTL_CQ2CIHCA(ibt_cq), + ibt_cq->cq_ibc_cq_hdl, count, usec, hid)); +} + /* * ibt_poll_cq() diff --git a/usr/src/uts/common/io/ib/ibtl/ibtl_handlers.c b/usr/src/uts/common/io/ib/ibtl/ibtl_handlers.c index 130a0012a3..1592d06e01 100644 --- a/usr/src/uts/common/io/ib/ibtl/ibtl_handlers.c +++ b/usr/src/uts/common/io/ib/ibtl/ibtl_handlers.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1092,7 +1092,7 @@ ibtl_cq_handler_call(ibtl_cq_t *ibtl_cq) IBTF_DPRINTF_L4(ibtf_handlers, "ibtl_cq_handler_call(%p)", ibtl_cq); - mutex_enter(&ibtl_cq->cq_mutex); + _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ibtl_cq)) cq_handler = ibtl_cq->cq_comp_handler; arg = ibtl_cq->cq_arg; if (cq_handler != NULL) @@ -1100,7 +1100,6 @@ ibtl_cq_handler_call(ibtl_cq_t *ibtl_cq) else IBTF_DPRINTF_L2(ibtf_handlers, "ibtl_cq_handler_call: " "no cq_handler for cq %p", ibtl_cq); - mutex_exit(&ibtl_cq->cq_mutex); } /* @@ -1280,10 +1279,9 @@ ibt_set_cq_handler(ibt_cq_hdl_t ibtl_cq, ibt_cq_handler_t completion_handler, IBTF_DPRINTF_L3(ibtf_handlers, "ibt_set_cq_handler(%p, %p, %p)", ibtl_cq, completion_handler, arg); - mutex_enter(&ibtl_cq->cq_mutex); + _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ibtl_cq)) ibtl_cq->cq_comp_handler = completion_handler; ibtl_cq->cq_arg = arg; - mutex_exit(&ibtl_cq->cq_mutex); } diff --git a/usr/src/uts/common/io/ib/ibtl/ibtl_impl.c b/usr/src/uts/common/io/ib/ibtl/ibtl_impl.c index 5542ac9f71..9d3a8fea42 100644 --- a/usr/src/uts/common/io/ib/ibtl/ibtl_impl.c +++ b/usr/src/uts/common/io/ib/ibtl/ibtl_impl.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -232,7 +232,7 @@ ibt_attach(ibt_clnt_modinfo_t *mod_infop, dev_info_t *arg, void *clnt_private, /* * Validate the Transport API version. */ - if (mod_infop->mi_ibt_version != IBTI_V2) { + if (mod_infop->mi_ibt_version != IBTI_V_CURR) { IBTF_DPRINTF_L1(ibtf, "ibt_attach: IB client '%s' has an " "invalid IB TI Version '%d'", mod_infop->mi_clnt_name, mod_infop->mi_ibt_version); @@ -522,7 +522,7 @@ ibc_attach(ibc_clnt_hdl_t *ibc_hdl_p, ibc_hca_info_t *info_p) IBTF_DPRINTF_L2(ibtf, "ibc_attach(%p, %p)", ibc_hdl_p, info_p); /* Validate the Transport API version */ - if (info_p->hca_ci_vers != IBCI_V2) { + if (info_p->hca_ci_vers != IBCI_V3) { IBTF_DPRINTF_L1(ibtf, "ibc_attach: Invalid IB CI Version '%d'", info_p->hca_ci_vers); return (IBC_FAILURE); diff --git a/usr/src/uts/common/io/ib/ibtl/ibtl_mem.c b/usr/src/uts/common/io/ib/ibtl/ibtl_mem.c index 7ce4a1fdde..c8e4559e5b 100644 --- a/usr/src/uts/common/io/ib/ibtl/ibtl_mem.c +++ b/usr/src/uts/common/io/ib/ibtl/ibtl_mem.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,11 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" #include <sys/ib/ibtl/impl/ibtl.h> @@ -571,6 +569,127 @@ ibt_unmap_mem_area(ibt_hca_hdl_t hca_hdl, ibt_ma_hdl_t ma_hdl) return (status); } +/* + * Function: + * ibt_map_mem_iov() + * Input: + * hca_hdl HCA Handle + * iov_attr A pointer to an ibt_iov_attr_t that describes the + * virtual ranges to be translated. + * Output: + * wr A pointer to the work request where the output + * sgl (reserved_lkey, size, paddr) will be written. + * mi_hdl_p Memory IOV Handle. + * Returns: + * IBT_SUCCESS + * Description: + * Translate an array of virtual address ranges into HCA physical + * addresses, sizes, and reserved_lkey. + */ +ibt_status_t +ibt_map_mem_iov(ibt_hca_hdl_t hca_hdl, ibt_iov_attr_t *iov_attr, + ibt_all_wr_t *wr, ibt_mi_hdl_t *mi_hdl_p) +{ + ibt_status_t status; + + IBTF_DPRINTF_L3(ibtl_mem, "ibt_map_mem_iov(%p, %p, %p)", + hca_hdl, iov_attr, wr); + + status = IBTL_HCA2CIHCAOPS_P(hca_hdl)->ibc_map_mem_iov( + IBTL_HCA2CIHCA(hca_hdl), iov_attr, wr, mi_hdl_p); + if (status == IBT_SUCCESS) { + mutex_enter(&hca_hdl->ha_mutex); + hca_hdl->ha_ma_cnt++; + mutex_exit(&hca_hdl->ha_mutex); + } + + return (status); +} + + +/* + * Function: + * ibt_unmap_mem_iov() + * Input: + * hca_hdl HCA Handle + * mi_hdl Memory IOV Handle. + * Output: + * None. + * Returns: + * IBT_SUCCESS + * Description: + * Un pin physical pages pinned during an ibt_map_mem_iov() call. + */ +ibt_status_t +ibt_unmap_mem_iov(ibt_hca_hdl_t hca_hdl, ibt_mi_hdl_t mi_hdl) +{ + ibt_status_t status; + + IBTF_DPRINTF_L3(ibtl_mem, "ibt_unmap_mem_iov(%p, %p)", + hca_hdl, mi_hdl); + + status = (IBTL_HCA2CIHCAOPS_P(hca_hdl)->ibc_unmap_mem_iov( + IBTL_HCA2CIHCA(hca_hdl), mi_hdl)); + if (status == IBT_SUCCESS) { + mutex_enter(&hca_hdl->ha_mutex); + hca_hdl->ha_ma_cnt--; + mutex_exit(&hca_hdl->ha_mutex); + } + + return (status); +} + +/* + * Function: + * ibt_alloc_io_mem() + * Input: + * hca_hdl HCA Handle + * size Number of bytes to allocate + * mr_flag Possible values: IBT_MR_SLEEP, IBT_MR_NONCOHERENT + * Output: + * kaddrp Contains pointer to the virtual address of the + * memory allocated by this call. (Set to NULL if + * memory allocation fails). + * mem_alloc_hdl Memory access handle returned by ibt_mem_alloc() + * + * Returns: + * IBT_SUCCESS + * IBT_INSUFF_RESOURCE + * IBT_HCA_HDL_INVALID + * IBT_MR_ACCESS_REQ_INVALID + * IBT_INVALID_PARAM + * Description: + * Wrapper for ddi_dma_mem_alloc() + */ +ibt_status_t +ibt_alloc_io_mem(ibt_hca_hdl_t hca_hdl, size_t size, ibt_mr_flags_t mr_flag, + caddr_t *kaddrp, ibt_mem_alloc_hdl_t *mem_alloc_hdl) +{ + return (IBTL_HCA2CIHCAOPS_P(hca_hdl)->ibc_alloc_io_mem( + IBTL_HCA2CIHCA(hca_hdl), size, mr_flag, kaddrp, + (ibc_mem_alloc_hdl_t *)mem_alloc_hdl)); +} + +/* + * Function: + * ibt_free_io_mem() + * Input: + * hca_hdl HCA Handle + * mem_alloc_hdl Memory access handle returned by ibt_mem_alloc() + * Output: + * None + * + * Returns: + * IBT_SUCCESS + * Description: + * Wrapper for ddi_dma_mem_free() + */ +ibt_status_t +ibt_free_io_mem(ibt_hca_hdl_t hca_hdl, ibt_mem_alloc_hdl_t mem_alloc_hdl) +{ + return (IBTL_HCA2CIHCAOPS_P(hca_hdl)->ibc_free_io_mem( + IBTL_HCA2CIHCA(hca_hdl), (ibc_mem_alloc_hdl_t)mem_alloc_hdl)); +} /* * Function: diff --git a/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_arp.c b/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_arp.c index dd7c9554a5..f846923a96 100644 --- a/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_arp.c +++ b/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_arp.c @@ -582,6 +582,7 @@ ibcm_do_lifconf(struct lifconf *lifcp, uint_t *bufsizep) lifn.lifn_count += 4; bzero(lifcp, sizeof (struct lifconf)); + _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*lifcp)) lifcp->lifc_family = AF_UNSPEC; lifcp->lifc_len = *bufsizep = lifn.lifn_count * sizeof (struct lifreq); lifcp->lifc_buf = kmem_zalloc(*bufsizep, KM_SLEEP); diff --git a/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_impl.c b/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_impl.c index 3cdc87d634..512faaa38a 100644 --- a/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_impl.c +++ b/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_impl.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -226,7 +226,7 @@ struct ibcm_close_s { } ibcm_close; static ibt_clnt_modinfo_t ibcm_ibt_modinfo = { /* Client's modinfop */ - IBTI_V2, + IBTI_V_CURR, IBT_CM, ibcm_async_handler, NULL, diff --git a/usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c b/usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c index 12da927fff..c39a0e794f 100644 --- a/usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c +++ b/usr/src/uts/common/io/ib/mgt/ibdm/ibdm.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -171,7 +171,7 @@ struct modlinkage ibdm_modlinkage = { }; static ibt_clnt_modinfo_t ibdm_ibt_modinfo = { - IBTI_V2, + IBTI_V_CURR, IBT_DM, ibdm_event_hdlr, NULL, diff --git a/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_impl.c b/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_impl.c index 0290a4b2fe..afa5adb6c1 100644 --- a/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_impl.c +++ b/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_impl.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * This file implements the client interfaces of the IBMF. */ @@ -168,7 +165,7 @@ ibmf_init(void) IBMF_TNF_TRACE, "", "ibmf_init() enter\n"); /* setup the IBT module information */ - ibmf_statep->ibmf_ibt_modinfo.mi_ibt_version = IBTI_V2; + ibmf_statep->ibmf_ibt_modinfo.mi_ibt_version = IBTI_V_CURR; ibmf_statep->ibmf_ibt_modinfo.mi_clnt_class = IBT_IBMA; ibmf_statep->ibmf_ibt_modinfo.mi_async_handler = ibmf_ibt_async_handler; diff --git a/usr/src/uts/common/io/warlock/hermon.wlcmd b/usr/src/uts/common/io/warlock/hermon.wlcmd index f3ef62b246..ad23dc0a2a 100644 --- a/usr/src/uts/common/io/warlock/hermon.wlcmd +++ b/usr/src/uts/common/io/warlock/hermon.wlcmd @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -39,6 +39,7 @@ root hermon_ci_query_ah root hermon_ci_modify_ah root hermon_ci_alloc_qp root hermon_ci_alloc_special_qp +root hermon_ci_alloc_qp_range root hermon_ci_free_qp root hermon_ci_release_qpn root hermon_ci_query_qp @@ -47,6 +48,7 @@ root hermon_ci_alloc_cq root hermon_ci_free_cq root hermon_ci_query_cq root hermon_ci_resize_cq +root hermon_ci_modify_cq root hermon_ci_alloc_cq_sched root hermon_ci_free_cq_sched root hermon_ci_alloc_eec @@ -79,6 +81,8 @@ root hermon_ci_modify_srq root hermon_ci_post_srq root hermon_ci_map_mem_area root hermon_ci_unmap_mem_area +root hermon_ci_map_mem_iov +root hermon_ci_unmap_mem_iov root hermon_ci_alloc_lkey root hermon_ci_register_physical_mr root hermon_ci_reregister_physical_mr @@ -87,6 +91,8 @@ root hermon_ci_destroy_fmr_pool root hermon_ci_flush_fmr_pool root hermon_ci_register_physical_fmr root hermon_ci_deregister_fmr +root hermon_ci_alloc_io_mem +root hermon_ci_free_io_mem ### Hermon Firmware commands (currently unused) root hermon_sync_tpt_cmd_post @@ -159,6 +165,9 @@ root hermon_fmr_avl_compare root hermon_fmr_processing add hermon_sw_fmr_s::fmr_flush_function targets warlock_dummy +### Hermon FMR processing +root hermon_inter_err_chk + add bus_ops::bus_add_eventcall targets warlock_dummy add bus_ops::bus_get_eventcookie targets warlock_dummy add bus_ops::bus_post_event targets warlock_dummy diff --git a/usr/src/uts/common/io/warlock/ibtl.wlcmd b/usr/src/uts/common/io/warlock/ibtl.wlcmd index 579c3ca4ab..39380b532e 100644 --- a/usr/src/uts/common/io/warlock/ibtl.wlcmd +++ b/usr/src/uts/common/io/warlock/ibtl.wlcmd @@ -18,10 +18,9 @@ # # CDDL HEADER END # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # IBTF TI and VTI api entry points root ibt_attach @@ -84,6 +83,7 @@ root ibt_alloc_cq root ibt_free_cq root ibt_query_cq root ibt_resize_cq +root ibt_modify_cq root ibt_poll_cq root ibt_set_cq_private root ibt_get_cq_private @@ -148,6 +148,10 @@ root ibt_post_srq root ibt_query_srq root ibt_get_srq_private root ibt_set_srq_private +root ibt_alloc_io_mem +root ibt_free_io_mem +root ibt_map_mem_iov +root ibt_unmap_mem_iov # IBTF CI api entry points root ibc_init @@ -245,6 +249,7 @@ add ibc_operations_s::ibc_free_mw targets warlock_dummy add ibc_operations_s::ibc_free_pd targets warlock_dummy add ibc_operations_s::ibc_free_qp targets warlock_dummy add ibc_operations_s::ibc_modify_ah targets warlock_dummy +add ibc_operations_s::ibc_modify_cq targets warlock_dummy add ibc_operations_s::ibc_modify_ports targets warlock_dummy add ibc_operations_s::ibc_modify_qp targets warlock_dummy add ibc_operations_s::ibc_modify_system_image targets warlock_dummy @@ -281,6 +286,10 @@ add ibc_operations_s::ibc_destroy_fmr_pool targets warlock_dummy add ibc_operations_s::ibc_flush_fmr_pool targets warlock_dummy add ibc_operations_s::ibc_register_physical_fmr targets warlock_dummy add ibc_operations_s::ibc_deregister_fmr targets warlock_dummy +add ibc_operations_s::ibc_alloc_io_mem targets warlock_dummy +add ibc_operations_s::ibc_free_io_mem targets warlock_dummy +add ibc_operations_s::ibc_map_mem_iov targets warlock_dummy +add ibc_operations_s::ibc_unmap_mem_iov targets warlock_dummy add ibt_clnt_modinfo_s::mi_async_handler targets warlock_dummy add ibtl_handlers.c:ibtl_async_client_call/async_handler targets warlock_dummy add ibtl_handlers.c:ibtl_cq_handler_call/cq_handler targets warlock_dummy diff --git a/usr/src/uts/common/io/warlock/tavor.wlcmd b/usr/src/uts/common/io/warlock/tavor.wlcmd index 32acea6328..47ed431b8b 100644 --- a/usr/src/uts/common/io/warlock/tavor.wlcmd +++ b/usr/src/uts/common/io/warlock/tavor.wlcmd @@ -1,8 +1,7 @@ # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" one tavor_state_s @@ -20,6 +19,7 @@ root tavor_ci_query_ah root tavor_ci_modify_ah root tavor_ci_alloc_qp root tavor_ci_alloc_special_qp +root tavor_ci_alloc_qp_range root tavor_ci_free_qp root tavor_ci_release_qpn root tavor_ci_query_qp @@ -28,6 +28,7 @@ root tavor_ci_alloc_cq root tavor_ci_free_cq root tavor_ci_query_cq root tavor_ci_resize_cq +root tavor_ci_modify_cq root tavor_ci_alloc_cq_sched root tavor_ci_free_cq_sched root tavor_ci_alloc_eec @@ -68,6 +69,10 @@ root tavor_ci_destroy_fmr_pool root tavor_ci_flush_fmr_pool root tavor_ci_register_physical_fmr root tavor_ci_deregister_fmr +root tavor_ci_map_mem_iov +root tavor_ci_unmap_mem_iov +root tavor_ci_alloc_io_mem +root tavor_ci_free_io_mem ### Tavor Firmware commands (currently unused) root tavor_sync_tpt_cmd_post diff --git a/usr/src/uts/common/rpc/rpcib.c b/usr/src/uts/common/rpc/rpcib.c index aba7803131..4bb39ae2ef 100644 --- a/usr/src/uts/common/rpc/rpcib.c +++ b/usr/src/uts/common/rpc/rpcib.c @@ -374,7 +374,7 @@ static rdma_stat rib_chk_srv_ibaddr(struct netbuf *, int, * Registration with IBTF as a consumer */ static struct ibt_clnt_modinfo_s rib_modinfo = { - IBTI_V2, + IBTI_V_CURR, IBT_GENERIC, rib_async_handler, /* async event handler */ NULL, /* Memory Region Handler */ diff --git a/usr/src/uts/common/sys/ib/ibtl/ibci.h b/usr/src/uts/common/sys/ib/ibtl/ibci.h index 419ff5ae8b..636773f989 100644 --- a/usr/src/uts/common/sys/ib/ibtl/ibci.h +++ b/usr/src/uts/common/sys/ib/ibtl/ibci.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,15 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_IB_IBTL_IBCI_H #define _SYS_IB_IBTL_IBCI_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ibci.h * @@ -65,11 +62,13 @@ typedef struct ibc_srq_s *ibc_srq_hdl_t; /* Shared Receive Queue Hdl */ typedef struct ibc_qpn_s *ibc_qpn_hdl_t; /* Queue Pair Number Handle */ typedef struct ibc_cq_s *ibc_cq_hdl_t; /* Completion Queue Handle */ typedef struct ibc_eec_s *ibc_eec_hdl_t; /* End-to-End Context Handle */ +typedef struct ibc_mem_alloc_s *ibc_mem_alloc_hdl_t; /* Memory Handle */ #define ibc_fmr_pool_hdl_t ibt_fmr_pool_hdl_t /* FMR Pool Handle */ #define ibc_mr_hdl_t ibt_mr_hdl_t /* Memory Region Handle */ #define ibc_mw_hdl_t ibt_mw_hdl_t /* Memory Window Handle */ #define ibc_ma_hdl_t ibt_ma_hdl_t /* Memory Area Handle */ +#define ibc_mi_hdl_t ibt_mi_hdl_t /* Memory IOV Handle */ /* Handle used by CI for up calls to IBTF */ typedef struct ibtl_hca_devinfo_s *ibc_clnt_hdl_t; /* ibc_attach() */ @@ -156,13 +155,14 @@ typedef struct ibtl_hca_devinfo_s *ibc_clnt_hdl_t; /* ibc_attach() */ /* * ibt_wc_t */ -#define wc_eecn wc_opaque3 /* End-to-End Context RD's only */ +#define wc_eecn wc_detail /* End-to-End Context RD's only */ /* Channel Interface version */ typedef enum ibc_version_e { IBCI_V1 = 1, - IBCI_V2 = 2 /* FMR Support */ + IBCI_V2 = 2, /* FMR Support */ + IBCI_V3 = 3 } ibc_version_t; @@ -221,8 +221,9 @@ typedef struct ibc_async_event_s { ibtl_qp_hdl_t ev_qp_hdl; /* IBTF QP handle. */ ibtl_eec_hdl_t ev_eec_hdl; /* IBTF EEC handle. */ ibt_cq_hdl_t ev_cq_hdl; /* IBT CQ handle. */ - uint8_t ev_port; /* Valid for PORT UP/DOWN events */ ibt_srq_hdl_t ev_srq_hdl; /* SRQ handle */ + ibt_port_change_t ev_port_flags; /* Port Change flags */ + uint8_t ev_port; /* For PORT UP/DOWN/CHANGE events */ } ibc_async_event_t; @@ -262,6 +263,11 @@ typedef struct ibc_operations_s { ibtl_qp_hdl_t ibt_qp, ibt_sqp_type_t type, ibt_qp_alloc_attr_t *attr_p, ibt_chan_sizes_t *queue_sizes_p, ibc_qp_hdl_t *qp_p); + ibt_status_t (*ibc_alloc_qp_range)(ibc_hca_hdl_t hca, uint_t log2, + ibtl_qp_hdl_t *ibtl_qp_p, ibt_qp_type_t type, + ibt_qp_alloc_attr_t *attr_p, ibt_chan_sizes_t *queue_sizes_p, + ibc_cq_hdl_t *send_cq_p, ibc_cq_hdl_t *recv_cq_p, + ib_qpn_t *qpn_p, ibc_qp_hdl_t *qp_p); ibt_status_t (*ibc_free_qp)(ibc_hca_hdl_t hca, ibc_qp_hdl_t qp, ibc_free_qp_flags_t free_qp_flags, ibc_qpn_hdl_t *qpnh_p); ibt_status_t (*ibc_release_qpn)(ibc_hca_hdl_t hca, ibc_qpn_hdl_t qpnh); @@ -276,9 +282,12 @@ typedef struct ibc_operations_s { ibt_cq_attr_t *attr_p, ibc_cq_hdl_t *cq_p, uint_t *actual_size); ibt_status_t (*ibc_free_cq)(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq); ibt_status_t (*ibc_query_cq)(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq, - uint_t *entries); + uint_t *entries, uint_t *count_p, uint_t *usec_p, + ibt_cq_handler_id_t *hid_p); ibt_status_t (*ibc_resize_cq)(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq, uint_t size, uint_t *actual_size); + ibt_status_t (*ibc_modify_cq)(ibc_hca_hdl_t hca, ibc_cq_hdl_t cq, + uint_t count, uint_t usec, ibt_cq_handler_id_t hid); ibt_status_t (*ibc_alloc_cq_sched)(ibc_hca_hdl_t hca, ibt_cq_sched_flags_t flags, ibc_cq_handler_attr_t *handler_attrs_p); ibt_status_t (*ibc_free_cq_sched)(ibc_hca_hdl_t hca, @@ -367,6 +376,11 @@ typedef struct ibc_operations_s { ib_memlen_t *paddr_offset_p, ibc_ma_hdl_t *ma_hdl_p); ibt_status_t (*ibc_unmap_mem_area)(ibc_hca_hdl_t hca_hdl, ibc_ma_hdl_t ma_hdl); + ibt_status_t (*ibc_map_mem_iov)(ibc_hca_hdl_t hca_hdl, + ibt_iov_attr_t *iov_attr, ibt_all_wr_t *wr, + ibc_mi_hdl_t *mi_hdl); + ibt_status_t (*ibc_unmap_mem_iov)(ibc_hca_hdl_t hca_hdl, + ibc_mi_hdl_t mi_hdl); /* Allocate L_Key */ ibt_status_t (*ibc_alloc_lkey)(ibc_hca_hdl_t hca_hdl, ibc_pd_hdl_t pd, @@ -394,6 +408,25 @@ typedef struct ibc_operations_s { void *ibtl_reserved, ibc_mr_hdl_t *mr_hdl_p, ibt_pmr_desc_t *mem_desc_p); ibt_status_t (*ibc_deregister_fmr)(ibc_hca_hdl_t hca, ibc_mr_hdl_t mr); + + /* IO memory management */ + ibt_status_t (*ibc_alloc_io_mem)(ibc_hca_hdl_t hca_hdl, size_t size, + ibt_mr_flags_t mr_flag, caddr_t *kaddrp, + ibc_mem_alloc_hdl_t *mem_alloc_hdl); + ibt_status_t (*ibc_free_io_mem)(ibc_hca_hdl_t hca_hdl, + ibc_mem_alloc_hdl_t mem_alloc_hdl); + + /* Extended RC (XRC) */ + ibt_status_t (*ibc_alloc_xrc_domain)(); + ibt_status_t (*ibc_free_xrc_domain)(); + ibt_status_t (*ibc_alloc_xrc_srq)(); + ibt_status_t (*ibc_free_xrc_srq)(); + ibt_status_t (*ibc_query_xrc_srq)(); + ibt_status_t (*ibc_modify_xrc_srq)(); + ibt_status_t (*ibc_alloc_xrc_tgt_qp)(); + ibt_status_t (*ibc_free_xrc_tgt_qp)(); + ibt_status_t (*ibc_query_xrc_tgt_qp)(); + ibt_status_t (*ibc_modify_xrc_tgt_qp)(); } ibc_operations_t; diff --git a/usr/src/uts/common/sys/ib/ibtl/ibti.h b/usr/src/uts/common/sys/ib/ibtl/ibti.h index 2272b7e685..49d50e7940 100644 --- a/usr/src/uts/common/sys/ib/ibtl/ibti.h +++ b/usr/src/uts/common/sys/ib/ibtl/ibti.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,15 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_IB_IBTL_IBTI_H #define _SYS_IB_IBTL_IBTI_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ibti.h * @@ -49,7 +46,8 @@ typedef enum ibt_chan_alloc_flags_e { IBT_ACHAN_CLONE = (1 << 0), IBT_ACHAN_USER_MAP = (1 << 1), IBT_ACHAN_DEFER_ALLOC = (1 << 2), - IBT_ACHAN_USES_SRQ = (1 << 3) + IBT_ACHAN_USES_SRQ = (1 << 3), + IBT_ACHAN_USES_RSS = (1 << 4) } ibt_chan_alloc_flags_t; @@ -137,7 +135,6 @@ typedef struct ibt_ud_dest_query_attr_s { ibt_pd_hdl_t ud_pd; } ibt_ud_dest_query_attr_t; - /* * Allocate UD channel ibt_alloc_ud_channel() arguments; see below at * ibt_alloc_ud_channel() for a description of what's required and optional. @@ -153,6 +150,7 @@ typedef struct ibt_ud_chan_alloc_args_s { ibt_pd_hdl_t ud_pd; /* PD */ ibt_channel_hdl_t ud_clone_chan; /* Optional clone handle */ ibt_srq_hdl_t ud_srq; /* Optional Shared Rcv Queue */ + ibt_rss_attr_t ud_rss; } ibt_ud_chan_alloc_args_t; /* @@ -171,6 +169,7 @@ typedef struct ibt_ud_chan_query_attr_s { ibt_chan_sizes_t ud_chan_sizes; /* Queue/SGL sizes */ ibt_attr_flags_t ud_flags; /* Signaling Type etc */ ibt_srq_hdl_t ud_srq; /* Optional Shared Rcv Queue */ + ibt_rss_attr_t ud_rss; } ibt_ud_chan_query_attr_t; /* @@ -187,6 +186,7 @@ typedef struct ibt_ud_chan_modify_attr_s { uint_t ud_sq_sz; /* Set SQ Max outstanding WRs */ uint_t ud_rq_sz; /* Set RQ Max outstanding WRs */ ib_qkey_t ud_qkey; /* Set Q_Key */ + ibt_rss_attr_t ud_rss; /* Set RSS stuff */ } ibt_ud_chan_modify_attr_t; @@ -257,6 +257,16 @@ ibt_status_t ibt_alloc_ud_channel(ibt_hca_hdl_t hca_hdl, ibt_channel_hdl_t *ud_chan_p, ibt_chan_sizes_t *sizes); /* + * ibt_alloc_ud_channel_range + * Allocate a range of UD channels that have consecutive QPNs for RSS. + */ +ibt_status_t ibt_alloc_ud_channel_range(ibt_hca_hdl_t hca_hdl, + uint_t log2, ibt_chan_alloc_flags_t flags, + ibt_ud_chan_alloc_args_t *args, ibt_cq_hdl_t *send_cq_p, + ibt_cq_hdl_t *recv_cq_p, ib_qpn_t *base_qpn_p, + ibt_channel_hdl_t *ud_chan_p, ibt_chan_sizes_t *sizes); + +/* * ibt_query_ud_channel * Query a UD channel's attributes. */ diff --git a/usr/src/uts/common/sys/ib/ibtl/ibti_common.h b/usr/src/uts/common/sys/ib/ibtl/ibti_common.h index f5ab67df37..0d21e3943b 100644 --- a/usr/src/uts/common/sys/ib/ibtl/ibti_common.h +++ b/usr/src/uts/common/sys/ib/ibtl/ibti_common.h @@ -19,15 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_IB_IBTL_IBTI_COMMON_H #define _SYS_IB_IBTL_IBTI_COMMON_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ibti_common.h * @@ -59,7 +57,9 @@ extern "C" { /* Transport Interface version */ typedef enum ibt_version_e { IBTI_V1 = 1, - IBTI_V2 = 2 /* FMR Support */ + IBTI_V2 = 2, /* FMR Support */ + IBTI_V3 = 3, + IBTI_V_CURR = IBTI_V3 } ibt_version_t; /* @@ -106,8 +106,9 @@ typedef struct ibt_async_event_s { ibt_channel_hdl_t ev_chan_hdl; /* Channel handle */ ibt_cq_hdl_t ev_cq_hdl; /* CQ handle */ ib_guid_t ev_hca_guid; /* HCA node GUID */ - uint8_t ev_port; /* HCA port */ ibt_srq_hdl_t ev_srq_hdl; /* SRQ handle */ + ibt_port_change_t ev_port_flags; /* Port Change flags */ + uint8_t ev_port; /* HCA port */ } ibt_async_event_t; /* @@ -236,6 +237,9 @@ typedef struct ibt_cq_sched_attr_s { */ typedef void (*ibt_cq_handler_t)(ibt_cq_hdl_t ibt_cq, void *arg); +/* default CQ handler ID */ +#define IBT_CQ_HID_DEFAULT (1) + /* * Service Data and flags. * (IBTA Spec Release 1.1, Vol-1 Ref: 15.2.5.14.4) @@ -1144,7 +1148,8 @@ ibt_status_t ibt_poll_cq(ibt_cq_hdl_t ibt_cq, ibt_wc_t *work_completions, * ibt_query_cq() * Return the total number of entries in the CQ. */ -ibt_status_t ibt_query_cq(ibt_cq_hdl_t ibt_cq, uint_t *entries); +ibt_status_t ibt_query_cq(ibt_cq_hdl_t ibt_cq, uint_t *entries, + uint_t *count_p, uint_t *usec_p, ibt_cq_handler_id_t *hid_p); /* * ibt_resize_cq() @@ -1153,6 +1158,15 @@ ibt_status_t ibt_query_cq(ibt_cq_hdl_t ibt_cq, uint_t *entries); ibt_status_t ibt_resize_cq(ibt_cq_hdl_t ibt_cq, uint_t new_sz, uint_t *real_sz); /* + * ibt_modify_cq() + * Change the interrupt moderation values of a CQ. + * "count" is number of completions before interrupting. + * "usec" is the number of microseconds before interrupting. + */ +ibt_status_t ibt_modify_cq(ibt_cq_hdl_t ibt_cq, uint_t count, uint_t usec, + ibt_cq_handler_id_t hid); + +/* * ibt_set_cq_private() * ibt_get_cq_private() * Set/get the client private data. @@ -1289,6 +1303,13 @@ ibt_status_t ibt_map_mem_area(ibt_hca_hdl_t hca_hdl, ibt_va_attr_t *va_attrs, */ ibt_status_t ibt_unmap_mem_area(ibt_hca_hdl_t hca_hdl, ibt_ma_hdl_t ma_hdl); +/* ibt_map_mem_iov() */ +ibt_status_t ibt_map_mem_iov(ibt_hca_hdl_t hca_hdl, + ibt_iov_attr_t *iov_attr, ibt_all_wr_t *wr, ibt_mi_hdl_t *mi_hdl); + +/* ibt_unmap_mem_iov() */ +ibt_status_t ibt_unmap_mem_iov(ibt_hca_hdl_t hca_hdl, ibt_mi_hdl_t mi_hdl); + /* * Work Request Functions * Applicable for RC and UD channels. @@ -1862,6 +1883,16 @@ ibt_status_t ibt_get_port_state(ibt_hca_hdl_t hca_hdl, uint8_t port, ibt_status_t ibt_get_port_state_byguid(ib_guid_t hca_guid, uint8_t port, ib_gid_t *sgid_p, ib_lid_t *base_lid_p); +/* + * ibt_alloc_io_mem() + * ibt_free_io_mem() + * Allocate and deallocate dma-able memory. + */ +ibt_status_t ibt_alloc_io_mem(ibt_hca_hdl_t, size_t, ibt_mr_flags_t, + caddr_t *, ibt_mem_alloc_hdl_t *); + +ibt_status_t ibt_free_io_mem(ibt_hca_hdl_t, ibt_mem_alloc_hdl_t); + #ifdef __cplusplus } #endif diff --git a/usr/src/uts/common/sys/ib/ibtl/ibtl_ci_types.h b/usr/src/uts/common/sys/ib/ibtl/ibtl_ci_types.h index 56dfaf66c5..da78146ca4 100644 --- a/usr/src/uts/common/sys/ib/ibtl/ibtl_ci_types.h +++ b/usr/src/uts/common/sys/ib/ibtl/ibtl_ci_types.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,15 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_IB_IBTL_IBTL_CI_TYPES_H #define _SYS_IB_IBTL_IBTL_CI_TYPES_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ibtl_ci_types.h * Definitions shared between the IBTL and CI interface. @@ -166,6 +163,7 @@ typedef struct ibc_rdd_s *ibt_rdd_hdl_t; /* ibt_alloc_eec() */ #define IBT_MC_MLID_INVALID IBT_MC_OPAQUE #define IBT_QP_SRQ IBT_CHAN_SRQ #define IBT_QP_TYPE_2A_MW_BOUND IBT_CHAN_TYPE_2A_MW_BOUND +#define IBT_QP_WQE_SZ_INSUFF IBT_CHAN_WQE_SZ_INSUFF /* @@ -229,7 +227,8 @@ typedef enum ibt_qp_alloc_flags_e { IBT_QP_NO_FLAGS = 0, IBT_QP_USER_MAP = (1 << 0), IBT_QP_DEFER_ALLOC = (1 << 1), - IBT_QP_USES_SRQ = (1 << 2) + IBT_QP_USES_SRQ = (1 << 2), + IBT_QP_USES_RSS = (1 << 3) } ibt_qp_alloc_flags_t; /* @@ -299,13 +298,13 @@ typedef struct ibt_qp_rd_attr_s { ibt_rnr_nak_time_t rd_min_rnr_nak; /* min RNR-NAK timer */ } ibt_qp_rd_attr_t; - /* UD transport specific */ typedef struct ibt_qp_ud_attr_s { ib_qkey_t ud_qkey; /* Q_Key */ uint32_t ud_sq_psn:24; /* SQ PSN */ uint16_t ud_pkey_ix; /* P_Key Index */ uint8_t ud_port; /* port */ + ibt_rss_attr_t ud_rss; /* RSS stuff */ } ibt_qp_ud_attr_t; /* diff --git a/usr/src/uts/common/sys/ib/ibtl/ibtl_status.h b/usr/src/uts/common/sys/ib/ibtl/ibtl_status.h index fe7ba92c11..1305d302dc 100644 --- a/usr/src/uts/common/sys/ib/ibtl/ibtl_status.h +++ b/usr/src/uts/common/sys/ib/ibtl/ibtl_status.h @@ -19,15 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_IB_IBTL_IBTL_STATUS_H #define _SYS_IB_IBTL_IBTL_STATUS_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ibtl_status.h * @@ -210,6 +208,7 @@ typedef enum ibt_status_e { /* SRQ */ IBT_CHAN_TYPE_2A_MW_BOUND = 416, /* Channel still has a type */ /* 2A memory window bound */ + IBT_CHAN_WQE_SZ_INSUFF = 417, /* inline-data/LSO too large */ /* * Completion Queue (CQ) errors @@ -254,6 +253,8 @@ typedef enum ibt_status_e { /* Handle */ IBT_MW_TYPE_INVALID = 810, IBT_MA_HDL_INVALID = 811, /* Invalid Memory Area Hdl */ + IBT_SGL_TOO_SMALL = 812, + IBT_MI_HDL_INVALID = 813, /* * Multicast errors @@ -273,6 +274,7 @@ typedef enum ibt_status_e { */ IBT_PD_HDL_INVALID = 1100, /* Invalid protection domain */ IBT_PD_IN_USE = 1101, /* Protection Domain in Use */ + IBT_MEM_ALLOC_HDL_INVALID = 1102, /* Invalid MEM handle */ /* * Shared Receive Queue errors @@ -292,7 +294,6 @@ typedef enum ibt_status_e { IBT_FMR_POOL_HDL_INVALID = 1300, /* Invalid FMR Pool handle */ IBT_FMR_POOL_IN_USE = 1301, /* FMR Pool in use. */ IBT_PBL_TOO_SMALL = 1302 - } ibt_status_t; /* diff --git a/usr/src/uts/common/sys/ib/ibtl/ibtl_types.h b/usr/src/uts/common/sys/ib/ibtl/ibtl_types.h index c584557c44..d9d73103ea 100644 --- a/usr/src/uts/common/sys/ib/ibtl/ibtl_types.h +++ b/usr/src/uts/common/sys/ib/ibtl/ibtl_types.h @@ -19,15 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_IB_IBTL_IBTL_TYPES_H #define _SYS_IB_IBTL_IBTL_TYPES_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ibtl_types.h * @@ -40,6 +38,7 @@ #include <sys/ib/ib_types.h> #include <sys/ib/ibtl/ibtl_status.h> #include <sys/socket.h> +#include <sys/byteorder.h> #ifdef __cplusplus @@ -56,10 +55,10 @@ extern "C" { #if defined(_LITTLE_ENDIAN) #define h2b16(x) (htons(x)) #define h2b32(x) (htonl(x)) -#define h2b64(x) (ddi_swap64(x)) +#define h2b64(x) (htonll(x)) #define b2h16(x) (ntohs(x)) #define b2h32(x) (ntohl(x)) -#define b2h64(x) (ddi_swap64(x)) +#define b2h64(x) (htonll(x)) #define h2l16(x) (x) #define h2l32(x) (x) @@ -109,6 +108,8 @@ typedef struct ibc_ah_s *ibt_ah_hdl_t; /* ibt_alloc_ah() */ typedef struct ibtl_eec_s *ibt_eec_hdl_t; typedef struct ibt_rd_dest_s *ibt_rd_dest_hdl_t; /* Reserved for */ /* Future use */ +typedef struct ibc_mem_alloc_s *ibt_mem_alloc_hdl_t; /* ibt_alloc_io_mem() */ +typedef struct ibc_mi_s *ibt_mi_hdl_t; /* ibt_map_mem_iov() */ /* * Some General Types. @@ -189,6 +190,7 @@ typedef struct ibt_chan_sizes_s { uint_t cs_rq; /* ReceiveQ size. */ uint_t cs_sq_sgl; /* Max SGL elements in a SQ WR. */ uint_t cs_rq_sgl; /* Max SGL elements in a RQ Wr. */ + uint_t cs_inline; /* max inline payload size */ } ibt_chan_sizes_t; /* @@ -350,9 +352,11 @@ typedef enum ibt_hca_flags_e { IBT_HCA_RNR_NAK = 1 << 15, /* RNR-NAK supported for RC */ IBT_HCA_CURRENT_QP_STATE = 1 << 16, /* Does modify_qp support */ /* checking of current state? */ - IBT_HCA_SRQ = 1 << 17, /* Shared Receive Queue */ + IBT_HCA_SRQ = 1 << 17, /* Shared Receive Queue (RC) */ + IBT_HCA_RC_SRQ = IBT_HCA_SRQ, IBT_HCA_RESIZE_SRQ = 1 << 18, /* Is resize SRQ supported? */ - IBT_HCA_BASE_MEM_MGT = 1 << 19, /* Base memory mgt supported? */ + IBT_HCA_UD_SRQ = 1 << 19, /* UD with SRQ */ + IBT_HCA_MULT_PAGE_SZ_MR = 1 << 20, /* Support of multiple page */ /* sizes per memory region? */ IBT_HCA_BLOCK_LIST = 1 << 21, /* Block list physical buffer */ @@ -364,9 +368,26 @@ typedef enum ibt_hca_flags_e { IBT_HCA_CKSUM_FULL = 1 << 25, /* Checksum offload supported */ IBT_HCA_MEM_WIN_TYPE_2B = 1 << 26, /* Type 2B memory windows */ IBT_HCA_PHYS_BUF_BLOCK = 1 << 27, /* Block mode phys buf lists */ - IBT_HCA_FMR = 1 << 28 /* FMR Support */ + IBT_HCA_FMR = 1 << 28, /* FMR Support */ + IBT_HCA_WQE_SIZE_INFO = 1 << 29, /* detailed WQE size info */ + IBT_HCA_SQD_STATE = 1 << 30 /* SQD QP state */ } ibt_hca_flags_t; +typedef enum ibt_hca_flags2_e { + IBT_HCA2_NO_FLAGS = 0, + + IBT_HCA2_UC = 1 << 1, /* Unreliable Connected */ + IBT_HCA2_UC_SRQ = 1 << 2, /* UC with SRQ */ + IBT_HCA2_RES_LKEY = 1 << 3, /* Reserved L_Key */ + IBT_HCA2_PORT_CHANGE = 1 << 4, /* Port Change event */ + IBT_HCA2_IP_CLASS = 1 << 5, /* IP Classification flags */ + IBT_HCA2_RSS_TPL_ALG = 1 << 6, /* RSS: Toeplitz algorithm */ + IBT_HCA2_RSS_XOR_ALG = 1 << 7, /* RSS: XOR algorithm */ + IBT_HCA2_XRC = 1 << 8, /* Extended RC (XRC) */ + IBT_HCA2_XRC_SRQ_RESIZE = 1 << 9, /* resize XRC SRQ */ + IBT_HCA2_MEM_MGT_EXT = 1 << 10 /* FMR-WR, send-inv, local-inv */ +} ibt_hca_flags2_t; + /* * The definition of HCA page size capabilities as a bitfield */ @@ -411,6 +432,7 @@ typedef enum ibt_mem_win_type_e { */ typedef struct ibt_hca_attr_s { ibt_hca_flags_t hca_flags; /* HCA capabilities etc */ + ibt_hca_flags2_t hca_flags2; /* device/version inconsistency w/ NodeInfo and IOControllerProfile */ uint32_t hca_vendor_id:24; /* 24 bit Vendor ID */ @@ -474,6 +496,7 @@ typedef struct ibt_hca_attr_s { uint_t hca_opaque4; uint8_t hca_opaque5; uint8_t hca_opaque6; + uint8_t hca_rss_max_log2_table; /* max RSS log2 table size */ uint_t hca_opaque7; uint_t hca_opaque8; uint_t hca_max_srqs; /* Max SRQs supported */ @@ -484,9 +507,34 @@ typedef struct ibt_hca_attr_s { size_t hca_block_sz_lo; /* Range of block sizes */ size_t hca_block_sz_hi; /* supported by the HCA */ uint_t hca_max_cq_handlers; - ibt_lkey_t hca_reserved_lkey; + ibt_lkey_t hca_reserved_lkey; /* Reserved L_Key value */ uint_t hca_max_fmrs; /* Max FMR Supported */ uint_t hca_opaque9; + + uint_t hca_max_lso_size; + uint_t hca_max_lso_hdr_size; + uint_t hca_max_inline_size; + + uint_t hca_max_cq_mod_count; /* CQ notify moderation */ + uint_t hca_max_cq_mod_usec; + + uint32_t hca_fw_major_version; /* firmware version */ + uint16_t hca_fw_minor_version; + uint16_t hca_fw_micro_version; + + uint_t hca_max_xrc_domains; /* XRC items */ + uint_t hca_max_xrc_srqs; + uint_t hca_max_xrc_srq_size; + uint_t hca_max_xrc_srq_sgl; + + /* detailed WQE size info */ + uint_t hca_ud_send_inline_sz; /* inline size in bytes */ + uint_t hca_conn_send_inline_sz; + uint_t hca_conn_rdmaw_inline_overhead; + uint_t hca_recv_sgl_sz; /* detailed SGL sizes */ + uint_t hca_ud_send_sgl_sz; + uint_t hca_conn_send_sgl_sz; + uint_t hca_conn_rdma_sgl_overhead; } ibt_hca_attr_t; /* @@ -610,6 +658,26 @@ typedef struct ibt_cep_path_s { } ibt_cep_path_t; /* + * Define Receive Side Scaling types for IP over IB. + */ +typedef enum ibt_rss_flags_e { + IBT_RSS_ALG_TPL = (1 << 0), /* RSS: Toeplitz hash */ + IBT_RSS_ALG_XOR = (1 << 1), /* RSS: XOR hash */ + IBT_RSS_HASH_IPV4 = (1 << 2), /* RSS: hash IPv4 headers */ + IBT_RSS_HASH_IPV6 = (1 << 3), /* RSS: hash IPv6 headers */ + IBT_RSS_HASH_TCP_IPV4 = (1 << 4), /* RSS: hash TCP/IPv4 hdrs */ + IBT_RSS_HASH_TCP_IPV6 = (1 << 5) /* RSS: hash TCP/IPv6 hdrs */ +} ibt_rss_flags_t; + +typedef struct ibt_rss_attr_s { + ibt_rss_flags_t rss_flags; /* RSS: flags */ + uint_t rss_log2_table; /* RSS: log2 table size */ + ib_qpn_t rss_base_qpn; /* RSS: base QPN */ + ib_qpn_t rss_def_qpn; /* RSS: default QPN */ + uint8_t rss_toe_key[40]; /* RSS: Toeplitz hash key */ +} ibt_rss_attr_t; + +/* * Channel Migration State. */ typedef enum ibt_cep_cmstate_e { @@ -655,7 +723,8 @@ typedef enum ibt_cep_state_e { typedef enum ibt_attr_flags_e { IBT_ALL_SIGNALED = 0, /* All sends signaled */ IBT_WR_SIGNALED = 1, /* Signaled on a WR basis */ - IBT_FAST_REG_RES_LKEY = (1 << 1) + IBT_FAST_REG_RES_LKEY = (1 << 1), + IBT_USES_LSO = (1 << 2) } ibt_attr_flags_t; /* @@ -703,7 +772,8 @@ typedef enum ibt_cep_modify_flags_e { IBT_CEP_SET_SQD_EVENT = (1 << 20), IBT_CEP_SET_OPAQUE6 = (1 << 21), IBT_CEP_SET_OPAQUE7 = (1 << 22), - IBT_CEP_SET_OPAQUE8 = (1 << 23) + IBT_CEP_SET_OPAQUE8 = (1 << 23), + IBT_CEP_SET_RSS = (1 << 24) } ibt_cep_modify_flags_t; /* @@ -777,8 +847,9 @@ typedef enum ibt_mr_flags_e { IBT_MR_ZBVA = (1 << 12), /* Additional physical registration flags */ - IBT_MR_CONSUMER_KEY = (1 << 13) /* Consumer owns key */ + IBT_MR_CONSUMER_KEY = (1 << 13), /* Consumer owns key */ /* portion of keys */ + IBT_MR_DISABLE_RO = (1 << 14) } ibt_mr_flags_t; @@ -793,7 +864,8 @@ typedef enum ibt_mr_attr_flags_e { IBT_MR_ZERO_BASED_VA = (1 << 5), IBT_MR_CONSUMER_OWNED_KEY = (1 << 6), IBT_MR_SHARED = (1 << 7), - IBT_MR_FMR = (1 << 8) + IBT_MR_FMR = (1 << 8), + IBT_MR_RO_DISABLED = (1 << 9) } ibt_mr_attr_flags_t; /* Memory region physical descriptor. */ @@ -805,6 +877,14 @@ typedef struct ibt_phys_buf_s { size_t p_size; } ibt_phys_buf_t; +/* version of above for uniform buffer size */ +typedef struct ib_phys_addr_t { + union { + uint64_t _p_ll; /* 64 bit DMA address */ + uint32_t _p_la[2]; /* 2 x 32 bit address */ + } _phys_buf; +} ibt_phys_addr_t; + #define p_laddr _phys_buf._p_ll #ifdef _LONG_LONG_HTOL #define p_notused _phys_buf._p_la[0] @@ -858,18 +938,41 @@ typedef struct ibt_pmr_attr_s { ib_memlen_t pmr_offset; /* Offset of the regions starting */ /* IOVA within the 1st physical */ /* buffer */ - ibt_mr_flags_t pmr_flags; + ibt_ma_hdl_t pmr_ma; /* Memory handle used to obtain the */ + /* pmr_buf_list */ + ibt_phys_addr_t *pmr_addr_list; /* List of physical buffers accessed */ + /* as an array */ + size_t pmr_buf_sz; + uint_t pmr_num_buf; /* Num of entries in the pmr_buf_list */ ibt_lkey_t pmr_lkey; /* Reregister only */ ibt_rkey_t pmr_rkey; /* Reregister only */ + ibt_mr_flags_t pmr_flags; uint8_t pmr_key; /* Key to use on new Lkey & Rkey */ - uint_t pmr_num_buf; /* Num of entries in the pmr_buf_list */ - size_t pmr_buf_sz; - ibt_phys_buf_t *pmr_buf_list; /* List of physical buffers accessed */ - /* as an array */ - ibt_ma_hdl_t pmr_ma; /* Memory handle used to obtain the */ - /* pmr_buf_list */ } ibt_pmr_attr_t; +/* addr/length pair */ +typedef struct ibt_iov_s { + caddr_t iov_addr; /* Beginning address */ + size_t iov_len; /* Length */ +} ibt_iov_t; + +/* Map memory IOV */ +typedef enum ibt_iov_flags_e { + IBT_IOV_SLEEP = 0, + IBT_IOV_NOSLEEP = (1 << 0), + IBT_IOV_BUF = (1 << 1), + IBT_IOV_RECV = (1 << 2) +} ibt_iov_flags_t; + +typedef struct ibt_iov_attr_s { + struct as *iov_as; + ibt_iov_t *iov; + struct buf *iov_buf; + uint32_t iov_list_len; + uint32_t iov_wr_nds; + ib_msglen_t iov_lso_hdr_sz; + ibt_iov_flags_t iov_flags; +} ibt_iov_attr_t; /* * Memory Region (Re)Register attributes - used by ibt_register_shared_mr(), @@ -951,8 +1054,8 @@ typedef struct ibt_va_attr_s { ib_memlen_t va_len; /* Length of region to register */ struct as *va_as; /* A pointer to an address space */ /* structure. */ - size_t va_phys_buf_min; - size_t va_phys_buf_max; + size_t va_phys_buf_min; /* block mode only */ + size_t va_phys_buf_max; /* block mode only */ ibt_va_flags_t va_flags; struct buf *va_buf; } ibt_va_attr_t; @@ -1006,6 +1109,7 @@ typedef uint8_t ibt_wrc_opcode_t; #define IBT_WRC_RECV_RDMAWI 8 /* Received RDMA Write w/ Immediate */ #define IBT_WRC_FAST_REG_PMR 9 /* Fast Register Physical mem region */ #define IBT_WRC_LOCAL_INVALIDATE 10 +#define IBT_WRC_SEND_LSO 11 /* @@ -1020,6 +1124,20 @@ typedef uint8_t ibt_wc_flags_t; #define IBT_WC_RKEY_INVALIDATED (1 << 2) #define IBT_WC_CKSUM_OK (1 << 3) +/* IPoIB flags for wc_detail field */ +#define IBT_WC_DETAIL_ALL_FLAGS_MASK (0x0FC00000) +#define IBT_WC_DETAIL_IPV4 (1 << 22) +#define IBT_WC_DETAIL_IPV4_FRAG (1 << 23) +#define IBT_WC_DETAIL_IPV6 (1 << 24) +#define IBT_WC_DETAIL_IPV4_OPT (1 << 25) +#define IBT_WC_DETAIL_TCP (1 << 26) +#define IBT_WC_DETAIL_UDP (1 << 27) + +#define IBT_WC_DETAIL_RSS_MATCH_MASK (0x003F0000) +#define IBT_WC_DETAIL_RSS_TCP_IPV6 (1 << 18) +#define IBT_WC_DETAIL_RSS_IPV6 (1 << 19) +#define IBT_WC_DETAIL_RSS_TCP_IPV4 (1 << 20) +#define IBT_WC_DETAIL_RSS_IPV4 (1 << 21) /* * Work Request Completion - This structure encapsulates the information @@ -1034,20 +1152,19 @@ typedef struct ibt_wc_s { ibt_wrc_opcode_t wc_type; /* Operation Type */ uint16_t wc_cksum; /* payload checksum */ ibt_immed_t wc_immed_data; /* Immediate Data */ - uint32_t wc_freed_rc; /* Freed Resource Count */ + uint32_t wc_res_hash; /* RD: Freed Res, RSS: hash */ ibt_wc_status_t wc_status; /* Completion Status */ uint8_t wc_sl:4; /* Remote SL */ uint16_t wc_ethertype; /* Ethertype Field - RE */ ib_lid_t wc_opaque1; uint16_t wc_opaque2; ib_qpn_t wc_qpn; /* Source QPN Datagram only */ - ib_eecn_t wc_opaque3; + uint32_t wc_detail; /* RD: EECN, UD: IPoIB flags */ ib_qpn_t wc_local_qpn; ibt_rkey_t wc_rkey; ib_path_bits_t wc_opaque4; } ibt_wc_t; - /* * WR Flags. Common for both RC and UD * @@ -1062,6 +1179,7 @@ typedef uint8_t ibt_wr_flags_t; #define IBT_WR_SEND_SOLICIT (1 << 3) /* Solicited Event Indicator */ #define IBT_WR_SEND_REMOTE_INVAL (1 << 4) /* Remote Invalidate */ #define IBT_WR_SEND_CKSUM (1 << 5) /* Checksum offload Indicator */ +#define IBT_WR_SEND_INLINE (1 << 6) /* INLINE required (no lkey) */ /* * Access control flags for Bind Memory Window operation, @@ -1151,8 +1269,9 @@ typedef struct ibt_wr_reg_pmr_s { /* IOVA within the 1st physical */ /* buffer */ ibt_mr_hdl_t pmr_mr_hdl; - ibt_phys_buf_t *pmr_buf_list; /* List of physical buffers accessed */ + ibt_phys_addr_t *pmr_addr_list; /* List of physical buffers accessed */ /* as an array */ + size_t pmr_buf_sz; /* size of uniform size PBEs */ uint_t pmr_num_buf; /* Num of entries in the pmr_buf_list */ ibt_lkey_t pmr_lkey; ibt_rkey_t pmr_rkey; @@ -1160,6 +1279,12 @@ typedef struct ibt_wr_reg_pmr_s { uint8_t pmr_key; /* Key to use on new Lkey & Rkey */ } ibt_wr_reg_pmr_t; +/* phys reg function or WR */ +typedef union ibt_reg_req_u { + ibt_pmr_attr_t fn_arg; + ibt_wr_reg_pmr_t wr; +} ibt_reg_req_t; + /* * Local Invalidate. */ @@ -1254,6 +1379,14 @@ typedef struct ibt_wr_ud_s { ibt_ud_dest_hdl_t udwr_dest; } ibt_wr_ud_t; +/* LSO variant */ +typedef struct ibt_wr_lso_s { + ibt_ud_dest_hdl_t lso_ud_dest; + uint8_t *lso_hdr; + ib_msglen_t lso_hdr_sz; + ib_msglen_t lso_mss; +} ibt_wr_lso_t; + /* * Send Work Request (WR) attributes structure. * @@ -1276,6 +1409,7 @@ typedef struct ibt_send_wr_s { ibt_wr_uc_t uc; /* Reserved For Future Use */ ibt_wr_reth_t reth; /* Reserved For Future Use */ ibt_wr_ripv6_t ripv6; /* Reserved For Future Use */ + ibt_wr_lso_t ud_lso; } wr; /* operation specific */ } ibt_send_wr_t; @@ -1289,6 +1423,11 @@ typedef struct ibt_recv_wr_s { ibt_wr_ds_t *wr_sgl; /* SGL */ } ibt_recv_wr_t; +typedef union ibt_all_wr_u { + ibt_send_wr_t send; + ibt_recv_wr_t recv; +} ibt_all_wr_t; + /* * Asynchronous Events and Errors. @@ -1326,9 +1465,20 @@ typedef enum ibt_async_code_e { IBT_ASYNC_OPAQUE4 = 0x010000, IBT_EVENT_LIMIT_REACHED_SRQ = 0x020000, IBT_EVENT_EMPTY_CHAN = 0x040000, - IBT_ERROR_CATASTROPHIC_SRQ = 0x080000 + IBT_ERROR_CATASTROPHIC_SRQ = 0x080000, + + IBT_PORT_CHANGE_EVENT = 0x100000 } ibt_async_code_t; +typedef enum ibt_port_change_e { + IBT_PORT_CHANGE_SGID = 0x000001, /* SGID table */ + IBT_PORT_CHANGE_PKEY = 0x000002, /* P_Key table */ + IBT_PORT_CHANGE_SM_LID = 0x000004, /* Master SM LID */ + IBT_PORT_CHANGE_SM_SL = 0x000008, /* Master SM SL */ + IBT_PORT_CHANGE_SUB_TIMEOUT = 0x000010, /* Subnet Timeout */ + IBT_PORT_CHANGE_SM_FLAG = 0x000020, /* IsSMDisabled bit */ + IBT_PORT_CHANGE_REREG = 0x000040 /* IsClientReregSupport */ +} ibt_port_change_t; /* * ibt_ci_data_in() and ibt_ci_data_out() flags. diff --git a/usr/src/uts/common/sys/ib/mgt/ibmf/ibmf_impl.h b/usr/src/uts/common/sys/ib/mgt/ibmf/ibmf_impl.h index ed8fb5242d..a32f009451 100644 --- a/usr/src/uts/common/sys/ib/mgt/ibmf/ibmf_impl.h +++ b/usr/src/uts/common/sys/ib/mgt/ibmf/ibmf_impl.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,14 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_IB_MGT_IBMF_IBMF_IMPL_H #define _SYS_IB_MGT_IBMF_IBMF_IMPL_H -#pragma ident "%Z%%M% %I% %E% SMI" /* * This file contains the IBMF implementation dependent structures and defines. @@ -586,43 +584,6 @@ typedef struct _ibmf_state { _NOTE(MUTEX_PROTECTS_DATA(ibmf_state_t::ibmf_mutex, ibmf_ci_t::ci_next)) -/* - * Endian macros for swapping ib_mad_hdr components. These are used by both - * ibmf and ibmf_saa. MAD header fields only need to be swapped, so in-place - * swapping using these #defines is better. However, the SA header and data - * portions need to be unpacked as well (they can have unaligned 64-bit fields). - * So the ibmf_utils pack, unpack functions are used for swapping and unpacking - * the data portions of ibmf_saa messages. - * The macros below are copied from the ibtl macros. - */ - -/* - * Endian Macros - * h2b - host endian to big endian protocol - * b2h - big endian protocol to host endian - * h2l - host endian to little endian protocol - * l2h - little endian protocol to host endian - */ -#if defined(_LITTLE_ENDIAN) -#define h2b16(x) (htons(x)) -#define h2b32(x) (htonl(x)) -#define h2b64(x) (ddi_swap64(x)) -#define b2h16(x) (ntohs(x)) -#define b2h32(x) (ntohl(x)) -#define b2h64(x) (ddi_swap64(x)) - -#elif defined(_BIG_ENDIAN) -#define h2b16(x) (x) -#define h2b32(x) (x) -#define h2b64(x) (x) -#define b2h16(x) (x) -#define b2h32(x) (x) -#define b2h64(x) (x) - -#else -#error One of _LITTLE_ENDIAN or _BIG_ENDIAN must be defined -#endif - /* UD Destination resource cache definitions */ /* * It is preferred that the difference between the hi and lo water diff --git a/usr/src/uts/sun4/io/px/px_dma.c b/usr/src/uts/sun4/io/px/px_dma.c index 5fed6cc3de..e720a82fdb 100644 --- a/usr/src/uts/sun4/io/px/px_dma.c +++ b/usr/src/uts/sun4/io/px/px_dma.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1258,7 +1258,8 @@ px_dma_physwin(px_t *px_p, ddi_dma_req_t *dmareq, ddi_dma_impl_t *mp) if (px_lib_iommu_getbypass(dip, MMU_PTOB(pfn), attr, &bypass_addr) != DDI_SUCCESS) { - cmn_err(CE_WARN, "bypass cookie failure %lx\n", pfn); + DBG(DBG_BYPASS, mp->dmai_rdip, + "bypass cookie failure %lx\n", pfn); return (DDI_DMA_NOMAPPING); } pfn = MMU_BTOP(bypass_addr); diff --git a/usr/src/xmod/xmod_files b/usr/src/xmod/xmod_files index eaca638b7d..f5c43b9e95 100644 --- a/usr/src/xmod/xmod_files +++ b/usr/src/xmod/xmod_files @@ -67,6 +67,7 @@ cmd/cmd-inet/usr.sbin/bootconfchk ../closed/uts/common/sys/ib/adapters/hermon/hermon_cmd.h ../closed/uts/common/sys/ib/adapters/hermon/hermon_cq.h ../closed/uts/common/sys/ib/adapters/hermon/hermon_event.h +../closed/uts/common/sys/ib/adapters/hermon/hermon_fm.h ../closed/uts/common/sys/ib/adapters/hermon/hermon_hw.h ../closed/uts/common/sys/ib/adapters/hermon/hermon_misc.h ../closed/uts/common/sys/ib/adapters/hermon/hermon_mr.h |
