char string_buf[ACM_MAX_ADDRESS];
};
-struct acm_ep {
+struct acmc_ep {
struct acmc_port *port;
struct acm_endpoint endpoint;
struct acm_addr addr_info[MAX_EP_ADDR];
static struct acmc_device *
acm_get_device_from_gid(union ibv_gid *sgid, uint8_t *port);
-static struct acm_ep *acm_find_ep(struct acmc_port *port, uint16_t pkey);
-static int acm_ep_insert_addr(struct acm_ep *ep, const char *name, uint8_t *addr,
+static struct acmc_ep *acm_find_ep(struct acmc_port *port, uint16_t pkey);
+static int acm_ep_insert_addr(struct acmc_ep *ep, const char *name, uint8_t *addr,
size_t addr_len, uint8_t addr_type);
/*
lock_release(&ep->lock);
}
-static void acm_mark_addr_invalid(struct acm_ep *ep,
+static void acm_mark_addr_invalid(struct acmc_ep *ep,
struct acm_ep_addr_data *data)
{
int i;
static struct acm_address *
acm_addr_lookup(struct acm_endpoint *endpoint, uint8_t *addr, uint8_t addr_type)
{
- struct acm_ep *ep;
+ struct acmc_ep *ep;
int i;
- ep = container_of(endpoint, struct acm_ep, endpoint);
+ ep = container_of(endpoint, struct acmc_ep, endpoint);
for (i = 0; i < MAX_EP_ADDR; i++) {
if (ep->addr_info[i].addr.type != addr_type)
continue;
return 0;
}
-static struct acm_ep *
+static struct acmc_ep *
acm_get_port_ep(struct acmc_port *port, struct acm_ep_addr_data *data)
{
- struct acm_ep *ep;
+ struct acmc_ep *ep;
DLIST_ENTRY *ep_entry;
if (port->state != IBV_PORT_ACTIVE)
for (ep_entry = port->ep_list.Next; ep_entry != &port->ep_list;
ep_entry = ep_entry->Next) {
- ep = container_of(ep_entry, struct acm_ep, entry);
+ ep = container_of(ep_entry, struct acmc_ep, entry);
if ((data->type == ACM_EP_INFO_PATH) &&
(!data->info.path.pkey ||
(ntohs(data->info.path.pkey) == ep->endpoint.pkey)))
return NULL;
}
-static struct acm_ep *acm_get_ep(struct acm_ep_addr_data *data)
+static struct acmc_ep *acm_get_ep(struct acm_ep_addr_data *data)
{
struct acmc_device *dev;
- struct acm_ep *ep;
+ struct acmc_ep *ep;
DLIST_ENTRY *dev_entry;
int i;
static int
acm_svr_query_path(struct acm_client *client, struct acm_msg *msg)
{
- struct acm_ep *ep;
+ struct acmc_ep *ep;
acm_log(2, "client %d\n", client->index);
if (msg->hdr.length != ACM_MSG_HDR_LENGTH + ACM_MSG_EP_LENGTH) {
static int
acm_svr_resolve_dest(struct acm_client *client, struct acm_msg *msg)
{
- struct acm_ep *ep;
+ struct acmc_ep *ep;
struct acm_ep_addr_data *saddr, *daddr;
uint8_t status;
static int
acm_svr_resolve_path(struct acm_client *client, struct acm_msg *msg)
{
- struct acm_ep *ep;
+ struct acmc_ep *ep;
struct ibv_path_record *path;
acm_log(2, "client %d\n", client->index);
static void acm_add_ep_ip(char *ifname, struct acm_ep_addr_data *data, char *ip_str)
{
- struct acm_ep *ep;
+ struct acmc_ep *ep;
struct acmc_device *dev;
uint8_t port_num;
uint16_t pkey;
static void acm_rm_ep_ip(struct acm_ep_addr_data *data)
{
- struct acm_ep *ep;
+ struct acmc_ep *ep;
ep = acm_get_ep(data);
if (ep) {
{
int ret = EINVAL;
struct acmc_device *dev;
- struct acm_ep *ep;
+ struct acmc_ep *ep;
uint8_t port_num;
char gid_str[INET6_ADDRSTRLEN];
DLIST_ENTRY *dev_entry;
struct acmc_device *dev;
struct acmc_port *port;
- struct acm_ep *ep;
+ struct acmc_ep *ep;
DLIST_ENTRY *entry;
int i, cnt;
for (entry = port->ep_list.Next; entry != &port->ep_list;
entry = entry->Next) {
- ep = container_of(entry, struct acm_ep, entry);
+ ep = container_of(entry, struct acmc_ep, entry);
for (i = 0; i < MAX_EP_ADDR; i++) {
if (ep->addr_info[i].addr.type == ACM_ADDRESS_IP ||
}
static int
-acm_ep_insert_addr(struct acm_ep *ep, const char *name, uint8_t *addr,
+acm_ep_insert_addr(struct acmc_ep *ep, const char *name, uint8_t *addr,
size_t addr_len, uint8_t addr_type)
{
int i, ret;
{
uint8_t port_num;
struct acmc_device *dev;
- struct acm_ep *ep = ctx;
+ struct acmc_ep *ep = ctx;
dev = acm_get_device_from_gid(gid, &port_num);
if (dev && ep->port->dev == dev
}
}
-static int acm_get_system_ips(struct acm_ep *ep)
+static int acm_get_system_ips(struct acmc_ep *ep)
{
return acm_if_iter_sys(acm_ep_ip_iter_cb, ep);
}
-static int acm_assign_ep_names(struct acm_ep *ep)
+static int acm_assign_ep_names(struct acmc_ep *ep)
{
FILE *faddr;
char *dev_name;
return 0;
}
-static struct acm_ep *acm_find_ep(struct acmc_port *port, uint16_t pkey)
+static struct acmc_ep *acm_find_ep(struct acmc_port *port, uint16_t pkey)
{
- struct acm_ep *ep, *res = NULL;
+ struct acmc_ep *ep, *res = NULL;
DLIST_ENTRY *entry;
acm_log(2, "pkey 0x%x\n", pkey);
lock_acquire(&port->lock);
for (entry = port->ep_list.Next; entry != &port->ep_list; entry = entry->Next) {
- ep = container_of(entry, struct acm_ep, entry);
+ ep = container_of(entry, struct acmc_ep, entry);
if (ep->endpoint.pkey == pkey) {
res = ep;
break;
lock_release(&ep->lock);
}
-static void acm_ep_down(struct acm_ep *ep)
+static void acm_ep_down(struct acmc_ep *ep)
{
acm_log(1, "%s %d pkey 0x%04x\n", ep->port->dev->verbs->device->name,
ep->port->port_num, ep->endpoint.pkey);
return ep;
}
-static struct acm_ep *
+static struct acmc_ep *
acm_alloc_ep(struct acmc_port *port, uint16_t pkey)
{
- struct acm_ep *ep;
+ struct acmc_ep *ep;
int i;
acm_log(1, "\n");
static void acm_ep_up(struct acmc_port *port, uint16_t pkey)
{
- struct acm_ep *ep;
+ struct acmc_ep *ep;
int i, ret;
acm_log(1, "\n");
int ret;
struct acmp_port *prov_port;
DLIST_ENTRY *entry;
- struct acm_ep *ep;
+ struct acmc_ep *ep;
acm_log(1, "%s %d\n", port->dev->verbs->device->name, port->port_num);
ret = ibv_query_port(port->dev->verbs, port->port_num, &attr);
entry = port->ep_list.Next) {
DListRemove(entry);
lock_release(&port->lock);
- ep = container_of(entry, struct acm_ep, entry);
+ ep = container_of(entry, struct acmc_ep, entry);
acm_ep_down(ep);
lock_acquire(&port->lock);
}