From: Sean Hefty Date: Mon, 24 Mar 2014 06:24:54 +0000 (-0700) Subject: ibacm: Define provider endpoint identifier X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=930cbe787a6363999e0bf7706108f352a951e82a;p=~shefty%2Fibacm.git ibacm: Define provider endpoint identifier Introduce a header file that will be included by providers that will define the interface between the ibacm core layer and the providers. Define an endpoint identifier that is associated with a set of addresses. Providers will be given this structure in requests. The endpoint is defined as a tuple, though it may be used with "any" values in order to identify any port on a device and/or any pkey on a port. Signed-off-by: Sean Hefty --- diff --git a/Makefile.am b/Makefile.am index 9070a5a..e3c618c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,7 +11,7 @@ util_ib_acme_CFLAGS = $(AM_CFLAGS) -DACME_PRINTS ibacmincludedir = $(includedir)/infiniband -ibacminclude_HEADERS = include/infiniband/acm.h +ibacminclude_HEADERS = include/infiniband/acm.h include/infiniband/acm_prov.h man_MANS = \ man/ib_acme.1 \ diff --git a/include/infiniband/acm_prov.h b/include/infiniband/acm_prov.h new file mode 100644 index 0000000..0f774a5 --- /dev/null +++ b/include/infiniband/acm_prov.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2014 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_PROV_H) +#define ACM_PROV_H + +#include + +struct acm_endpoint { + void *prov_context; + uint64_t dev_guid; + uint8_t port_num; + uint16_t pkey; +}; + +#endif /* ACM_PROV_H */ diff --git a/src/acm.c b/src/acm.c index c6b4910..384c772 100644 --- a/src/acm.c +++ b/src/acm.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -167,7 +168,8 @@ struct acmp_ep { struct acm_dest mc_dest[MAX_EP_MC]; int mc_cnt; uint16_t pkey_index; - uint16_t pkey; + uint16_t pkey; + struct acm_endpoint endpoint; lock_t lock; struct acm_send_queue resolve_queue; struct acm_send_queue sa_queue; @@ -3340,7 +3342,7 @@ static int acm_assign_ep_names(struct acmp_ep *ep) } if (!stricmp(dev_name, dev) && (ep->port->port_num == (uint8_t) port) && - (ep->pkey == pkey)) { + (ep->pkey == pkey)) { acm_log(1, "assigning %s\n", addr); if ((ret = acm_ep_insert_addr(ep, (uint8_t *)&ip_addr, addr_len, type)) != 0) { @@ -3462,6 +3464,10 @@ acmp_alloc_ep(struct acmp_port *port, uint16_t pkey, uint16_t pkey_index) sprintf(ep->id_string, "%s-%d-0x%x", port->dev->verbs->device->name, port->port_num, pkey); + ep->endpoint.dev_guid = port->dev->guid; + ep->endpoint.port_num = port->port_num; + ep->endpoint.pkey = pkey; + return ep; }