-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ibacm: major rework to align with linux AF_IB changes
Simplified service's socket interface, and updated code to share data structure definitions from libibverbs. Signed-off-by: Sean Hefty <sean.hefty@intel.com>
- Loading branch information
Showing
13 changed files
with
3,651 additions
and
3,768 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,19 @@ | ||
INCLUDES = -I$(srcdir)/include -I$(srcdir)/linux | ||
|
||
lib_LTLIBRARIES = linux/libibacm.la | ||
|
||
AM_CFLAGS = -g -Wall -D_GNU_SOURCE | ||
|
||
linux_libibacm_la_CFLAGS = $(AM_CFLAGS) | ||
|
||
if HAVE_LD_VERSION_SCRIPT | ||
libibacm_version_script = -Wl,--version-script=$(srcdir)/linux/libibacm.map | ||
else | ||
libibacm_version_script = | ||
endif | ||
|
||
linux_libibacm_la_SOURCES = src/libacm.c linux/libacm_linux.c | ||
linux_libibacm_la_LDFLAGS = -version-info 0 -export-dynamic \ | ||
$(libibacm_version_script) | ||
linux_libibacm_la_DEPENDENCIES = $(srcdir)/linux/libibacm.map | ||
|
||
bin_PROGRAMS = svc/ib_acm util/ib_acme | ||
svc_ib_acm_SOURCES = src/acm.c | ||
util_ib_acme_SOURCES = src/acme.c linux/acme_linux.c | ||
util_ib_acme_LDADD = $(top_builddir)/linux/libibacm.la | ||
util_ib_acme_SOURCES = src/acme.c linux/acme_linux.c src/libacm.c linux/libacm_linux.c | ||
svc_ib_acm_CFLAGS = $(AM_CFLAGS) | ||
util_ib_acme_CFLAGS = $(AM_CFLAGS) | ||
|
||
libibacmincludedir = $(includedir)/infiniband | ||
ib_acmincludedir = $(includedir)/infiniband | ||
|
||
libibacminclude_HEADERS = include/infiniband/ib_acm.h include/infiniband/acm.h | ||
ib_acminclude_HEADERS = include/infiniband/acm.h | ||
|
||
man_MANS = \ | ||
man/ib_acm_resolve_name.3 \ | ||
man/ib_acm_resolve_ip.3 \ | ||
man/ib_acm_resolve_path.3 \ | ||
man/ib_acme.1 \ | ||
man/ib_acm.1 \ | ||
man/ib_acm.7 | ||
|
||
EXTRA_DIST = linux/libibacm.map libibacm.spec.in $(man_MANS) | ||
|
||
dist-hook: libibacm.spec | ||
cp libibacm.spec $(distdir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,109 @@ | ||
/* | ||
* Copyright (c) 2009 Intel Corporation. All rights reserved. | ||
* | ||
* This software is available to you under the OpenFabrics.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 | ||
* disclaimer in the documentation and/or other materials | ||
* 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 AWV | ||
* 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. | ||
*/ | ||
|
||
#if !defined(ACM_H) | ||
#define ACM_H | ||
|
||
#include <infiniband/ib_acm.h> | ||
|
||
#define ACM_VERSION 1 | ||
|
||
#define ACM_OP_MASK 0x0F | ||
#define ACM_OP_RESOLVE 0x01 | ||
#define ACM_OP_ACK 0x80 | ||
|
||
#define ACM_STATUS_SUCCESS 0 | ||
#define ACM_STATUS_ENOMEM 1 | ||
#define ACM_STATUS_EINVAL 2 | ||
#define ACM_STATUS_ENODATA 3 | ||
#define ACM_STATUS_ENOTCONN 5 | ||
#define ACM_STATUS_ETIMEDOUT 6 | ||
#define ACM_STATUS_ESRCADDR 7 | ||
#define ACM_STATUS_ESRCTYPE 8 | ||
#define ACM_STATUS_EDESTADDR 9 | ||
#define ACM_STATUS_EDESTTYPE 10 | ||
|
||
#define ACM_FLAGS_QUERY_SA (1<<31) | ||
|
||
#define ACM_MSG_HDR_LENGTH 16 | ||
#define ACM_MAX_ADDRESS 64 | ||
#define ACM_MSG_EP_LENGTH 72 | ||
/* | ||
* Support up to 6 path records (primary and alternate CM paths, | ||
* inbound and outbound primary and alternate data paths), plus CM data. | ||
*/ | ||
#define ACM_MSG_DATA_LENGTH (ACM_MSG_EP_LENGTH * 8) | ||
|
||
struct acm_hdr | ||
{ | ||
uint8_t version; | ||
uint8_t opcode; | ||
uint8_t status; | ||
uint8_t reserved[3]; | ||
uint16_t length; | ||
uint64_t tid; | ||
}; | ||
|
||
#define ACM_EP_INFO_NAME 0x0001 | ||
#define ACM_EP_INFO_ADDRESS_IP 0x0002 | ||
#define ACM_EP_INFO_ADDRESS_IP6 0x0003 | ||
#define ACM_EP_INFO_PATH 0x0010 | ||
#define ACM_EP_INFO_CM 0x0100 | ||
|
||
struct acm_cm_data | ||
{ | ||
uint8_t init_depth; | ||
uint8_t resp_resources; | ||
uint8_t reserved2[62]; | ||
}; | ||
|
||
union acm_ep_info | ||
{ | ||
uint8_t addr[ACM_MAX_ADDRESS]; | ||
uint8_t name[ACM_MAX_ADDRESS]; | ||
struct acm_cm_data cm; | ||
struct ib_path_record path; | ||
}; | ||
|
||
struct acm_ep_addr_data | ||
{ | ||
uint32_t flags; | ||
uint16_t type; | ||
uint16_t reserved; | ||
union acm_ep_info info; | ||
}; | ||
|
||
struct acm_resolve_msg | ||
{ | ||
struct acm_hdr hdr; | ||
struct acm_ep_addr_data data[0]; | ||
}; | ||
|
||
struct acm_msg | ||
{ | ||
struct acm_hdr hdr; | ||
uint8_t data[ACM_MSG_DATA_LENGTH]; | ||
}; | ||
|
||
#endif /* ACM_H */ | ||
/* | ||
* Copyright (c) 2009 Intel Corporation. All rights reserved. | ||
* | ||
* This software is available to you under the OpenFabrics.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 | ||
* disclaimer in the documentation and/or other materials | ||
* 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 AWV | ||
* 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. | ||
*/ | ||
|
||
#if !defined(ACM_H) | ||
#define ACM_H | ||
|
||
#include <infiniband/verbs.h> | ||
#include <infiniband/sa.h> | ||
|
||
#define ACM_VERSION 1 | ||
|
||
#define ACM_OP_MASK 0x0F | ||
#define ACM_OP_RESOLVE 0x01 | ||
#define ACM_OP_ACK 0x80 | ||
|
||
#define ACM_STATUS_SUCCESS 0 | ||
#define ACM_STATUS_ENOMEM 1 | ||
#define ACM_STATUS_EINVAL 2 | ||
#define ACM_STATUS_ENODATA 3 | ||
#define ACM_STATUS_ENOTCONN 5 | ||
#define ACM_STATUS_ETIMEDOUT 6 | ||
#define ACM_STATUS_ESRCADDR 7 | ||
#define ACM_STATUS_ESRCTYPE 8 | ||
#define ACM_STATUS_EDESTADDR 9 | ||
#define ACM_STATUS_EDESTTYPE 10 | ||
|
||
#define ACM_FLAGS_QUERY_SA (1<<31) | ||
|
||
#define ACM_MSG_HDR_LENGTH 16 | ||
#define ACM_MAX_ADDRESS 64 | ||
#define ACM_MSG_EP_LENGTH 72 | ||
/* | ||
* Support up to 6 path records (primary and alternate CM paths, | ||
* inbound and outbound primary and alternate data paths), plus CM data. | ||
*/ | ||
#define ACM_MSG_DATA_LENGTH (ACM_MSG_EP_LENGTH * 8) | ||
|
||
struct acm_hdr | ||
{ | ||
uint8_t version; | ||
uint8_t opcode; | ||
uint8_t status; | ||
uint8_t reserved[3]; | ||
uint16_t length; | ||
uint64_t tid; | ||
}; | ||
|
||
#define ACM_EP_INFO_NAME 0x0001 | ||
#define ACM_EP_INFO_ADDRESS_IP 0x0002 | ||
#define ACM_EP_INFO_ADDRESS_IP6 0x0003 | ||
#define ACM_EP_INFO_PATH 0x0010 | ||
|
||
union acm_ep_info | ||
{ | ||
uint8_t addr[ACM_MAX_ADDRESS]; | ||
uint8_t name[ACM_MAX_ADDRESS]; | ||
struct ib_path_record path; | ||
}; | ||
|
||
#define ACM_EP_FLAG_SOURCE (1<<0) | ||
#define ACM_EP_FLAG_DEST (1<<1) | ||
|
||
struct acm_ep_addr_data | ||
{ | ||
uint32_t flags; | ||
uint16_t type; | ||
uint16_t reserved; | ||
union acm_ep_info info; | ||
}; | ||
|
||
struct acm_resolve_msg | ||
{ | ||
struct acm_hdr hdr; | ||
struct acm_ep_addr_data data[0]; | ||
}; | ||
|
||
struct acm_msg | ||
{ | ||
struct acm_hdr hdr; | ||
uint8_t data[ACM_MSG_DATA_LENGTH]; | ||
}; | ||
|
||
#endif /* ACM_H */ |
Oops, something went wrong.