1
1

usnic: fix wraparound sequence number issue

Sequence numbers will wrap around; it is not sufficient to check for
(seq-1) -- must use the SEQ_DIFF macro to properly handle the
wraparound.

This bug wasn't serious; it just meant we might retransmit one or two
extra times when retransmits were triggerd and the sequence numbers
wrapped around their sliding windows.
Этот коммит содержится в:
Jeff Squyres 2016-01-30 07:33:19 -08:00
родитель 4de4a263f5
Коммит d624e0d60f
3 изменённых файлов: 8 добавлений и 8 удалений

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

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -207,8 +207,7 @@ opal_btl_usnic_ack_send(
/* send the seq of the lowest item in the window that
we've received */
ack->ss_base.us_btl_header->ack_seq =
endpoint->endpoint_next_contig_seq_to_recv - 1;
SEQ_DIFF(endpoint->endpoint_next_contig_seq_to_recv, 1);
ack->ss_len = sizeof(opal_btl_usnic_btl_header_t);
#if MSGDEBUG1

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

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -92,7 +92,7 @@ opal_btl_usnic_piggyback_ack(
if (endpoint->endpoint_ack_needed) {
opal_btl_usnic_remove_from_endpoints_needing_ack(endpoint);
sseg->ss_base.us_btl_header->ack_seq =
endpoint->endpoint_next_contig_seq_to_recv - 1;
SEQ_DIFF(endpoint->endpoint_next_contig_seq_to_recv, 1);
sseg->ss_base.us_btl_header->ack_present = 1;
#if MSGDEBUG1
opal_output(0, "Piggy-backing ACK for sequence %"UDSEQ"\n",

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

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -145,8 +145,9 @@ void opal_btl_usnic_print_stats(
/* Number of un-acked sends (i.e., sends for which we're
still waiting for ACK) */
send_unacked =
endpoint->endpoint_next_seq_to_send -
endpoint->endpoint_ack_seq_rcvd - 1;
SEQ_DIFF(endpoint->endpoint_next_seq_to_send,
SEQ_DIFF(endpoint->endpoint_ack_seq_rcvd, 1));
if (send_unacked > su_max) su_max = send_unacked;
if (send_unacked < su_min) su_min = send_unacked;