/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#define rx_PutConnection(conn) rx_DestroyConnection(conn)
-/* A connection is an authenticated communication path, allowing
+/* A connection is an authenticated communication path, allowing
limited multiple asynchronous conversations. */
#ifdef KDUMP_RX_LOCK
struct rx_connection_rx_lock {
/* 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 */
+ afs_uint32 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 */
/* For garbage collection */
afs_uint32 idleWhen; /* When the refcountwent to zero */
- afs_uint32 refCount; /* Reference count for this structure */
+ afs_uint32 refCount; /* Reference count for this structure (rx_peerHashTable_lock) */
/* Congestion control parameters */
u_char burstSize; /* Reinitialization size for the burst parameter */
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 */
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
* The following fields are accessed while the call is unlocked.
* These fields are used by the caller/server thread to marshall
* and unmarshall RPC data. The only time they may be changed by
- * other threads is when the RX_CALL_IOVEC_WAIT flag is set.
- *
+ * other threads is when the RX_CALL_IOVEC_WAIT flag is set.
+ *
* NOTE: Be sure that these fields start and end on a double
* word boundary. Otherwise threads that are changing
* adjacent fields will cause problems.
u_short MTU; /* size of packets currently sending */
#ifdef RX_ENABLE_LOCKS
short refCount; /* Used to keep calls from disappearring
- * when we get them from a queue. */
-#endif /* RX_ENABLE_LOCKS */
+ * when we get them from a queue. (rx_refcnt_lock) */
+#endif /* RX_ENABLE_LOCKS */
/* Call refcount modifiers */
#define RX_CALL_REFCOUNT_BEGIN 0 /* GetCall/NewCall/EndCall */
#define RX_CALL_REFCOUNT_RESEND 1 /* resend event */
short refCDebug[RX_CALL_REFCOUNT_MAX];
#endif /* RX_REFCOUNT_CHECK */
- /*
+ /*
* iov, iovNBytes, iovMax, and iovNext are set in rxi_ReadvProc()
* and adjusted by rxi_FillReadVec(). iov does not own the buffers
* it refers to. The buffers belong to the packets stored in iovq.
afs_hyper_t bytesRcvd; /* Number bytes received */
u_short tqWaiters;
+#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_ACK_PING 6 /* This is a keep-alive ack */
#define RX_ACK_PING_RESPONSE 7 /* Ack'ing because we were pinged */
#define RX_ACK_DELAY 8 /* Ack generated since nothing has happened since receiving packet */
-#define RX_ACK_IDLE 9 /* Similar to RX_ACK_DELAY, but can
+#define RX_ACK_IDLE 9 /* Similar to RX_ACK_DELAY, but can
* be used to compute RTT */
#define RX_ACK_MTU -1 /* will be rewritten to ACK_PING */
/* Configuration settings */
-/* Enum for storing configuration variables which can be set via the
+/* Enum for storing configuration variables which can be set via the
* SetConfiguration method in the rx_securityClass, below
*/
#ifdef AFS_NT40_ENV
extern int rx_DumpCalls(FILE *outputFile, char *cookie);
-
-#define rx_MutexIncrement(object, mutex) InterlockedIncrement(&object)
-#define rx_MutexAdd(object, addend, mutex) InterlockedExchangeAdd(&object, addend)
-#define rx_MutexDecrement(object, mutex) InterlockedDecrement(&object)
-#define rx_MutexAdd1Increment2(object1, addend, object2, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object1 += addend; \
- InterlockedIncrement(&object2); \
- MUTEX_EXIT(&mutex); \
- } while (0)
-#define rx_MutexAdd1Decrement2(object1, addend, object2, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object1 += addend; \
- InterlockedDecrement(&object2); \
- MUTEX_EXIT(&mutex); \
- } while (0)
-#else
-#define rx_MutexIncrement(object, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object++; \
- MUTEX_EXIT(&mutex); \
- } while(0)
-#define rx_MutexAdd(object, addend, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object += addend; \
- MUTEX_EXIT(&mutex); \
- } while(0)
-#define rx_MutexAdd1Increment2(object1, addend, object2, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object1 += addend; \
- object2++; \
- MUTEX_EXIT(&mutex); \
- } while(0)
-#define rx_MutexAdd1Decrement2(object1, addend, object2, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object1 += addend; \
- object2--; \
- MUTEX_EXIT(&mutex); \
- } while(0)
-#define rx_MutexDecrement(object, mutex) \
- do { \
- MUTEX_ENTER(&mutex); \
- object--; \
- MUTEX_EXIT(&mutex); \
- } while(0)
-#endif
+#endif
#endif /* _RX_ End of rx.h */