* kernel version, and may interrupt the macros rx_Read or
* rx_Write, which run at normal priority for efficiency. */
if (call->currentPacket) {
+#ifdef RX_TRACK_PACKETS
call->currentPacket->flags &= ~RX_PKTFLAG_CP;
+#endif
rxi_FreePacket(call->currentPacket);
call->currentPacket = (struct rx_packet *)0;
}
/* It's the next packet. Stick it on the receive queue
* for this call. Set newPackets to make sure we wake
* the reader once all packets have been processed */
+#ifdef RX_TRACK_PACKETS
np->flags |= RX_PKTFLAG_RQ;
+#endif
queue_Prepend(&call->rq, np);
#ifdef RXDEBUG_PACKET
call->rqc++;
* packet before which to insert the new packet, or at the
* queue head if the queue is empty or the packet should be
* appended. */
+#ifdef RX_TRACK_PACKETS
np->flags |= RX_PKTFLAG_RQ;
+#endif
#ifdef RXDEBUG_PACKET
call->rqc++;
#endif /* RXDEBUG_PACKET */
#endif /* AFS_GLOBAL_RXLOCK_KERNEL */
{
queue_Remove(tp);
+#ifdef RX_TRACK_PACKETS
tp->flags &= ~RX_PKTFLAG_TQ;
+#endif
#ifdef RXDEBUG_PACKET
call->tqc--;
#endif /* RXDEBUG_PACKET */
/* why init the queue if you just emptied it? queue_Init(&call->rq); */
if (call->currentPacket) {
+#ifdef RX_TRACK_PACKETS
call->currentPacket->flags &= ~RX_PKTFLAG_CP;
call->currentPacket->flags |= RX_PKTFLAG_IOVQ;
+#endif
queue_Prepend(&call->iovq, call->currentPacket);
#ifdef RXDEBUG_PACKET
call->iovqc++;
*(call->callNumber)));
break;
}
+#ifdef RX_TRACK_PACKETS
if ((p->flags & RX_PKTFLAG_FREE)
|| (!queue_IsEnd(&call->tq, nxp)
&& (nxp->flags & RX_PKTFLAG_FREE))
|| (nxp == (struct rx_packet *)&rx_freePacketQueue)) {
osi_Panic("rxi_Start: xmit queue clobbered");
}
+#endif
if (p->flags & RX_PKTFLAG_ACKED) {
/* Since we may block, don't trust this */
usenow.sec = usenow.usec = 0;
if (p->header.seq < call->tfirst
&& (p->flags & RX_PKTFLAG_ACKED)) {
queue_Remove(p);
+#ifdef RX_TRACK_PACKETS
p->flags &= ~RX_PKTFLAG_TQ;
+#endif
#ifdef RXDEBUG_PACKET
call->tqc--;
#endif
afs_int32 error;
struct rx_connection *conn = call->conn;
queue_Remove(rp);
+#ifdef RX_TRACK_PACKETS
rp->flags &= ~RX_PKTFLAG_RQ;
+#endif
#ifdef RXDEBUG_PACKET
call->rqc--;
#endif /* RXDEBUG_PACKET */
}
call->rnext++;
cp = call->currentPacket = rp;
+#ifdef RX_TRACK_PACKETS
call->currentPacket->flags |= RX_PKTFLAG_CP;
+#endif
call->curvec = 1; /* 0th vec is always header */
/* begin at the beginning [ more or less ], continue
* on until the end, then stop. */
if (!call->nLeft) {
/* out of packet. Get another one. */
+#ifdef RX_TRACK_PACKETS
call->currentPacket->flags &= ~RX_PKTFLAG_CP;
+#endif
rxi_FreePacket(cp);
cp = call->currentPacket = (struct rx_packet *)0;
} else if (!call->curlen) {
if (++call->curvec >= cp->niovecs) {
/* current packet is exhausted, get ready for another */
/* don't worry about curvec and stuff, they get set somewhere else */
+#ifdef RX_TRACK_PACKETS
call->currentPacket->flags &= ~RX_PKTFLAG_CP;
+#endif
rxi_FreePacket(cp);
cp = call->currentPacket = (struct rx_packet *)0;
call->nLeft = 0;
afs_int32 error;
struct rx_connection *conn = call->conn;
queue_Remove(rp);
+#ifdef RX_TRACK_PACKETS
rp->flags &= ~RX_PKTFLAG_RQ;
+#endif
#ifdef RXDEBUG_PACKET
call->rqc--;
#endif /* RXDEBUG_PACKET */
}
call->rnext++;
curp = call->currentPacket = rp;
+#ifdef RX_TRACK_PACKETS
call->currentPacket->flags |= RX_PKTFLAG_CP;
+#endif
call->curvec = 1; /* 0th vec is always header */
cur_iov = &curp->wirevec[1];
/* begin at the beginning [ more or less ], continue
if (!call->nLeft) {
/* out of packet. Get another one. */
+#ifdef RX_TRACK_PACKETS
curp->flags &= ~RX_PKTFLAG_CP;
curp->flags |= RX_PKTFLAG_IOVQ;
+#endif
queue_Append(&call->iovq, curp);
#ifdef RXDEBUG_PACKET
call->iovqc++;
if (++call->curvec >= curp->niovecs) {
/* current packet is exhausted, get ready for another */
/* don't worry about curvec and stuff, they get set somewhere else */
+#ifdef RX_TRACK_PACKETS
curp->flags &= ~RX_PKTFLAG_CP;
curp->flags |= RX_PKTFLAG_IOVQ;
+#endif
queue_Append(&call->iovq, curp);
#ifdef RXDEBUG_PACKET
call->iovqc++;
&& (call->mode == RX_MODE_RECEIVING)) {
call->mode = RX_MODE_SENDING;
if (cp) {
+#ifdef RX_TRACK_PACKETS
cp->flags &= ~RX_PKTFLAG_CP;
+#endif
rxi_FreePacket(cp);
cp = call->currentPacket = (struct rx_packet *)0;
call->nLeft = 0;
* the packet we are planning on using
* cannot be freed.
*/
+#ifdef RX_TRACK_PACKETS
cp->flags &= ~RX_PKTFLAG_CP;
+#endif
call->currentPacket = (struct rx_packet *)0;
#ifdef AFS_GLOBAL_RXLOCK_KERNEL
/* Wait until TQ_BUSY is reset before adding any
* conn->securityMaxTrailerSize */
hadd32(call->bytesSent, cp->length);
rxi_PrepareSendPacket(call, cp, 0);
+#ifdef RX_TRACK_PACKETS
cp->flags |= RX_PKTFLAG_TQ;
+#endif
queue_Append(&call->tq, cp);
#ifdef RXDEBUG_PACKET
call->tqc++;
rxi_Start(0, call, 0, 0);
}
} else if (cp) {
+#ifdef RX_TRACK_PACKETS
cp->flags &= ~RX_PKTFLAG_CP;
+#endif
rxi_FreePacket(cp);
cp = call->currentPacket = (struct rx_packet *)0;
}
#endif /* RX_ENABLE_LOCKS */
}
if ((cp = rxi_AllocSendPacket(call, nbytes))) {
+#ifdef RX_TRACK_PACKETS
cp->flags |= RX_PKTFLAG_CP;
+#endif
call->currentPacket = cp;
call->nFree = cp->length;
call->curvec = 1; /* 0th vec is always header */
}
if (call->error) {
if (cp) {
+#ifdef RX_TRACK_PACKETS
cp->flags &= ~RX_PKTFLAG_CP;
+#endif
rxi_FreePacket(cp);
call->currentPacket = NULL;
}
&& (call->mode == RX_MODE_RECEIVING)) {
call->mode = RX_MODE_SENDING;
if (cp) {
+#ifdef RX_TRACK_PACKETS
cp->flags &= ~RX_PKTFLAG_CP;
+#endif
rxi_FreePacket(cp);
cp = call->currentPacket = (struct rx_packet *)0;
call->nLeft = 0;
*nio = nextio;
return requestCount - nbytes;
}
+#ifdef RX_TRACK_PACKETS
cp->flags |= RX_PKTFLAG_IOVQ;
+#endif
queue_Append(&call->iovq, cp);
#ifdef RXDEBUG_PACKET
call->iovqc++;
rxi_WritevProc(struct rx_call *call, struct iovec *iov, int nio, int nbytes)
{
struct rx_packet *cp = NULL;
+#ifdef RX_TRACK_PACKETS
struct rx_packet *p, *np;
+#endif
int nextio;
int requestCount;
struct rx_queue tmpq;
if (call->error) {
if (cp) {
+#ifdef RX_TRACK_PACKETS
cp->flags &= ~RX_PKTFLAG_CP;
cp->flags |= RX_PKTFLAG_IOVQ;
+#endif
queue_Prepend(&call->iovq, cp);
#ifdef RXDEBUG_PACKET
call->iovqc++;
}
cp = queue_First(&call->iovq, rx_packet);
queue_Remove(cp);
+#ifdef RX_TRACK_PACKETS
cp->flags &= ~RX_PKTFLAG_IOVQ;
+#endif
#ifdef RXDEBUG_PACKET
call->iovqc--;
#endif /* RXDEBUG_PACKET */
+#ifdef RX_TRACK_PACKETS
cp->flags |= RX_PKTFLAG_CP;
+#endif
call->currentPacket = cp;
call->nFree = cp->length;
call->curvec = 1;
|| iov[nextio].iov_len > (int)call->curlen) {
call->error = RX_PROTOCOL_ERROR;
if (cp) {
+#ifdef RX_TRACK_PACKETS
cp->flags &= ~RX_PKTFLAG_CP;
+#endif
queue_Prepend(&tmpq, cp);
#ifdef RXDEBUG_PACKET
tmpqc++;
/* Move the packets from the temporary queue onto the transmit queue.
* We may end up with more than call->twind packets on the queue. */
+#ifdef RX_TRACK_PACKETS
for (queue_Scan(&tmpq, p, np, rx_packet))
{
p->flags |= RX_PKTFLAG_TQ;
}
+#endif
queue_SpliceAppend(&call->tq, &tmpq);
if (!(call->flags & (RX_CALL_FAST_RECOVER | RX_CALL_FAST_RECOVER_WAIT))) {
if (call->error) {
if (cp) {
+#ifdef RX_TRACK_PACKETS
cp->flags &= ~RX_PKTFLAG_CP;
+#endif
rxi_FreePacket(cp);
cp = call->currentPacket = (struct rx_packet *)0;
}
/* cp->length is only supposed to be the user's data */
/* cp->length was already set to (then-current)
* MaxUserDataSize or less. */
+#ifdef RX_TRACK_PACKETS
cp->flags &= ~RX_PKTFLAG_CP;
+#endif
cp->length -= call->nFree;
call->currentPacket = (struct rx_packet *)0;
call->nFree = 0;
/* The 1 specifies that this is the last packet */
hadd32(call->bytesSent, cp->length);
rxi_PrepareSendPacket(call, cp, 1);
+#ifdef RX_TRACK_PACKETS
cp->flags |= RX_PKTFLAG_TQ;
+#endif
queue_Append(&call->tq, cp);
#ifdef RXDEBUG_PACKET
call->tqc++;