#ifdef KERNEL
#include "rx_kmutex.h"
#include "rx_kernel.h"
-#include "rx_clock.h"
-#include "rx_event.h"
-#include "rx_queue.h"
-#include "rx_packet.h"
-#include "rx_misc.h"
-#include "rx_multi.h"
#if defined (AFS_OBSD_ENV) && !defined (MLEN)
#include "sys/mbuf.h"
#endif
#include <ws2tcpip.h>
#endif
# include "rx_user.h"
-# include "rx_clock.h"
-# include "rx_event.h"
-# include "rx_packet.h"
-# include "rx_misc.h"
-# include "rx_null.h"
-# include "rx_multi.h"
#ifndef AFS_NT40_ENV
# include <netinet/in.h>
# include <sys/socket.h>
#endif
#endif /* KERNEL */
+#include "rx_clock.h"
+#include "rx_event.h"
+#include "rx_packet.h"
+#include "rx_misc.h"
+#include "rx_null.h"
+#include "rx_multi.h"
/* Configurable parameters */
#define RX_IDLE_DEAD_TIME 60 /* default idle dead time */
/* This parameter should not normally be changed */
#define RX_PROCESS_PRIORITY LWP_NORMAL_PRIORITY
-/* backoff is fixed point binary. Ie, units of 1/4 seconds */
-#define MAXBACKOFF 0x1F
-
#define ADDRSPERSITE 16
#ifndef KDUMP_RX_LOCK
#define rx_SetBeforeProc(service,proc) ((service)->beforeProc = (proc))
#define rx_GetAfterProc(service) ((service)->afterProc)
#define rx_GetBeforeProc(service) ((service)->beforeProc)
+#define rx_SetPostProc(service,proc) ((service)->postProc = (proc))
+#define rx_GetPostProc(service) ((service)->postProc)
/* Define a procedure to be called when a server connection is created */
#define rx_SetNewConnProc(service, proc) ((service)->newConnProc = (proc))
afs_uint32 callNumber[RX_MAXCALLS]; /* Current call numbers */
afs_uint32 rwind[RX_MAXCALLS];
u_short twind[RX_MAXCALLS];
+ afs_uint32 lastBusy[RX_MAXCALLS]; /* timestamp of the last time we got an
+ * RX_PACKET_TYPE_BUSY packet for this
+ * call slot, or 0 if the slot is not busy */
afs_uint32 serial; /* Next outgoing packet serial number */
afs_uint32 lastSerial; /* # of last packet received, for computing skew */
- afs_int32 maxSerial; /* largest serial number seen on incoming packets */
afs_int32 lastPacketSize; /* last >max attempt */
afs_int32 lastPacketSizeSeq; /* seq number of attempt */
afs_int32 lastPingSize; /* last MTU ping attempt */
/* client-- to retransmit the challenge */
struct rx_service *service; /* used by servers only */
u_short serviceId; /* To stamp on requests (clients only) */
- afs_uint32 refCount; /* Reference count (rx_refcnt_mutex) */
+ afs_int32 refCount; /* Reference count (rx_refcnt_mutex) */
u_char flags; /* Defined below - (conn_data_lock) */
u_char type; /* Type of connection, defined below */
u_char secondsUntilPing; /* how often to ping for each active call */
void (*newConnProc) (struct rx_connection * tcon); /* Routine to call when a server connection is created */
void (*beforeProc) (struct rx_call * acall); /* routine to call before a call is executed */
void (*afterProc) (struct rx_call * acall, afs_int32 code); /* routine to call after a call is executed */
+ void (*postProc) (afs_int32 code); /* routine to call after the call has ended */
u_short maxProcs; /* Maximum procs to be used for this service */
u_short minProcs; /* Minimum # of requests guaranteed executable simultaneously */
u_short connDeadTime; /* Seconds until a client of this service will be declared dead, if it is not responding */
/* For garbage collection */
afs_uint32 idleWhen; /* When the refcountwent to zero */
- afs_uint32 refCount; /* Reference count for this structure (rx_peerHashTable_lock) */
+ afs_int32 refCount; /* Reference count for this structure (rx_peerHashTable_lock) */
/* Congestion control parameters */
u_char burstSize; /* Reinitialization size for the burst parameter */
struct rx_queue congestionQueue; /* Calls that are waiting for non-zero burst value */
int rtt; /* Smoothed round trip time, measured in milliseconds/8 */
int rtt_dev; /* Smoothed rtt mean difference, in milliseconds/4 */
- struct clock timeout; /* Current retransmission delay */
- int backedOff; /* Has the timeout been backed off due to a missing packet? */
int nSent; /* Total number of distinct data packets sent, not including retransmissions */
int reSends; /* Total number of retransmissions for this peer, since this structure was created */
* is likely to have been dropped. */
afs_uint32 inPacketSkew; /* Maximum skew on incoming packets */
afs_uint32 outPacketSkew; /* Peer-reported max skew on our sent packets */
- int rateFlag; /* Flag for rate testing (-no 0yes +decrement) */
/* the "natural" MTU, excluding IP,UDP headers, is negotiated by the endpoints */
u_short natMTU;
struct rx_queue rpcStats; /* rpc statistic list */
int lastReachTime; /* Last time we verified reachability */
afs_int32 maxPacketSize; /* peer packetsize hint */
-
-#ifdef ADAPT_WINDOW
- afs_int32 smRtt;
- afs_int32 countDown;
-#endif
};
#ifndef KDUMP_RX_LOCK
#define RX_CONN_BUSY 32 /* connection is busy; don't delete */
#define RX_CONN_ATTACHWAIT 64 /* attach waiting for peer->lastReach */
#define RX_CONN_MAKECALL_ACTIVE 128 /* a thread is actively in rx_NewCall */
+#define RX_CONN_NAT_PING 256 /* nat ping requested */
/* Type of connection, client or server */
#define RX_CLIENT_CONNECTION 0
u_short nSoftAcks; /* The number of delayed soft acks */
u_short nHardAcks; /* The number of delayed hard acks */
u_short congestSeq; /* Peer's congestion sequence counter */
+ int rtt;
+ int rtt_dev;
+ struct clock rto; /* The round trip timeout calculated for this call */
struct rxevent *resendEvent; /* If this is non-Null, there is a retransmission event pending */
struct rxevent *timeoutEvent; /* If this is non-Null, then there is an overall timeout for this call */
struct rxevent *keepAliveEvent; /* Scheduled periodically in active calls to keep call alive */
struct rxevent *growMTUEvent; /* Scheduled periodically in active calls to discover true maximum MTU */
struct rxevent *delayedAckEvent; /* Scheduled after all packets are received to send an ack if a reply or new call is not generated soon */
+ struct clock delayedAckTime; /* Time that next delayed ack was scheduled for */
struct rxevent *delayedAbortEvent; /* Scheduled to throttle looping client */
int abortCode; /* error code from last RPC */
int abortCount; /* number of times last error was sent */
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
#ifdef RXDEBUG_PACKET
u_short tqc; /* packet count in tq */
u_short rqc; /* packet count in rq */
#define RX_CALL_TQ_SOME_ACKED 512 /* rxi_Start needs to discard ack'd packets. */
#define RX_CALL_TQ_WAIT 1024 /* Reader is waiting for TQ_BUSY to be reset */
#define RX_CALL_FAST_RECOVER 2048 /* call is doing congestion recovery */
-#define RX_CALL_FAST_RECOVER_WAIT 4096 /* thread is waiting to start recovery */
+/* 4096 was RX_CALL_FAST_RECOVER_WAIT */
#define RX_CALL_SLOW_START_OK 8192 /* receiver acks every other packet */
#define RX_CALL_IOVEC_WAIT 16384 /* waiting thread is using an iovec */
#define RX_CALL_HAVE_LAST 32768 /* Last packet has been received */
#define RX_CALL_NEED_START 0x10000 /* tells rxi_Start to start again */
+#define RX_CALL_PEER_BUSY 0x20000 /* the last packet we received on this call was a
+ * BUSY packet; i.e. the channel for this call is busy */
+#define RX_CALL_ACKALL_SENT 0x40000 /* ACKALL has been sent on the call */
/* The structure of the data portion of an acknowledge packet: An acknowledge