int haveEvent;
int nXmitPackets;
int maxXmitPackets;
- struct rx_packet **xmitList;
int resending = 0;
/* If rxi_Start is being called as a result of a resend event,
#endif /* AFS_GLOBAL_RXLOCK_KERNEL */
nXmitPackets = 0;
maxXmitPackets = MIN(call->twind, call->cwind);
- xmitList = (struct rx_packet **)
-#if defined(KERNEL) && !defined(UKERNEL) && defined(AFS_FBSD80_ENV)
- /* XXXX else we must drop any mtx we hold */
- afs_osi_Alloc_NoSleep(maxXmitPackets * sizeof(struct rx_packet *));
-#else
- osi_Alloc(maxXmitPackets * sizeof(struct rx_packet *));
-#endif
- if (xmitList == NULL)
- osi_Panic("rxi_Start, failed to allocate xmit list");
for (queue_Scan(&call->tq, p, nxp, rx_packet)) {
if (call->flags & RX_CALL_FAST_RECOVER_WAIT) {
/* We shouldn't be sending packets if a thread is waiting
/* Transmit the packet if it needs to be sent. */
if (!clock_Lt(&now, &p->retryTime)) {
if (nXmitPackets == maxXmitPackets) {
- rxi_SendXmitList(call, xmitList, nXmitPackets,
- istack, &now, &retryTime,
- resending);
- osi_Free(xmitList, maxXmitPackets *
- sizeof(struct rx_packet *));
+ rxi_SendXmitList(call, call->xmitList,
+ nXmitPackets, istack, &now,
+ &retryTime, resending);
goto restart;
}
dpf(("call %d xmit packet %"AFS_PTR_FMT" now %u.%06u retryTime %u.%06u nextRetry %u.%06u\n",
now.sec, now.usec,
p->retryTime.sec, p->retryTime.usec,
retryTime.sec, retryTime.usec));
- xmitList[nXmitPackets++] = p;
+ call->xmitList[nXmitPackets++] = p;
}
}
/* xmitList now hold pointers to all of the packets that are
* ready to send. Now we loop to send the packets */
if (nXmitPackets > 0) {
- rxi_SendXmitList(call, xmitList, nXmitPackets, istack,
- &now, &retryTime, resending);
+ rxi_SendXmitList(call, call->xmitList, nXmitPackets,
+ istack, &now, &retryTime, resending);
}
- osi_Free(xmitList,
- maxXmitPackets * sizeof(struct rx_packet *));
#ifdef AFS_GLOBAL_RXLOCK_KERNEL
/*
#define RX_SERVER_CONNECTION 1
#endif /* !KDUMP_RX_LOCK */
+/* Maximum number of acknowledgements in an acknowledge packet */
+#define RX_MAXACKS 255
+
/* Call structure: only instantiated for active calls and dallying server calls. The permanent call state (i.e. the call number as well as state shared with other calls associated with this connection) is maintained in the connection structure. */
#ifdef KDUMP_RX_LOCK
struct rx_call_rx_lock {
afs_hyper_t bytesRcvd; /* Number bytes received */
u_short tqWaiters;
+ struct rx_packet *xmitList[RX_MAXACKS]; /* Can't xmit more than we ack */
+ /* Protected by setting RX_CALL_TQ_BUSY */
#ifdef ADAPT_WINDOW
struct clock pingRequestTime;
#endif
#define RX_CALL_HAVE_LAST 32768 /* Last packet has been received */
#define RX_CALL_NEED_START 0x10000 /* tells rxi_Start to start again */
-/* Maximum number of acknowledgements in an acknowledge packet */
-#define RX_MAXACKS 255
/* The structure of the data portion of an acknowledge packet: An acknowledge
* packet is in network byte order at all times. An acknowledgement is always