diff --git a/opal/mca/btl/usnic/Makefile.am b/opal/mca/btl/usnic/Makefile.am index 538e94e050..f14b70c5b8 100644 --- a/opal/mca/btl/usnic/Makefile.am +++ b/opal/mca/btl/usnic/Makefile.am @@ -5,7 +5,7 @@ # Copyright (c) 2004-2005 The University of Tennessee and The University # of Tennessee Research Foundation. All rights # reserved. -# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. @@ -13,13 +13,13 @@ # reserved. # Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ -# +# # Additional copyrights may follow -# +# # $HEADER$ # -AM_CPPFLAGS = $(btl_usnic_CPPFLAGS) +AM_CPPFLAGS = $(btl_usnic_CPPFLAGS) AM_CFLAGS = $(btl_usnic_CFLAGS) EXTRA_DIST = README.txt README.test @@ -102,13 +102,13 @@ endif mcacomponentdir = $(ompilibdir) mcacomponent_LTLIBRARIES = $(component) mca_btl_usnic_la_SOURCES = $(component_sources) -mca_btl_usnic_la_LDFLAGS = -module -avoid-version $(btl_usnic_LDFLAGS) +mca_btl_usnic_la_LDFLAGS = -module -avoid-version $(btl_usnic_LDFLAGS) mca_btl_usnic_la_LIBADD = $(btl_usnic_LIBS) \ $(OMPI_TOP_BUILDDIR)/opal/mca/common/verbs/libmca_common_verbs.la noinst_LTLIBRARIES = $(lib) libmca_btl_usnic_la_SOURCES = $(lib_sources) -libmca_btl_usnic_la_LDFLAGS= -module -avoid-version $(btl_usnic_LDFLAGS) +libmca_btl_usnic_la_LDFLAGS= -module -avoid-version $(btl_usnic_LDFLAGS) libmca_btl_usnic_la_LIBADD = $(btl_usnic_LIBS) if OPAL_BTL_USNIC_BUILD_UNIT_TESTS diff --git a/opal/mca/btl/usnic/btl_usnic.h b/opal/mca/btl/usnic/btl_usnic.h index d3c9d24960..4e3d189038 100644 --- a/opal/mca/btl/usnic/btl_usnic.h +++ b/opal/mca/btl/usnic/btl_usnic.h @@ -232,7 +232,7 @@ typedef uint16_t opal_btl_usnic_seq_t; /** * Register the usnic BTL MCA params */ -int opal_btl_usnic_component_register(void); +int opal_btl_usnic_component_register(void); /** * Routine which can be called from a debugger to print module, endpoint, diff --git a/opal/mca/btl/usnic/btl_usnic_ack.c b/opal/mca/btl/usnic/btl_usnic_ack.c index 90c099a07c..42d5acfc1e 100644 --- a/opal/mca/btl/usnic/btl_usnic_ack.c +++ b/opal/mca/btl/usnic/btl_usnic_ack.c @@ -139,7 +139,7 @@ opal_btl_usnic_handle_ack( /* If all ACKs received, and this is a put or a regular send * that needs a callback, perform the callback now * - * NOTE on sf_ack_bytes_left - here we check for + * NOTE on sf_ack_bytes_left - here we check for * sf_ack_bytes_left == bytes_acked * as opposed to adjusting sf_ack_bytes_left and checking for 0 because * if we don't, the callback function may call usnic_free() and free @@ -205,7 +205,7 @@ opal_btl_usnic_ack_send( ack->ss_base.us_btl_header->ack_seq = endpoint->endpoint_next_contig_seq_to_recv - 1; - ack->ss_base.us_sg_entry[0].length = + ack->ss_base.us_sg_entry[0].length = sizeof(opal_btl_usnic_btl_header_t); #if MSGDEBUG1 @@ -255,7 +255,7 @@ opal_btl_usnic_ack_complete(opal_btl_usnic_module_t *module, void opal_btl_usnic_ack_timeout( opal_hotel_t *hotel, - int room_num, + int room_num, void *occupant) { opal_btl_usnic_send_segment_t *seg; @@ -278,7 +278,7 @@ opal_btl_usnic_ack_timeout( seg->ss_hotel_room = -1; /* Queue up this frag to be resent */ - opal_list_append(&(module->pending_resend_segs), + opal_list_append(&(module->pending_resend_segs), &(seg->ss_base.us_list.super)); /* Stats */ diff --git a/opal/mca/btl/usnic/btl_usnic_ack.h b/opal/mca/btl/usnic/btl_usnic_ack.h index 766a38353e..04b63182b0 100644 --- a/opal/mca/btl/usnic/btl_usnic_ack.h +++ b/opal/mca/btl/usnic/btl_usnic_ack.h @@ -35,7 +35,7 @@ } while (0) /* - * Reap an ACK send that is complete + * Reap an ACK send that is complete */ void opal_btl_usnic_ack_complete(opal_btl_usnic_module_t *module, opal_btl_usnic_ack_segment_t *ack); @@ -51,7 +51,7 @@ void opal_btl_usnic_ack_send(opal_btl_usnic_module_t *module, * Callback for when a send times out without receiving a * corresponding ACK */ -void opal_btl_usnic_ack_timeout(opal_hotel_t *hotel, int room_num, +void opal_btl_usnic_ack_timeout(opal_hotel_t *hotel, int room_num, void *occupant); /* @@ -68,7 +68,7 @@ opal_btl_usnic_piggyback_ack( /* If ACK is needed, piggy-back it here and send it on */ if (endpoint->endpoint_ack_needed) { opal_btl_usnic_remove_from_endpoints_needing_ack(endpoint); - sseg->ss_base.us_btl_header->ack_seq = + sseg->ss_base.us_btl_header->ack_seq = endpoint->endpoint_next_contig_seq_to_recv - 1; sseg->ss_base.us_btl_header->ack_present = 1; #if MSGDEBUG1 diff --git a/opal/mca/btl/usnic/btl_usnic_component.c b/opal/mca/btl/usnic/btl_usnic_component.c index 70ea66ac23..1c91308231 100644 --- a/opal/mca/btl/usnic/btl_usnic_component.c +++ b/opal/mca/btl/usnic/btl_usnic_component.c @@ -14,7 +14,7 @@ * reserved. * Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights - * reserved. + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -160,13 +160,13 @@ static int usnic_component_open(void) /* In this version, the USNIC stack does not support having more * than one GID. So just hard-wire this value to 0. */ mca_btl_usnic_component.gid_index = 0; - + /* initialize objects */ OBJ_CONSTRUCT(&mca_btl_usnic_component.usnic_procs, opal_list_t); - + /* Sanity check: if_include and if_exclude need to be mutually exclusive */ - if (OPAL_SUCCESS != + if (OPAL_SUCCESS != mca_base_var_check_exclusive("opal", mca_btl_usnic_component.super.btl_version.mca_type_name, mca_btl_usnic_component.super.btl_version.mca_component_name, @@ -178,13 +178,13 @@ static int usnic_component_open(void) "open" failing is not printed */ return OPAL_ERR_NOT_AVAILABLE; } - + return OPAL_SUCCESS; } /* - * Component cleanup + * Component cleanup */ static int usnic_component_close(void) { @@ -232,7 +232,7 @@ static int usnic_modex_send(void) size_t size; opal_btl_usnic_addr_t* addrs = NULL; - size = mca_btl_usnic_component.num_modules * + size = mca_btl_usnic_component.num_modules * sizeof(opal_btl_usnic_addr_t); if (size != 0) { addrs = (opal_btl_usnic_addr_t*) malloc(size); @@ -241,19 +241,19 @@ static int usnic_modex_send(void) } for (i = 0; i < mca_btl_usnic_component.num_modules; i++) { - opal_btl_usnic_module_t* module = + opal_btl_usnic_module_t* module = mca_btl_usnic_component.usnic_active_modules[i]; addrs[i] = module->local_addr; opal_output_verbose(5, USNIC_OUT, "btl:usnic: modex_send DQP:%d, CQP:%d, subnet = 0x%016" PRIx64 " interface =0x%016" PRIx64, - addrs[i].qp_num[USNIC_DATA_CHANNEL], - addrs[i].qp_num[USNIC_PRIORITY_CHANNEL], + addrs[i].qp_num[USNIC_DATA_CHANNEL], + addrs[i].qp_num[USNIC_PRIORITY_CHANNEL], ntoh64(addrs[i].gid.global.subnet_prefix), ntoh64(addrs[i].gid.global.interface_id)); } } - rc = opal_modex_send(&mca_btl_usnic_component.super.btl_version, + rc = opal_modex_send(&mca_btl_usnic_component.super.btl_version, addrs, size); if (NULL != addrs) { free(addrs); @@ -454,7 +454,7 @@ static mca_btl_base_module_t** usnic_component_init(int* num_btl_modules, ************************************************************************/ /* initialization */ - mca_btl_usnic_component.my_hashed_rte_name = + mca_btl_usnic_component.my_hashed_rte_name = opal_proc_local_get()->proc_name; MSGDEBUG1_OUT("%s: my_hashed_rte_name=0x%" PRIx64, __func__, mca_btl_usnic_component.my_hashed_rte_name); @@ -522,7 +522,7 @@ static mca_btl_base_module_t** usnic_component_init(int* num_btl_modules, return upstream) */ mca_btl_usnic_component.num_modules = opal_list_get_size(port_list); btls = (struct mca_btl_base_module_t**) - malloc(mca_btl_usnic_component.num_modules * + malloc(mca_btl_usnic_component.num_modules * sizeof(opal_btl_usnic_module_t*)); if (NULL == btls) { OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); @@ -606,7 +606,7 @@ static mca_btl_base_module_t** usnic_component_init(int* num_btl_modules, /* Query this device */ if (0 != ibv_query_device(module->device_context, &device_attr)) { opal_show_help("help-mpi-btl-usnic.txt", "ibv API failed", - true, + true, opal_process_info.nodename, ibv_get_device_name(module->device), module->if_name, @@ -820,7 +820,7 @@ static mca_btl_base_module_t** usnic_component_init(int* num_btl_modules, module->port_num, module->super.btl_rndv_eager_limit); opal_output_verbose(5, USNIC_OUT, - "btl:usnic: max send size %s:%d = %" PRIsize_t + "btl:usnic: max send size %s:%d = %" PRIsize_t " (not overrideable)", ibv_get_device_name(module->device), module->port_num, @@ -924,7 +924,7 @@ static mca_btl_base_module_t** usnic_component_init(int* num_btl_modules, * receive queue is handled directly in this routine, everything else * is deferred to an external call, usnic_component_progress_2() * This helps keep usnic_component_progress() very small and very responsive - * to a single incoming packet. We make sure not to always return + * to a single incoming packet. We make sure not to always return * immediately after one packet to avoid starvation, "fastpath_ok" is * used for this. */ @@ -1108,7 +1108,7 @@ static int usnic_component_progress_2(void) /* Re-post all the remaining receive buffers */ if (OPAL_LIKELY(channel->repost_recv_head)) { - rc = ibv_post_recv(channel->qp, + rc = ibv_post_recv(channel->qp, channel->repost_recv_head, &bad_wr); channel->repost_recv_head = NULL; if (OPAL_UNLIKELY(rc != 0)) { diff --git a/opal/mca/btl/usnic/btl_usnic_endpoint.c b/opal/mca/btl/usnic/btl_usnic_endpoint.c index 009165cb6e..7f2151f0bd 100644 --- a/opal/mca/btl/usnic/btl_usnic_endpoint.c +++ b/opal/mca/btl/usnic/btl_usnic_endpoint.c @@ -85,7 +85,7 @@ static void endpoint_construct(mca_btl_base_endpoint_t* endpoint) * due to timeout */ OBJ_CONSTRUCT(&endpoint->endpoint_hotel, opal_hotel_t); - opal_hotel_init(&endpoint->endpoint_hotel, + opal_hotel_init(&endpoint->endpoint_hotel, WINDOW_SIZE, mca_btl_usnic_component.retrans_timeout, 0, @@ -147,7 +147,7 @@ static void endpoint_destruct(mca_btl_base_endpoint_t* endpoint) } OBJ_CLASS_INSTANCE(opal_btl_usnic_endpoint_t, - opal_list_item_t, + opal_list_item_t, endpoint_construct, endpoint_destruct); @@ -166,7 +166,7 @@ opal_btl_usnic_flush_endpoint( frag = (opal_btl_usnic_send_frag_t *)opal_list_remove_first( &endpoint->endpoint_frag_send_queue); - /* _cond still needs to check ownership, but make sure the + /* _cond still needs to check ownership, but make sure the * fragment is marked as done. */ frag->sf_ack_bytes_left = 0; diff --git a/opal/mca/btl/usnic/btl_usnic_endpoint.h b/opal/mca/btl/usnic/btl_usnic_endpoint.h index baa5bcf21b..2d40878ef2 100644 --- a/opal/mca/btl/usnic/btl_usnic_endpoint.h +++ b/opal/mca/btl/usnic/btl_usnic_endpoint.h @@ -90,7 +90,7 @@ struct opal_btl_usnic_proc_t; * This is the largest number of fragments that can possibly be in-flight * to us from a particular endpoint because eash chunked fragment will occupy * at least two segments, and only WINDOW_SIZE segments can be in flight. - * OK, so there is an extremely pathological case where we could see + * OK, so there is an extremely pathological case where we could see * (WINDOW_SIZE/2)+1 "in flight" at once, but just dropping that last one * and waiting for retrans is just fine in this hypothetical hyper-pathological * case, which is what we'll do. diff --git a/opal/mca/btl/usnic/btl_usnic_frag.h b/opal/mca/btl/usnic/btl_usnic_frag.h index 4224f87171..ad0e6e0ffa 100644 --- a/opal/mca/btl/usnic/btl_usnic_frag.h +++ b/opal/mca/btl/usnic/btl_usnic_frag.h @@ -48,7 +48,7 @@ struct opal_btl_usnic_module_t; /** * Fragment types * The upper layer may give us very large "fragements" to send, larger than - * an MTU. We break fragments into segments for sending, a segment being + * an MTU. We break fragments into segments for sending, a segment being * defined to fit within an MTU. */ typedef enum { @@ -128,7 +128,7 @@ typedef struct { /* payload legnth (in bytes). We unfortunately have to include this in our header because the L2 layer may artifically inflate the length of the packet to meet a minimum size */ - uint16_t payload_len; + uint16_t payload_len; /* If this is an emulated PUT, store at this address on receiver */ char *put_addr; @@ -141,7 +141,7 @@ typedef struct { /* tag for upper layer */ mca_btl_base_tag_t tag; -} opal_btl_usnic_btl_header_t; +} opal_btl_usnic_btl_header_t; /** * BTL header for a chunk of a fragment @@ -301,7 +301,7 @@ typedef struct opal_btl_usnic_large_send_frag_t { * small send fragment * Small send will optimistically use 2 SG entries in hopes of performing * an inline send, but will convert to a single SG entry is inline cannot - * be done and data must be copied. + * be done and data must be copied. * First segment will point to registered memory of associated segment to * hold BTL and upper layer headers. * Second segment will point directly to user data. If inlining fails, we @@ -497,8 +497,8 @@ opal_btl_usnic_send_frag_return_cond( /* * Return a frag if it's all done and owned by BTL - * If this is a PUT destination, only condition is that we own it. If it's - * a send frag, there are other conditions, so use the specific send frag + * If this is a PUT destination, only condition is that we own it. If it's + * a send frag, there are other conditions, so use the specific send frag * return checker. */ static inline void @@ -574,7 +574,7 @@ opal_btl_usnic_ack_segment_alloc(opal_btl_usnic_module_t *module) return ack; } -/* +/* * Return an ACK segment */ static inline void diff --git a/opal/mca/btl/usnic/btl_usnic_hwloc.c b/opal/mca/btl/usnic/btl_usnic_hwloc.c index f1c007d165..eaabc7f91a 100644 --- a/opal/mca/btl/usnic/btl_usnic_hwloc.c +++ b/opal/mca/btl/usnic/btl_usnic_hwloc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013-2014 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -205,7 +205,7 @@ int opal_btl_usnic_hwloc_distance(opal_btl_usnic_module_t *module) /* Lookup the distance between my NUMA node and the NUMA node of the device */ if (NULL != dev_numa) { - module->numa_distance = + module->numa_distance = matrix->latency[dev_numa->logical_index * num_numa_nodes + my_numa_node->logical_index]; diff --git a/opal/mca/btl/usnic/btl_usnic_mca.c b/opal/mca/btl/usnic/btl_usnic_mca.c index f187133640..5bd37ce551 100644 --- a/opal/mca/btl/usnic/btl_usnic_mca.c +++ b/opal/mca/btl/usnic/btl_usnic_mca.c @@ -13,7 +13,7 @@ * reserved. * Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012 Los Alamos National Security, LLC. All rights - * reserved. + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -73,7 +73,7 @@ static int reg_string(const char* param_name, { *storage = (char*) default_value; mca_base_component_var_register(&mca_btl_usnic_component.super.btl_version, - param_name, help_string, + param_name, help_string, MCA_BASE_VAR_TYPE_STRING, NULL, 0, @@ -82,7 +82,7 @@ static int reg_string(const char* param_name, MCA_BASE_VAR_SCOPE_READONLY, storage); - if (0 == (flags & REGSTR_EMPTY_OK) && + if (0 == (flags & REGSTR_EMPTY_OK) && (NULL == *storage || 0 == strlen(*storage))) { opal_output(0, "Bad parameter value for parameter \"%s\"", param_name); @@ -102,7 +102,7 @@ static int reg_int(const char* param_name, { *storage = default_value; mca_base_component_var_register(&mca_btl_usnic_component.super.btl_version, - param_name, help_string, + param_name, help_string, MCA_BASE_VAR_TYPE_INT, NULL, 0, @@ -177,9 +177,9 @@ int opal_btl_usnic_component_register(void) CHECK(reg_string("if_include", "Comma-delimited list of devices/networks to be used (e.g. \"usnic_0,10.10.0.0/16\"; empty value means to use all available usNICs). Mutually exclusive with btl_usnic_if_exclude.", - NULL, &mca_btl_usnic_component.if_include, + NULL, &mca_btl_usnic_component.if_include, REGSTR_EMPTY_OK, OPAL_INFO_LVL_1)); - + CHECK(reg_string("if_exclude", "Comma-delimited list of devices/networks to be excluded (empty value means to not exclude any usNICs). Mutually exclusive with btl_usnic_if_include.", NULL, &mca_btl_usnic_component.if_exclude, @@ -189,7 +189,7 @@ int opal_btl_usnic_component_register(void) "A non-negative integer specifying the frequency at which each USNIC BTL will output statistics (default: 0 seconds, meaning that statistics are disabled)", 0, &mca_btl_usnic_component.stats_frequency, 0, OPAL_INFO_LVL_4)); - mca_btl_usnic_component.stats_enabled = + mca_btl_usnic_component.stats_enabled = (bool) (mca_btl_usnic_component.stats_frequency > 0); CHECK(reg_int("stats_relative", @@ -237,7 +237,7 @@ int opal_btl_usnic_component_register(void) CHECK(reg_int("priority_limit", "Max size of \"priority\" messages (0 = use pre-set defaults; depends on number and type of devices available)", 0, &max_tiny_payload, REGINT_GE_ZERO, OPAL_INFO_LVL_5)); - opal_btl_usnic_module_template.max_tiny_payload = + opal_btl_usnic_module_template.max_tiny_payload = (size_t) max_tiny_payload; CHECK(reg_int("eager_limit", "Eager send limit (0 = use pre-set defaults; depends on number and type of devices available)", @@ -246,7 +246,7 @@ int opal_btl_usnic_component_register(void) CHECK(reg_int("rndv_eager_limit", "Eager rendezvous limit (0 = use pre-set defaults; depends on number and type of devices available)", 0, &rndv_eager_limit, REGINT_GE_ZERO, OPAL_INFO_LVL_5)); - opal_btl_usnic_module_template.super.btl_rndv_eager_limit = + opal_btl_usnic_module_template.super.btl_rndv_eager_limit = rndv_eager_limit; CHECK(reg_int("pack_lazy_threshold", "Convertor packing on-the-fly threshold (-1 = always pack eagerly, 0 = always pack lazily, otherwise will pack on the fly if fragment size is > limit)", diff --git a/opal/mca/btl/usnic/btl_usnic_module.c b/opal/mca/btl/usnic/btl_usnic_module.c index b2050d57ce..23f981c864 100644 --- a/opal/mca/btl/usnic/btl_usnic_module.c +++ b/opal/mca/btl/usnic/btl_usnic_module.c @@ -477,7 +477,7 @@ static int usnic_del_procs(struct mca_btl_base_module_t *base_module, /* * Let the PML register a callback function with me */ -static int usnic_register_pml_err_cb(struct mca_btl_base_module_t* btl, +static int usnic_register_pml_err_cb(struct mca_btl_base_module_t* btl, mca_btl_base_module_error_cb_fn_t cbfunc) { opal_btl_usnic_module_t *module = (opal_btl_usnic_module_t*) btl; @@ -494,7 +494,7 @@ static int usnic_register_pml_err_cb(struct mca_btl_base_module_t* btl, * alloc. * --> Contraction in the btl.h documentation. */ -static mca_btl_base_descriptor_t* +static mca_btl_base_descriptor_t* usnic_alloc(struct mca_btl_base_module_t* btl, struct mca_btl_base_endpoint_t* endpoint, uint8_t order, @@ -1217,7 +1217,7 @@ usnic_do_resends( /* re-send the segment */ opal_btl_usnic_post_segment(module, endpoint, sseg); - /* consume a send credit for this endpoint. May send us + /* consume a send credit for this endpoint. May send us * negative, oh well... This is because the completion routine * always increments send credits, and we must balance. * Alternative is to mark this as a retrans segment and check in @@ -1333,7 +1333,7 @@ usnic_handle_large_send( /* * Progress the send engine. - * Should only ever be called from usnic_component_progress() to + * Should only ever be called from usnic_component_progress() to * avoid re-entrancy issues. */ void @@ -1347,7 +1347,7 @@ opal_btl_usnic_module_progress_sends( struct opal_btl_usnic_channel_t *prio_channel; /* - * Post all the sends that we can + * Post all the sends that we can * resends 1st priority * ACKs 2nd priority * new sends 3rd @@ -1535,7 +1535,7 @@ usnic_send( if (frag->sf_base.uf_type == OPAL_BTL_USNIC_FRAG_SMALL_SEND && frag->sf_ack_bytes_left < module->max_tiny_payload && WINDOW_OPEN(endpoint) && - (module->mod_channels[USNIC_PRIORITY_CHANNEL].sd_wqe >= + (module->mod_channels[USNIC_PRIORITY_CHANNEL].sd_wqe >= module->mod_channels[USNIC_PRIORITY_CHANNEL].fastsend_wqe_thresh)) { size_t payload_len; @@ -1547,7 +1547,7 @@ usnic_send( /* fix up verbs SG entries */ sseg->ss_base.us_sg_entry[0].length = - sizeof(opal_btl_usnic_btl_header_t) + + sizeof(opal_btl_usnic_btl_header_t) + frag->sf_base.uf_local_seg[0].seg_len; if (frag->sf_base.uf_base.des_local_count > 1) { @@ -1617,7 +1617,7 @@ usnic_send( * We move this off to another function because having it inside * this function seems to add a little latency, likely due to inlines * making the function too big. In fact, the routine had to go to - * another file entirely, else the compiler tried to be helpful + * another file entirely, else the compiler tried to be helpful * and inline all by itself. */ rc = opal_btl_usnic_finish_put_or_send(module, endpoint, frag, tag); @@ -1719,7 +1719,7 @@ static void module_async_event_callback(int fd, short flags, void *arg) ignore it. */ opal_output_verbose(10, USNIC_OUT, "btl:usnic: got IBV_EVENT_PORT_ACTIVE on %s:%d", - ibv_get_device_name(module->device), + ibv_get_device_name(module->device), module->port_num); break; @@ -1790,7 +1790,7 @@ init_qp( channel->qp = ibv_create_qp(module->pd, &qp_init_attr); if (NULL == channel->qp) { opal_show_help("help-mpi-btl-usnic.txt", "create ibv resource failed", - true, + true, opal_process_info.nodename, ibv_get_device_name(module->device), module->if_name, @@ -1810,7 +1810,7 @@ init_qp( if (ibv_modify_qp(channel->qp, &qp_attr, IBV_QP_STATE | IBV_QP_PORT)) { opal_show_help("help-mpi-btl-usnic.txt", "ibv API failed", - true, + true, opal_process_info.nodename, ibv_get_device_name(module->device), module->if_name, @@ -1825,9 +1825,9 @@ init_qp( if (ibv_query_qp(channel->qp, &qp_attr, IBV_QP_CAP, &qp_init_attr) != 0) { opal_show_help("help-mpi-btl-usnic.txt", "ibv API failed", - true, + true, opal_process_info.nodename, - ibv_get_device_name(module->device), + ibv_get_device_name(module->device), module->if_name, "ibv_query_qp()", __FILE__, __LINE__, "Failed to query an existing queue pair"); @@ -1853,7 +1853,7 @@ static int move_qp_to_rtr(opal_btl_usnic_module_t *module, qp_attr.qp_state = IBV_QPS_RTR; if (ibv_modify_qp(channel->qp, &qp_attr, IBV_QP_STATE)) { opal_show_help("help-mpi-btl-usnic.txt", "ibv API failed", - true, + true, opal_process_info.nodename, ibv_get_device_name(module->device), module->if_name, @@ -1876,7 +1876,7 @@ static int move_qp_to_rts(opal_btl_usnic_module_t *module, qp_attr.qp_state = IBV_QPS_RTS; if (ibv_modify_qp(channel->qp, &qp_attr, IBV_QP_STATE)) { opal_show_help("help-mpi-btl-usnic.txt", "ibv API failed", - true, + true, opal_process_info.nodename, ibv_get_device_name(module->device), module->if_name, @@ -1955,7 +1955,7 @@ opal_btl_usnic_channel_init( channel->cq = ibv_create_cq(ctx, module->cq_num, NULL, NULL, 0); if (NULL == channel->cq) { opal_show_help("help-mpi-btl-usnic.txt", "create ibv resource failed", - true, + true, opal_process_info.nodename, ibv_get_device_name(module->device), module->if_name, @@ -2001,7 +2001,7 @@ opal_btl_usnic_channel_init( if (NULL == rseg) { opal_show_help("help-mpi-btl-usnic.txt", "internal error during init", - true, + true, opal_process_info.nodename, ibv_get_device_name(module->device), module->if_name, @@ -2016,7 +2016,7 @@ opal_btl_usnic_channel_init( if (ibv_post_recv(channel->qp, &rseg->rs_recv_desc, &bad_wr)) { opal_show_help("help-mpi-btl-usnic.txt", "ibv API failed", - true, + true, opal_process_info.nodename, ibv_get_device_name(module->device), module->if_name, @@ -2103,9 +2103,9 @@ int opal_btl_usnic_module_init(opal_btl_usnic_module_t *module) module->pd = ibv_alloc_pd(ctx); if (NULL == module->pd) { opal_show_help("help-mpi-btl-usnic.txt", "ibv API failed", - true, + true, opal_process_info.nodename, - ibv_get_device_name(module->device), + ibv_get_device_name(module->device), module->if_name, "ibv_alloc_pd()", __FILE__, __LINE__, "Failed to create a PD; is the usnic_verbs Linux kernel module loaded?"); @@ -2117,14 +2117,14 @@ int opal_btl_usnic_module_init(opal_btl_usnic_module_t *module) mpool_resources.sizeof_reg = sizeof(opal_btl_usnic_reg_t); mpool_resources.register_mem = usnic_reg_mr; mpool_resources.deregister_mem = usnic_dereg_mr; - asprintf(&mpool_resources.pool_name, "usnic.%" PRIu64, + asprintf(&mpool_resources.pool_name, "usnic.%" PRIu64, module->local_addr.gid.global.interface_id); module->super.btl_mpool = mca_mpool_base_module_create(mca_btl_usnic_component.usnic_mpool_name, &module->super, &mpool_resources); if (NULL == module->super.btl_mpool) { opal_show_help("help-mpi-btl-usnic.txt", "ibv API failed", - true, + true, opal_process_info.nodename, ibv_get_device_name(module->device), module->if_name, @@ -2159,8 +2159,8 @@ int opal_btl_usnic_module_init(opal_btl_usnic_module_t *module) /* Get the fd to receive events on this device */ opal_event_set(opal_event_base, &(module->device_async_event), - module->device_context->async_fd, - OPAL_EV_READ | OPAL_EV_PERSIST, + module->device_context->async_fd, + OPAL_EV_READ | OPAL_EV_PERSIST, module_async_event_callback, module); opal_event_add(&(module->device_async_event), NULL); module->device_async_event_active = true; @@ -2176,7 +2176,7 @@ int opal_btl_usnic_module_init(opal_btl_usnic_module_t *module) /* list of endpoints that are ready to send */ OBJ_CONSTRUCT(&module->endpoints_with_sends, opal_list_t); - + segsize = (module->if_mtu + opal_cache_line_size - 1) & ~(opal_cache_line_size - 1); @@ -2298,7 +2298,7 @@ dealloc_pd: } -static int usnic_ft_event(int state) +static int usnic_ft_event(int state) { return OPAL_SUCCESS; } diff --git a/opal/mca/btl/usnic/btl_usnic_module.h b/opal/mca/btl/usnic/btl_usnic_module.h index 22366e47a2..3c624fb7aa 100644 --- a/opal/mca/btl/usnic/btl_usnic_module.h +++ b/opal/mca/btl/usnic/btl_usnic_module.h @@ -123,7 +123,7 @@ typedef struct opal_btl_usnic_module_t { int prio_sd_num; int prio_rd_num; - /* + /* * Fragments larger than max_frag_payload will be broken up into * multiple chunks. The amount that can be held in a single chunk * segment is slightly less than what can be held in frag segment due diff --git a/opal/mca/btl/usnic/btl_usnic_proc.c b/opal/mca/btl/usnic/btl_usnic_proc.c index 4b802d0a3d..21ca2437e8 100644 --- a/opal/mca/btl/usnic/btl_usnic_proc.c +++ b/opal/mca/btl/usnic/btl_usnic_proc.c @@ -95,7 +95,7 @@ static void proc_destruct(opal_btl_usnic_proc_t* proc) OBJ_CLASS_INSTANCE(opal_btl_usnic_proc_t, - opal_list_item_t, + opal_list_item_t, proc_construct, proc_destruct); @@ -168,7 +168,7 @@ opal_btl_usnic_proc_lookup_endpoint(opal_btl_usnic_module_t *receiver, * Returns OPAL_ERR_UNREACH if we can't reach the peer (i.e., we can't * find their modex data). */ -static int create_proc(opal_proc_t *opal_proc, +static int create_proc(opal_proc_t *opal_proc, opal_btl_usnic_proc_t **usnic_proc) { opal_btl_usnic_proc_t *proc = NULL; @@ -213,7 +213,7 @@ static int create_proc(opal_proc_t *opal_proc, if ((size % sizeof(opal_btl_usnic_addr_t)) != 0) { char msg[1024]; - snprintf(msg, sizeof(msg), + snprintf(msg, sizeof(msg), "sizeof(modex for peer %s data) == %d, expected multiple of %d", OPAL_NAME_PRINT(opal_proc->proc_name), (int) size, (int) sizeof(opal_btl_usnic_addr_t)); @@ -250,7 +250,7 @@ static int create_proc(opal_proc_t *opal_proc, return OPAL_ERR_BAD_PARAM; } - proc->proc_modex_claimed = (bool*) + proc->proc_modex_claimed = (bool*) calloc(proc->proc_modex_count, sizeof(bool)); if (NULL == proc->proc_modex_claimed) { OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); diff --git a/opal/mca/btl/usnic/btl_usnic_recv.c b/opal/mca/btl/usnic/btl_usnic_recv.c index f4e35bca58..2e25a1db31 100644 --- a/opal/mca/btl/usnic/btl_usnic_recv.c +++ b/opal/mca/btl/usnic/btl_usnic_recv.c @@ -13,7 +13,7 @@ * reserved. * Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012 Los Alamos National Security, LLC. All rights - * reserved. + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -45,7 +45,7 @@ /* - * We have received a segment, take action based on the + * We have received a segment, take action based on the * packet type in the BTL header */ void opal_btl_usnic_recv_call(opal_btl_usnic_module_t *module, @@ -79,8 +79,8 @@ void opal_btl_usnic_recv_call(opal_btl_usnic_module_t *module, /* No idea who this was from, so drop it */ #if MSGDEBUG1 opal_output(0, "=== Unknown sender; dropped: from MAC %s to MAC %s, seq %" UDSEQ, - src_mac, - dest_mac, + src_mac, + dest_mac, bseg->us_btl_header->pkt_seq); #endif ++module->stats.num_unk_recvs; @@ -149,7 +149,7 @@ void opal_btl_usnic_recv_call(opal_btl_usnic_module_t *module, */ } else { #if MSGDEBUG1 - opal_output(0, "Copy %d PUT bytes to %p\n", + opal_output(0, "Copy %d PUT bytes to %p\n", seg->rs_base.us_btl_header->payload_len, (void*)seg->rs_base.us_btl_header->put_addr); #endif @@ -330,7 +330,7 @@ void opal_btl_usnic_recv_call(opal_btl_usnic_module_t *module, /***********************************************************************/ /* Frag is an incoming ACK */ - else if (OPAL_LIKELY(OPAL_BTL_USNIC_PAYLOAD_TYPE_ACK == + else if (OPAL_LIKELY(OPAL_BTL_USNIC_PAYLOAD_TYPE_ACK == bseg->us_btl_header->payload_type)) { opal_btl_usnic_seq_t ack_seq; diff --git a/opal/mca/btl/usnic/btl_usnic_recv.h b/opal/mca/btl/usnic/btl_usnic_recv.h index f666373a73..2692ac362a 100644 --- a/opal/mca/btl/usnic/btl_usnic_recv.h +++ b/opal/mca/btl/usnic/btl_usnic_recv.h @@ -41,7 +41,7 @@ lookup_sender(opal_btl_usnic_module_t *module, opal_btl_usnic_segment_t *seg) btl_header->sender, echo back the ptr to the sender's ompi_proc. There was limited speedup with this scheme; more investigation is required. */ - ret = opal_hash_table_get_value_uint64(&module->senders, + ret = opal_hash_table_get_value_uint64(&module->senders, seg->us_btl_header->sender, (void**) &sender); if (OPAL_LIKELY(OPAL_SUCCESS == ret)) { @@ -50,10 +50,10 @@ lookup_sender(opal_btl_usnic_module_t *module, opal_btl_usnic_segment_t *seg) /* The sender wasn't in the hash table, so do a slow lookup and put the result in the hash table */ - sender = opal_btl_usnic_proc_lookup_endpoint(module, + sender = opal_btl_usnic_proc_lookup_endpoint(module, seg->us_btl_header->sender); if (NULL != sender) { - opal_hash_table_set_value_uint64(&module->senders, + opal_hash_table_set_value_uint64(&module->senders, seg->us_btl_header->sender, sender); return sender; } @@ -132,7 +132,7 @@ opal_btl_usnic_check_rx_seq( } /* Do we have room in the endpoint's receiver window? - + Receiver window: |-------- WINDOW_SIZE ----------| @@ -144,7 +144,7 @@ opal_btl_usnic_check_rx_seq( +-- next_contig_seq_to_recv: the window left edge; will always be less than highest_seq_rcvd - The good condition is + The good condition is next_contig_seq_to_recv <= seq < next_contig_seq_to_recv + WINDOW_SIZE @@ -159,9 +159,9 @@ opal_btl_usnic_check_rx_seq( if (delta < 0 || delta >= WINDOW_SIZE) { #if MSGDEBUG1 opal_output(0, "<-- Received FRAG/CHUNK ep %p, seq %" UDSEQ " outside of window (%" UDSEQ " - %" UDSEQ "), %p, module %p -- DROPPED\n", - (void*)endpoint, seg->rs_base.us_btl_header->pkt_seq, + (void*)endpoint, seg->rs_base.us_btl_header->pkt_seq, endpoint->endpoint_next_contig_seq_to_recv, - (endpoint->endpoint_next_contig_seq_to_recv + + (endpoint->endpoint_next_contig_seq_to_recv + WINDOW_SIZE - 1), (void*) seg, (void*) endpoint->endpoint_module); @@ -194,7 +194,7 @@ opal_btl_usnic_check_rx_seq( rel_posn_in_recv_win = seq - next_contig_seq_to_recv array_posn = (rel_posn_in_recv_win + rfstart) % WINDOW_SIZE - + rfstart is then updated when we send ACKs: rfstart = (rfstart + num_acks_sent) % WINDOW_SIZE @@ -234,7 +234,7 @@ dup_needs_ack: } /* - * We have received a segment, take action based on the + * We have received a segment, take action based on the * packet type in the BTL header. * Try to be fast here - defer as much bookkeeping until later as * possible. @@ -289,7 +289,7 @@ opal_btl_usnic_recv_fast(opal_btl_usnic_module_t *module, */ reg = mca_btl_base_active_message_trigger + bseg->us_btl_header->tag; seg->rs_segment.seg_len = bseg->us_btl_header->payload_len; - reg->cbfunc(&module->super, bseg->us_btl_header->tag, + reg->cbfunc(&module->super, bseg->us_btl_header->tag, &seg->rs_desc, reg->cbdata); drop: @@ -347,7 +347,7 @@ repost: } /* - * We have received a segment, take action based on the + * We have received a segment, take action based on the * packet type in the BTL header */ static inline void diff --git a/opal/mca/btl/usnic/btl_usnic_send.c b/opal/mca/btl/usnic/btl_usnic_send.c index 7ce6273ed8..2a091741bd 100644 --- a/opal/mca/btl/usnic/btl_usnic_send.c +++ b/opal/mca/btl/usnic/btl_usnic_send.c @@ -11,9 +11,9 @@ * All rights reserved. * Copyright (c) 2006 Sandia National Laboratories. All rights * reserved. - * Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012 Los Alamos National Security, LLC. All rights - * reserved. + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow diff --git a/opal/mca/btl/usnic/btl_usnic_send.h b/opal/mca/btl/usnic/btl_usnic_send.h index 60261dccb3..dbf4e3d9d1 100644 --- a/opal/mca/btl/usnic/btl_usnic_send.h +++ b/opal/mca/btl/usnic/btl_usnic_send.h @@ -20,7 +20,7 @@ #endif /* - * Check if conditions are right, and if so, put endpoint on + * Check if conditions are right, and if so, put endpoint on * list of endpoints that have sends to be done */ static inline void @@ -85,7 +85,7 @@ opal_btl_usnic_post_segment( #if MSGDEBUG1 opal_output(0, "post_send: type=%s, addr=%p, len=%d, payload=%d\n", usnic_seg_type(sseg->ss_base.us_type), - (void*) sseg->ss_send_desc.sg_list->addr, + (void*) sseg->ss_send_desc.sg_list->addr, sge_total(&sseg->ss_send_desc), sseg->ss_base.us_btl_header->payload_len); /*opal_btl_usnic_dump_hex((void *)(sseg->ss_send_desc.sg_list->addr + sizeof(opal_btl_usnic_btl_header_t)), 16); */ @@ -103,7 +103,7 @@ opal_btl_usnic_post_segment( /* Post segment to the NIC */ ret = ibv_post_send(channel->qp, &sseg->ss_send_desc, &bad_wr); if (OPAL_UNLIKELY(0 != ret)) { - opal_btl_usnic_util_abort("ibv_post_send() failed", + opal_btl_usnic_util_abort("ibv_post_send() failed", __FILE__, __LINE__); /* Never returns */ } @@ -185,7 +185,7 @@ opal_btl_usnic_endpoint_send_segment( (sseg->ss_parent_frag->sf_base.uf_type == OPAL_BTL_USNIC_FRAG_LARGE_SEND)? "CHUNK" : "FRAG", sseg->ss_base.us_btl_header->pkt_seq, - sseg->ss_base.us_btl_header->sender, + sseg->ss_base.us_btl_header->sender, endpoint->endpoint_module->device->name, mac_str1, module->local_addr.qp_num[sseg->ss_channel], (void*)sseg, sseg->ss_hotel_room, @@ -259,7 +259,7 @@ opal_btl_usnic_release_send_segment( opal_btl_usnic_send_frag_t *frag, opal_btl_usnic_send_segment_t *sseg) { - /* We only return CHUNK segments because they are the only send-style + /* We only return CHUNK segments because they are the only send-style * segments that are dynamically allocated. */ if (sseg->ss_base.us_type == OPAL_BTL_USNIC_SEG_CHUNK) { diff --git a/opal/mca/btl/usnic/btl_usnic_stats.c b/opal/mca/btl/usnic/btl_usnic_stats.c index bcd94a830b..65e9b3e1ce 100644 --- a/opal/mca/btl/usnic/btl_usnic_stats.c +++ b/opal/mca/btl/usnic/btl_usnic_stats.c @@ -427,7 +427,7 @@ static void setup_mpit_pvars_enum(void) into private storage, so we don't need them any more) */ for (i = 0; i < mca_btl_usnic_component.num_modules; ++i) { free((char*) devices[i].string); - } + } /* The devices_enum has been RETAIN'ed by the pvar, so we can RELEASE it here, and the enum will be destroyed when the pvar diff --git a/opal/mca/btl/usnic/btl_usnic_util.c b/opal/mca/btl/usnic/btl_usnic_util.c index 4651ce9541..d874891409 100644 --- a/opal/mca/btl/usnic/btl_usnic_util.c +++ b/opal/mca/btl/usnic/btl_usnic_util.c @@ -117,7 +117,7 @@ void opal_btl_usnic_snprintf_ipv4_addr(char *out, size_t maxlen, void opal_btl_usnic_sprintf_mac(char *out, const uint8_t mac[6]) { - snprintf(out, 32, "%02x:%02x:%02x:%02x:%02x:%02x", + snprintf(out, 32, "%02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2], @@ -185,7 +185,7 @@ int opal_btl_usnic_find_ip(opal_btl_usnic_module_t *module, uint8_t mac[6]) } /* Yes, it is! */ - if (OPAL_SUCCESS != opal_ifindextoname(i, module->if_name, + if (OPAL_SUCCESS != opal_ifindextoname(i, module->if_name, sizeof(module->if_name)) || OPAL_SUCCESS != opal_ifindextoaddr(i, &sa, sizeof(sa)) || OPAL_SUCCESS != opal_ifindextomask(i, &module->if_cidrmask,