struct xmitlist {
struct rx_packet **list;
int len;
+ int resending;
};
/* Send all of the packets in the list in single datagram */
static void
rxi_SendList(struct rx_call *call, struct xmitlist *xmit,
int istack, int moreFlag, struct clock *now,
- struct clock *retryTime, int resending)
+ struct clock *retryTime)
{
int i;
int requestAck = 0;
MUTEX_ENTER(&peer->peer_lock);
peer->nSent += xmit->len;
- if (resending)
+ if (xmit->resending)
peer->reSends += xmit->len;
MUTEX_EXIT(&peer->peer_lock);
if (rx_stats_active) {
- if (resending)
+ if (xmit->resending)
rx_atomic_add(&rx_stats.dataPacketsReSent, xmit->len);
else
rx_atomic_add(&rx_stats.dataPacketsSent, xmit->len);
* idle connections) */
conn->lastSendTime = call->lastSendTime = clock_Sec();
/* Let a set of retransmits trigger an idle timeout */
- if (!resending)
+ if (!xmit->resending)
call->lastSendData = call->lastSendTime;
}
static void
rxi_SendXmitList(struct rx_call *call, struct rx_packet **list, int len,
- int istack, struct clock *now, struct clock *retryTime,
- int resending)
+ int istack, struct clock *now, struct clock *retryTime)
{
int i;
struct xmitlist working;
- struct xmitlist last = {NULL, 0};
+ struct xmitlist last;
struct rx_peer *peer = call->conn->peer;
int morePackets = 0;
memset(&last, 0, sizeof(struct xmitlist));
working.list = &list[0];
working.len = 0;
+ working.resending = 0;
for (i = 0; i < len; i++) {
/* Does the current packet force us to flush the current list? */
* set into the 'last' one, and resets the working set */
if (last.len > 0) {
- rxi_SendList(call, &last, istack, 1, now, retryTime, resending);
+ rxi_SendList(call, &last, istack, 1, now, retryTime);
/* If the call enters an error state stop sending, or if
* we entered congestion recovery mode, stop sending */
if (call->error || (call->flags & RX_CALL_FAST_RECOVER_WAIT))
}
last = working;
working.len = 0;
+ working.resending = 0;
working.list = &list[i];
}
/* Add the current packet to the list if it hasn't been acked.
* Otherwise adjust the list pointer to skip the current packet. */
if (!(list[i]->flags & RX_PKTFLAG_ACKED)) {
working.len++;
+
+ if (list[i]->header.serial)
+ working.resending = 1;
+
/* Do we need to flush the list? */
if (working.len >= (int)peer->maxDgramPackets
|| working.len >= (int)call->nDgramPackets
|| list[i]->header.serial
|| list[i]->length != RX_JUMBOBUFFERSIZE) {
if (last.len > 0) {
- rxi_SendList(call, &last, istack, 1, now,
- retryTime, resending);
+ rxi_SendList(call, &last, istack, 1, now, retryTime);
/* If the call enters an error state stop sending, or if
* we entered congestion recovery mode, stop sending */
if (call->error
}
last = working;
working.len = 0;
+ working.resending = 0;
working.list = &list[i + 1];
}
} else {
morePackets = 1;
}
if (last.len > 0) {
- rxi_SendList(call, &last, istack, morePackets, now,
- retryTime, resending);
+ rxi_SendList(call, &last, istack, morePackets, now, retryTime);
/* If the call enters an error state stop sending, or if
* we entered congestion recovery mode, stop sending */
if (call->error || (call->flags & RX_CALL_FAST_RECOVER_WAIT))
return;
}
if (morePackets) {
- rxi_SendList(call, &working, istack, 0, now, retryTime,
- resending);
+ rxi_SendList(call, &working, istack, 0, now, retryTime);
}
} else if (last.len > 0) {
- rxi_SendList(call, &last, istack, 0, now, retryTime, resending);
+ rxi_SendList(call, &last, istack, 0, now, retryTime);
/* Packets which are in 'working' are not sent by this call */
}
}
int haveEvent;
int nXmitPackets;
int maxXmitPackets;
- int resending = 0;
/* If rxi_Start is being called as a result of a resend event,
* then make sure that the event pointer is removed from the call
CALL_RELE(call, RX_CALL_REFCOUNT_RESEND);
MUTEX_EXIT(&rx_refcnt_mutex);
call->resendEvent = NULL;
- resending = 1;
if (queue_IsEmpty(&call->tq)) {
/* Nothing to do */
return;
if (nXmitPackets == maxXmitPackets) {
rxi_SendXmitList(call, call->xmitList,
nXmitPackets, istack, &now,
- &retryTime, resending);
+ &retryTime);
goto restart;
}
dpf(("call %d xmit packet %"AFS_PTR_FMT" now %u.%06u retryTime %u.%06u nextRetry %u.%06u\n",
* ready to send. Now we loop to send the packets */
if (nXmitPackets > 0) {
rxi_SendXmitList(call, call->xmitList, nXmitPackets,
- istack, &now, &retryTime, resending);
+ istack, &now, &retryTime);
}
#ifdef AFS_GLOBAL_RXLOCK_KERNEL