/*
- * Copyright (c) 2005-2006,2011 Intel Corporation. All rights reserved.
+ * Copyright (c) 2005-2006,2011-2012 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
static uint8_t migrate = 0;
static char *dst_addr;
static char *src_addr;
+static struct rdma_addrinfo hints;
static int create_message(struct cmatest_node *node)
{
static int run_server(void)
{
struct rdma_cm_id *listen_id;
- struct rdma_addrinfo hints;
int i, ret;
printf("cmatose: starting server\n");
return ret;
}
- memset(&hints, 0, sizeof hints);
- hints.ai_flags = RAI_PASSIVE;
- hints.ai_port_space = RDMA_PS_TCP;
ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai);
if (ret) {
perror("cmatose: getrdmaaddr error");
static int run_client(void)
{
- struct rdma_addrinfo hints;
int i, ret, ret2;
printf("cmatose: starting client\n");
- memset(&hints, 0, sizeof hints);
- hints.ai_port_space = RDMA_PS_TCP;
ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai);
if (ret) {
perror("cmatose: getaddrinfo error");
case 'b':
src_addr = optarg;
break;
+ case 'f':
+ if (!strncasecmp("ip", optarg, 2)) {
+ hints.ai_flags = RAI_NUMERICHOST;
+ } else if (!strncasecmp("gid", optarg, 3)) {
+ hints.ai_flags = RAI_NUMERICHOST | RAI_FAMILY;
+ hints.ai_family = AF_IB;
+ } else if (strncasecmp("name", optarg, 4)) {
+ fprintf(stderr, "Warning: unknown address format\n");
+ }
+ break;
case 'c':
connections = atoi(optarg);
break;
printf("usage: %s\n", argv[0]);
printf("\t[-s server_address]\n");
printf("\t[-b bind_address]\n");
+ printf("\t[-f address_format]\n");
+ printf("\t name, ip, ipv6, or gid\n");
printf("\t[-c connections]\n");
printf("\t[-C message_count]\n");
printf("\t[-S message_size]\n");
if (alloc_nodes())
exit(1);
- if (dst_addr)
+ hints.ai_port_space = RDMA_PS_TCP;
+ if (dst_addr) {
ret = run_client();
- else
+ } else {
+ hints.ai_flags |= RAI_PASSIVE;
ret = run_server();
+ }
printf("test complete\n");
destroy_nodes();