1
1

Merge pull request #2692 from jsquyres/pr/master/usnic-queue-fixes

master: usnic queue fixes
Этот коммит содержится в:
Jeff Squyres 2017-01-10 19:38:40 -05:00 коммит произвёл GitHub
родитель d8ed7b55a3 b980e334dc
Коммит 5b1d4fddd2
12 изменённых файлов: 208 добавлений и 66 удалений

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2017 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -26,18 +26,24 @@
#include "btl_usnic_connectivity.h"
/*
* Force a retrans of a segment
* Special case: we know exactly which segment is missing at the
* receive; explicitly force retrans of that segment.
*/
static void
opal_btl_usnic_force_retrans(
opal_btl_usnic_fast_retrans(
opal_btl_usnic_endpoint_t *endpoint,
opal_btl_usnic_seq_t ack_seq)
{
opal_btl_usnic_send_segment_t *sseg;
int is;
is = WINDOW_SIZE_MOD(ack_seq+1);
is = WINDOW_SIZE_MOD(ack_seq + 1);
sseg = endpoint->endpoint_sent_segs[is];
// If the sseg is NULL, then there's nothing to retransmit. If
// the hotel room is -1, the segment has already been queued up
// for retransmit and there's nothing additional we need to do
// here.
if (sseg == NULL || sseg->ss_hotel_room == -1) {
return;
}
@ -79,12 +85,14 @@ opal_btl_usnic_handle_ack(
#endif
++module->stats.num_old_dup_acks;
return;
}
/* A duplicate ACK means next seg was lost */
} else if (ack_seq == endpoint->endpoint_ack_seq_rcvd) {
/* A duplicate ACK means the sender did not receive the next
seg that we sent */
else if (ack_seq == endpoint->endpoint_ack_seq_rcvd) {
++module->stats.num_dup_acks;
opal_btl_usnic_force_retrans(endpoint, ack_seq);
opal_btl_usnic_fast_retrans(endpoint, ack_seq);
return;
}
@ -114,12 +122,11 @@ opal_btl_usnic_handle_ack(
already been evicted and queued for resend.
If it's not in the hotel, don't check it out! */
if (OPAL_LIKELY(sseg->ss_hotel_room != -1)) {
opal_hotel_checkout(&endpoint->endpoint_hotel, sseg->ss_hotel_room);
sseg->ss_hotel_room = -1;
}
/* hotel_room == -1 means queued for resend, remove it */
} else {
else {
opal_list_remove_item((&module->pending_resend_segs),
&sseg->ss_base.us_list.super);
}
@ -191,19 +198,27 @@ opal_btl_usnic_handle_ack(
/*
* Send an ACK
*/
void
int
opal_btl_usnic_ack_send(
opal_btl_usnic_module_t *module,
opal_btl_usnic_endpoint_t *endpoint)
{
opal_btl_usnic_ack_segment_t *ack;
/* If we don't have any send credits in the priority channel,
don't send it */
if (module->mod_channels[USNIC_PRIORITY_CHANNEL].credits < 1) {
return OPAL_ERR_OUT_OF_RESOURCE;
}
/* Get an ACK frag. If we don't get one, just discard this ACK. */
ack = opal_btl_usnic_ack_segment_alloc(module);
if (OPAL_UNLIKELY(NULL == ack)) {
return;
return OPAL_ERR_OUT_OF_RESOURCE;
}
--module->mod_channels[USNIC_PRIORITY_CHANNEL].credits;
/* send the seq of the lowest item in the window that
we've received */
ack->ss_base.us_btl_header->ack_seq =
@ -239,7 +254,7 @@ opal_btl_usnic_ack_send(
/* Stats */
++module->stats.num_ack_sends;
return;
return OPAL_SUCCESS;
}
/*
@ -249,6 +264,7 @@ void
opal_btl_usnic_ack_complete(opal_btl_usnic_module_t *module,
opal_btl_usnic_ack_segment_t *ack)
{
++module->mod_channels[USNIC_PRIORITY_CHANNEL].credits;
opal_btl_usnic_ack_segment_return(module, ack);
++module->mod_channels[ack->ss_channel].credits;
}
@ -291,4 +307,3 @@ opal_btl_usnic_ack_timeout(
/* Stats */
++module->stats.num_timeout_retrans;
}

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2017 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -67,7 +67,7 @@ void opal_btl_usnic_ack_complete(opal_btl_usnic_module_t *module,
/*
* Send an ACK
*/
void opal_btl_usnic_ack_send(opal_btl_usnic_module_t *module,
int opal_btl_usnic_ack_send(opal_btl_usnic_module_t *module,
opal_btl_usnic_endpoint_t *endpoint);
/*

Просмотреть файл

@ -12,7 +12,7 @@
* All rights reserved.
* Copyright (c) 2006 Sandia National Laboratories. All rights
* reserved.
* Copyright (c) 2008-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008-2017 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
@ -1159,6 +1159,8 @@ static int usnic_component_progress(void)
if (OPAL_LIKELY(OPAL_BTL_USNIC_SEG_RECV ==
rseg->rs_base.us_type)) {
opal_btl_usnic_recv_fast(module, rseg, channel);
++module->stats.num_seg_total_completions;
++module->stats.num_seg_recv_completions;
fastpath_ok = false; /* prevent starvation */
return 1;
} else {
@ -1188,6 +1190,8 @@ static int usnic_handle_completion(
seg = (opal_btl_usnic_segment_t*)completion->op_context;
rseg = (opal_btl_usnic_recv_segment_t*)seg;
++module->stats.num_seg_total_completions;
/* Make the completion be Valgrind-defined */
opal_memchecker_base_mem_defined(seg, sizeof(*seg));
@ -1198,24 +1202,30 @@ static int usnic_handle_completion(
/**** Send ACK completions ****/
case OPAL_BTL_USNIC_SEG_ACK:
++module->stats.num_seg_ack_completions;
opal_btl_usnic_ack_complete(module,
(opal_btl_usnic_ack_segment_t *)seg);
break;
/**** Send of frag segment completion ****/
/**** Send of frag segment completion (i.e., the MPI message's
one-and-only segment has completed sending) ****/
case OPAL_BTL_USNIC_SEG_FRAG:
++module->stats.num_seg_frag_completions;
opal_btl_usnic_frag_send_complete(module,
(opal_btl_usnic_frag_segment_t*)seg);
break;
/**** Send of chunk segment completion ****/
/**** Send of chunk segment completion (i.e., part of a large MPI
message is done sending) ****/
case OPAL_BTL_USNIC_SEG_CHUNK:
++module->stats.num_seg_chunk_completions;
opal_btl_usnic_chunk_send_complete(module,
(opal_btl_usnic_chunk_segment_t*)seg);
break;
/**** Receive completions ****/
case OPAL_BTL_USNIC_SEG_RECV:
++module->stats.num_seg_recv_completions;
opal_btl_usnic_recv(module, rseg, channel);
break;

Просмотреть файл

@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2006 Sandia National Laboratories. All rights
* reserved.
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2017 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -160,6 +160,8 @@ typedef struct mca_btl_base_endpoint_t {
opal_btl_usnic_seq_t endpoint_next_seq_to_send; /* n_t */
opal_btl_usnic_seq_t endpoint_ack_seq_rcvd; /* n_a */
/* Table where sent segments sit while waiting for their ACKs.
When a segment is ACKed, it is removed from this table. */
struct opal_btl_usnic_send_segment_t *endpoint_sent_segs[WINDOW_SIZE];
/* Values for the current proc to receive from this endpoint on

Просмотреть файл

@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2006 Sandia National Laboratories. All rights
* reserved.
* Copyright (c) 2013-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2017 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -50,15 +50,15 @@ common_send_seg_helper(opal_btl_usnic_send_segment_t *seg)
static void
chunk_seg_constructor(
opal_btl_usnic_send_segment_t *seg)
opal_btl_usnic_chunk_segment_t *cseg)
{
opal_btl_usnic_segment_t *bseg;
bseg = &seg->ss_base;
bseg = &cseg->ss_base;
bseg->us_type = OPAL_BTL_USNIC_SEG_CHUNK;
/* some more common initializaiton */
common_send_seg_helper(seg);
common_send_seg_helper(cseg);
/* payload starts next byte beyond BTL chunk header */
bseg->us_payload.raw = (uint8_t *)(bseg->us_btl_chunk_header + 1);
@ -68,15 +68,15 @@ chunk_seg_constructor(
static void
frag_seg_constructor(
opal_btl_usnic_send_segment_t *seg)
opal_btl_usnic_frag_segment_t *fseg)
{
opal_btl_usnic_segment_t *bseg;
bseg = &seg->ss_base;
bseg = &fseg->ss_base;
bseg->us_type = OPAL_BTL_USNIC_SEG_FRAG;
/* some more common initializaiton */
common_send_seg_helper(seg);
common_send_seg_helper(fseg);
/* payload starts next byte beyond BTL header */
bseg->us_payload.raw = (uint8_t *)(bseg->us_btl_header + 1);
@ -86,7 +86,7 @@ frag_seg_constructor(
static void
ack_seg_constructor(
opal_btl_usnic_send_segment_t *ack)
opal_btl_usnic_ack_segment_t *ack)
{
opal_btl_usnic_segment_t *bseg;

Просмотреть файл

@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2006 Sandia National Laboratories. All rights
* reserved.
* Copyright (c) 2013-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2017 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -370,6 +370,7 @@ opal_btl_usnic_small_send_frag_alloc(opal_btl_usnic_module_t *module)
/* this belongs in constructor... */
frag->ssf_base.sf_base.uf_freelist = &(module->small_send_frags);
frag->ssf_segment.ss_send_posted = 0;
assert(frag);
assert(OPAL_BTL_USNIC_FRAG_SMALL_SEND == frag->ssf_base.sf_base.uf_type);
@ -480,6 +481,14 @@ opal_btl_usnic_frag_return(
}
}
/* Reset the "send_posted" flag on the embedded segment for small
fragments */
else if (frag->uf_type == OPAL_BTL_USNIC_FRAG_SMALL_SEND) {
opal_btl_usnic_small_send_frag_t *sfrag;
sfrag = (opal_btl_usnic_small_send_frag_t *) frag;
sfrag->ssf_segment.ss_send_posted = 0;
}
USNIC_COMPAT_FREE_LIST_RETURN(frag->uf_freelist, &(frag->uf_base.super));
}

Просмотреть файл

@ -12,7 +12,7 @@
* All rights reserved.
* Copyright (c) 2006 Sandia National Laboratories. All rights
* reserved.
* Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved
@ -987,7 +987,7 @@ usnic_do_resends(
/* resends are always standard segments */
sseg->ss_channel = USNIC_DATA_CHANNEL;
/* re-send the segment */
/* re-send the segment (we have a send credit available) */
opal_btl_usnic_post_segment(module, endpoint, sseg);
/* consume a send credit for this endpoint. May send us
@ -1017,6 +1017,9 @@ usnic_do_resends(
* endpoint_send_segment() it. Takes care of subsequent frag
* cleanup/bookkeeping (dequeue, descriptor callback, etc.) if this frag was
* completed by this segment.
*
* ASSUMES THAT THE CALLER HAS ALREADY CHECKED TO SEE IF WE HAVE
* A SEND CREDIT!
*/
static void
usnic_handle_large_send(
@ -1070,7 +1073,8 @@ usnic_handle_large_send(
/* payload length into the header*/
sseg->ss_base.us_btl_header->payload_len = payload_len;
/* do the send */
// We assume that the caller has checked to see that we have a
// send credit, so do the send.
opal_btl_usnic_endpoint_send_segment(module, sseg);
/* do fragment bookkeeping */
@ -1182,7 +1186,7 @@ opal_btl_usnic_module_progress_sends(
sseg->ss_base.us_btl_header->tag);
#endif
/* post the send */
/* post the send (we have a send credit available) */
opal_btl_usnic_endpoint_send_segment(module, sseg);
/* don't do callback yet if this is a put */
@ -1233,8 +1237,13 @@ opal_btl_usnic_module_progress_sends(
/* Is it time to send ACK? */
if (endpoint->endpoint_acktime == 0 ||
endpoint->endpoint_acktime <= get_nsec()) {
opal_btl_usnic_ack_send(module, endpoint);
opal_btl_usnic_remove_from_endpoints_needing_ack(endpoint);
if (OPAL_LIKELY(opal_btl_usnic_ack_send(module, endpoint) == OPAL_SUCCESS)) {
opal_btl_usnic_remove_from_endpoints_needing_ack(endpoint);
} else {
// If we fail, it means we're out of send credits on
// the ACK channel
break;
}
}
endpoint = next_endpoint;
@ -1309,8 +1318,8 @@ 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) &&
(get_send_credits(&module->mod_channels[USNIC_PRIORITY_CHANNEL]) >=
module->mod_channels[USNIC_PRIORITY_CHANNEL].fastsend_wqe_thresh)) {
(get_send_credits(&module->mod_channels[USNIC_DATA_CHANNEL]) >=
module->mod_channels[USNIC_DATA_CHANNEL].fastsend_wqe_thresh)) {
size_t payload_len;
sfrag = (opal_btl_usnic_small_send_frag_t *)frag;
@ -1342,7 +1351,7 @@ usnic_send(
opal_output(0, "INLINE send, sseg=%p", (void *)sseg);
#endif
/* post the segment now */
/* post the segment now (we have a send credit available) */
opal_btl_usnic_endpoint_send_segment(module, sseg);
/* If we own the frag and callback was requested, callback now,
@ -1602,6 +1611,31 @@ static int create_ep(opal_btl_usnic_module_t* module,
return OPAL_ERR_OUT_OF_RESOURCE;
}
/* Check to ensure that the RX/TX queue lengths are at least as
long as we asked for */
if ((int) channel->info->rx_attr->size < channel->chan_rd_num) {
rc = FI_ETOOSMALL;
opal_show_help("help-mpi-btl-usnic.txt",
"internal error during init",
true,
opal_process_info.nodename,
module->linux_device_name,
"endpoint RX queue length is too short", __FILE__, __LINE__,
rc, fi_strerror(rc));
return OPAL_ERR_OUT_OF_RESOURCE;
}
if ((int) channel->info->tx_attr->size < channel->chan_sd_num) {
rc = FI_ETOOSMALL;
opal_show_help("help-mpi-btl-usnic.txt",
"internal error during init",
true,
opal_process_info.nodename,
module->linux_device_name,
"endpoint TX queue length is too short", __FILE__, __LINE__,
rc, fi_strerror(rc));
return OPAL_ERR_OUT_OF_RESOURCE;
}
/* attach CQ to EP */
rc = fi_ep_bind(channel->ep, &channel->cq->fid, FI_SEND);
if (0 != rc) {
@ -1689,10 +1723,6 @@ static int create_ep(opal_btl_usnic_module_t* module,
inet_ntoa(sin->sin_addr),
ntohs(sin->sin_port));
/* actual sizes */
channel->chan_rd_num = channel->info->rx_attr->size;
channel->chan_sd_num = channel->info->tx_attr->size;
return OPAL_SUCCESS;
}
@ -1735,7 +1765,8 @@ static int init_one_channel(opal_btl_usnic_module_t *module,
int index,
int max_msg_size,
int rd_num,
int sd_num)
int sd_num,
int cq_num)
{
int i;
int rc;
@ -1765,7 +1796,7 @@ static int init_one_channel(opal_btl_usnic_module_t *module,
memset(&cq_attr, 0, sizeof(cq_attr));
cq_attr.format = FI_CQ_FORMAT_CONTEXT;
cq_attr.wait_obj = FI_WAIT_NONE;
cq_attr.size = module->cq_num;
cq_attr.size = cq_num;
rc = fi_cq_open(module->domain, &cq_attr, &channel->cq, NULL);
if (0 != rc) {
opal_show_help("help-mpi-btl-usnic.txt",
@ -1773,7 +1804,22 @@ static int init_one_channel(opal_btl_usnic_module_t *module,
true,
opal_process_info.nodename,
module->linux_device_name,
"failed to create CQ", __FILE__, __LINE__);
"failed to create CQ", __FILE__, __LINE__,
rc, fi_strerror(-rc));
goto error;
}
/* Ensure that we got a CQ that is at least as long as we asked
for */
if ((int) cq_attr.size < cq_num) {
rc = FI_ETOOSMALL;
opal_show_help("help-mpi-btl-usnic.txt",
"internal error during init",
true,
opal_process_info.nodename,
module->linux_device_name,
"created CQ is too small", __FILE__, __LINE__,
rc, fi_strerror(rc));
goto error;
}
@ -1786,6 +1832,15 @@ static int init_one_channel(opal_btl_usnic_module_t *module,
assert(channel->info->ep_attr->msg_prefix_size ==
(uint32_t) mca_btl_usnic_component.transport_header_len);
opal_output_verbose(15, USNIC_OUT,
"btl:usnic:init_one_channel:%s: channel %s, rx queue size=%" PRIsize_t ", tx queue size=%" PRIsize_t ", cq size=%" PRIsize_t ", send credits=%d",
module->linux_device_name,
(index == USNIC_PRIORITY_CHANNEL) ? "priority" : "data",
channel->info->rx_attr->size,
channel->info->tx_attr->size,
cq_attr.size,
channel->credits);
/*
* Initialize pool of receive segments. Round MTU up to cache
* line size so that each segment is guaranteed to start on a
@ -1963,6 +2018,11 @@ static void init_find_transport_header_len(opal_btl_usnic_module_t *module)
*/
static void init_queue_lengths(opal_btl_usnic_module_t *module)
{
bool cq_is_sum = false;
if (-1 == mca_btl_usnic_component.cq_num) {
cq_is_sum = true;
}
if (-1 == mca_btl_usnic_component.sd_num) {
module->sd_num = module->fabric_info->tx_attr->size;
} else {
@ -1973,7 +2033,7 @@ static void init_queue_lengths(opal_btl_usnic_module_t *module)
} else {
module->rd_num = mca_btl_usnic_component.rd_num;
}
if (-1 == mca_btl_usnic_component.cq_num) {
if (cq_is_sum) {
module->cq_num = module->rd_num + module->sd_num;
} else {
module->cq_num = mca_btl_usnic_component.cq_num;
@ -2008,6 +2068,11 @@ static void init_queue_lengths(opal_btl_usnic_module_t *module)
module->fabric_info->rx_attr->size) {
module->prio_rd_num = module->fabric_info->rx_attr->size;
}
if (cq_is_sum) {
module->prio_cq_num = module->prio_rd_num + module->prio_sd_num;
} else {
module->prio_cq_num = module->cq_num;
}
}
static void init_payload_lengths(opal_btl_usnic_module_t *module)
@ -2213,14 +2278,14 @@ static int init_channels(opal_btl_usnic_module_t *module)
rc = init_one_channel(module,
USNIC_PRIORITY_CHANNEL,
module->max_tiny_msg_size,
module->prio_rd_num, module->prio_sd_num);
module->prio_rd_num, module->prio_sd_num, module->prio_cq_num);
if (rc != OPAL_SUCCESS) {
goto destroy;
}
rc = init_one_channel(module,
USNIC_DATA_CHANNEL,
module->fabric_info->ep_attr->max_msg_size,
module->rd_num, module->sd_num);
module->rd_num, module->sd_num, module->cq_num);
if (rc != OPAL_SUCCESS) {
goto destroy;
}

Просмотреть файл

@ -12,7 +12,7 @@
* All rights reserved.
* Copyright (c) 2006 Sandia National Laboratories. All rights
* reserved.
* Copyright (c) 2011-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
@ -71,7 +71,7 @@ typedef struct opal_btl_usnic_channel_t {
int chan_rd_num;
int chan_sd_num;
int credits; /* RFXXX until libfab credits fixed */
int credits;
uint32_t rx_post_cnt;
/* fastsend enabled if num_credits_available >= fastsend_wqe_thresh */
@ -137,6 +137,7 @@ typedef struct opal_btl_usnic_module_t {
int av_eq_num;
int prio_sd_num;
int prio_rd_num;
int prio_cq_num;
/*
* Fragments larger than max_frag_payload will be broken up into

Просмотреть файл

@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2006 Sandia National Laboratories. All rights
* reserved.
* Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008-2017 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
@ -43,8 +43,9 @@
/*
* This function is called when a send of a full-fragment segment completes
* Return the WQE and also return the segment if no ACK pending
* This function is called when a send of a segment completes that is
* the one-and-only segment of an MPI message. Return the WQE and
* also return the segment if no ACK pending.
*/
void
opal_btl_usnic_frag_send_complete(opal_btl_usnic_module_t *module,
@ -59,20 +60,27 @@ opal_btl_usnic_frag_send_complete(opal_btl_usnic_module_t *module,
--frag->sf_seg_post_cnt;
/* checks for returnability made inside */
opal_btl_usnic_endpoint_t *ep = frag->sf_endpoint;
opal_btl_usnic_send_frag_return_cond(module, frag);
// In a short frag segment, the sseg is embedded in the frag. So
// there's no need to return the sseg (because we already returned
// the frag).
/* do bookkeeping */
++frag->sf_endpoint->endpoint_send_credits;
++ep->endpoint_send_credits;
/* see if this endpoint needs to be made ready-to-send */
opal_btl_usnic_check_rts(frag->sf_endpoint);
opal_btl_usnic_check_rts(ep);
++module->mod_channels[sseg->ss_channel].credits;
}
/*
* This function is called when a send segment completes
* Return the WQE and also return the segment if no ACK pending
* This function is called when a send segment completes that is part
* of a larger MPI message (ie., there may still be other chunk
* segments that have not yet completed sending). Return the WQE and
* also return the segment if no ACK pending.
*/
void
opal_btl_usnic_chunk_send_complete(opal_btl_usnic_module_t *module,

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2017 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -52,7 +52,10 @@ opal_btl_usnic_check_rts(
}
/*
* Common point for posting a segment
* Common point for posting a segment.
*
* ASSUMES THAT THE CALLER HAS ALREADY CHECKED TO SEE IF WE HAVE
* A SEND CREDIT!
*/
static inline void
opal_btl_usnic_post_segment(
@ -77,6 +80,7 @@ opal_btl_usnic_post_segment(
#endif
assert(channel_id == USNIC_DATA_CHANNEL);
assert(channel->credits > 1);
/* Send the segment */
ret = fi_send(channel->ep,
@ -105,6 +109,9 @@ opal_btl_usnic_post_segment(
/*
* Common point for posting an ACK
*
* ASSUMES THAT THE CALLER HAS ALREADY CHECKED TO SEE IF WE HAVE
* A SEND CREDIT!
*/
static inline void
opal_btl_usnic_post_ack(
@ -129,6 +136,7 @@ opal_btl_usnic_post_ack(
#endif
assert(channel_id == USNIC_PRIORITY_CHANNEL);
assert(channel->credits > 1);
ret = fi_send(channel->ep,
sseg->ss_ptr,
@ -230,11 +238,12 @@ opal_btl_usnic_endpoint_send_segment(
/* do the actual send */
opal_btl_usnic_post_segment(module, endpoint, sseg);
/* Track this header by stashing in an array on the endpoint that
is the same length as the sender's window (i.e., WINDOW_SIZE).
To find a unique slot in this array, use (seq % WINDOW_SIZE).
*/
/* Stash this segment in an array on the endpoint that is the same
length as the sender's window (i.e., WINDOW_SIZE) until it
receives its ACK. To find a unique slot in this array, use
(seq % WINDOW_SIZE). */
sfi = WINDOW_SIZE_MOD(sseg->ss_base.us_btl_header->pkt_seq);
assert(NULL == endpoint->endpoint_sent_segs[sfi]);
endpoint->endpoint_sent_segs[sfi] = sseg;
sseg->ss_ack_pending = true;

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2017 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -60,6 +60,12 @@ static inline void usnic_stats_reset(opal_btl_usnic_module_t *module)
module->stats.pml_module_sends =
module->stats.pml_send_callbacks =
module->stats.num_seg_total_completions =
module->stats.num_seg_ack_completions =
module->stats.num_seg_frag_completions =
module->stats.num_seg_chunk_completions =
module->stats.num_seg_recv_completions =
0;
for (i=0; i<USNIC_NUM_CHANNELS; ++i) {
@ -82,7 +88,7 @@ void opal_btl_usnic_print_stats(
char tmp[128], str[2048];
/* The usuals */
snprintf(str, sizeof(str), "%s:MCW:%3u, %s, ST(P+D)/F/C/R(T+F)/A:%8lu(%8u+%8u)/%8lu/%8lu/%4lu(%4lu+%4lu)/%8lu, RcvTot/Chk/F/C/L/H/D/BF/A:%8lu/%c%c/%8lu/%8lu/%4lu+%2lu/%4lu/%4lu/%6lu OA/DA %4lu/%4lu CRC:%4lu ",
snprintf(str, sizeof(str), "%s:MCW:%3u, %s, ST(P+D)/F/C/R(T+F)/A:%8lu(%8u+%8u)/%8lu/%8lu/%4lu(%4lu+%4lu)/%8lu, RcvTot/Chk/F/C/L/H/D/BF/A:%8lu/%c%c/%8lu/%8lu/%4lu+%2lu/%4lu/%4lu/%6lu Comp:T(A/F/C/R) %8lu(%8lu/%8lu/%8lu/%8lu), OA/DA %4lu/%4lu CRC:%4lu ",
prefix,
opal_proc_local_get()->proc_name.vpid,
@ -118,11 +124,22 @@ void opal_btl_usnic_print_stats(
module->stats.num_badfrag_recvs,
module->stats.num_ack_recvs,
module->stats.num_seg_total_completions,
module->stats.num_seg_ack_completions,
module->stats.num_seg_frag_completions,
module->stats.num_seg_chunk_completions,
module->stats.num_seg_recv_completions,
module->stats.num_old_dup_acks,
module->stats.num_dup_acks,
module->stats.num_crc_errors);
// Shouldn't happen, but just in case the string ever grows long
// enough to someday potentially get truncated by snprintf, ensure
// that the string is terminated.
str[sizeof(str) - 1] = '\0';
/* If our PML calls were 0, then show send and receive window
extents instead */
if (module->stats.pml_module_sends +

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2017 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -56,6 +56,12 @@ typedef struct opal_btl_usnic_module_stats_t {
uint64_t pml_module_sends;
uint64_t pml_send_callbacks;
uint64_t num_seg_total_completions;
uint64_t num_seg_ack_completions;
uint64_t num_seg_frag_completions;
uint64_t num_seg_chunk_completions;
uint64_t num_seg_recv_completions;
opal_event_t timer_event;
struct timeval timeout;
} opal_btl_usnic_module_stats_t;