16e76cdd6e3cfaac7d91c3b0644ee1bc6cf52347agiri * This file contains definitions used in OFED defined user/kernel
16e76cdd6e3cfaac7d91c3b0644ee1bc6cf52347agiri * interfaces. These are imported from the OFED header <linux/rds.h>. Oracle
16e76cdd6e3cfaac7d91c3b0644ee1bc6cf52347agiri * elects to have and use the contents of <linux/rds.h> under and governed
16e76cdd6e3cfaac7d91c3b0644ee1bc6cf52347agiri * by the OpenIB.org BSD license (see below for full license text). However,
16e76cdd6e3cfaac7d91c3b0644ee1bc6cf52347agiri * the following notice accompanied the original version of this file:
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Copyright (c) 2008 Oracle. All rights reserved.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * This software is available to you under a choice of one of two
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * licenses. You may choose to be licensed under the terms of the GNU
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * General Public License (GPL) Version 2, available from the file
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * COPYING in the main directory of this source tree, or the
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * OpenIB.org BSD license below:
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Redistribution and use in source and binary forms, with or
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * without modification, are permitted provided that the following
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * conditions are met:
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * - Redistributions of source code must retain the above
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * copyright notice, this list of conditions and the following
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * disclaimer.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * - Redistributions in binary form must reproduce the above
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * copyright notice, this list of conditions and the following
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * disclaimer in the documentation and/or other materials
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * provided with the distribution.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * SOFTWARE.
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Otaextern "C" {
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota * These sparse annotated types shouldn't be in any user
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota * visible header file. We should clean this up rather
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota * than kludging around them.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota/* deprecated: RDS_BARRIER 4 */
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Control message types for SOL_RDS.
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota * CMSG_RDMA_ARGS (sendmsg)
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Request a RDMA transfer to/from the specified
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * memory ranges.
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota * The cmsg_data is a struct rds_rdma_args.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * RDS_CMSG_RDMA_DEST (recvmsg, sendmsg)
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Kernel informs application about intended
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * source/destination of a RDMA transfer
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * RDS_CMSG_RDMA_MAP (sendmsg)
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Application asks kernel to map the given
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * memory range into a IB MR, and send the
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * R_Key along in an RDS extension header.
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota * The cmsg_data is a struct rds_get_mr_args,
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * the same as for the GET_MR setsockopt.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * RDS_CMSG_RDMA_STATUS (recvmsg)
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Returns the status of a completed RDMA operation.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota/* 10002 aka RDS_INFO_FLOWS is deprecated */
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota u_int8_t transport[TRANSNAMSIZ]; /* null term ascii */
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota u_int8_t transport[TRANSNAMSIZ]; /* null term ascii */
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * Congestion monitoring.
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * Congestion control in RDS happens at the host connection
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * level by exchanging a bitmap marking congested ports.
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * By default, a process sleeping in poll() is always woken
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * up when the congestion map is updated.
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * With explicit monitoring, an application can have more
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * fine-grained control.
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * The application installs a 64bit mask value in the socket,
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * where each bit corresponds to a group of ports.
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * When a congestion update arrives, RDS checks the set of
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * ports that are now uncongested against the list bit mask
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * installed in the socket, and if they overlap, we queue a
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * cong_notification on the socket.
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * To install the congestion monitor bitmask, use RDS_CONG_MONITOR
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * with the 64bit mask.
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * Congestion updates are received via RDS_CMSG_CONG_UPDATE
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * control messages.
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * The correspondence between bits and ports is
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * 1 << (portnum % 64)
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota#define RDS_CONG_MONITOR_MASK(port) (1ULL << RDS_CONG_MONITOR_BIT(port))
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * RDMA related types
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * This encapsulates a remote memory location.
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * In the current implementation, it contains the R_Key
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * of the remote memory region, and the offset into it
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * (so that the application does not have to worry about
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * alignment).
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * Common set of flags for all RDMA related structs
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota#define RDS_RDMA_FENCE 0x0002 /* use FENCE for immediate send */
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota#define RDS_RDMA_INVALIDATE 0x0004 /* invalidate R_Key after freeing MR */
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota#define RDS_RDMA_USE_ONCE 0x0008 /* free MR after use */
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota#define RDS_RDMA_DONTWAIT 0x0010 /* Don't wait in SET_BARRIER */
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota#define RDS_RDMA_NOTIFY_ME 0x0020 /* Notify when operation completes */
fe817b6022080da0a98b5d2d8cd179f594d6ca5eEiji Ota#endif /* _SYS_RDS_H */