]> Pileus Git - ~andy/linux/blobdiff - include/net/sctp/structs.h
sctp: Save some room in the sctp_transport by using bitfields
[~andy/linux] / include / net / sctp / structs.h
index 0a474568b003053686f98e27d4102d34148a8ade..9072dd67d8adc6b6cbad827b934bb89afd10f07a 100644 (file)
@@ -231,6 +231,11 @@ extern struct sctp_globals {
        /* Flag to indicate whether computing and verifying checksum
         * is disabled. */
         int checksum_disable;
+
+       /* Threshold for rwnd update SACKS.  Receive buffer shifted this many
+        * bits is an indicator of when to send and window update SACK.
+        */
+       int rwnd_update_shift;
 } sctp_globals;
 
 #define sctp_rto_initial               (sctp_globals.rto_initial)
@@ -267,6 +272,7 @@ extern struct sctp_globals {
 #define sctp_prsctp_enable             (sctp_globals.prsctp_enable)
 #define sctp_auth_enable               (sctp_globals.auth_enable)
 #define sctp_checksum_disable          (sctp_globals.checksum_disable)
+#define sctp_rwnd_upd_shift            (sctp_globals.rwnd_update_shift)
 
 /* SCTP Socket type: UDP or TCP style. */
 typedef enum {
@@ -751,7 +757,6 @@ struct sctp_chunk {
 #define SCTP_NEED_FRTX 0x1
 #define SCTP_DONT_FRTX 0x2
        __u16   rtt_in_progress:1,      /* This chunk used for RTT calc? */
-               resent:1,               /* Has this chunk ever been resent. */
                has_tsn:1,              /* Does this chunk have a TSN yet? */
                has_ssn:1,              /* Does this chunk have a SSN yet? */
                singleton:1,            /* Only chunk in the packet? */
@@ -872,7 +877,33 @@ struct sctp_transport {
 
        /* Reference counting. */
        atomic_t refcnt;
-       int      dead;
+       int      dead:1,
+               /* RTO-Pending : A flag used to track if one of the DATA
+                *              chunks sent to this address is currently being
+                *              used to compute a RTT. If this flag is 0,
+                *              the next DATA chunk sent to this destination
+                *              should be used to compute a RTT and this flag
+                *              should be set. Every time the RTT
+                *              calculation completes (i.e. the DATA chunk
+                *              is SACK'd) clear this flag.
+                */
+                rto_pending:1,
+
+               /*
+                * hb_sent : a flag that signals that we have a pending
+                * heartbeat.
+                */
+               hb_sent:1,
+
+               /* Flag to track the current fast recovery state */
+               fast_recovery:1,
+
+               /* Is the Path MTU update pending on this tranport */
+               pmtu_pending:1,
+
+               /* Is this structure kfree()able? */
+               malloced:1;
+
 
        /* This is the peer's IP address and port. */
        union sctp_addr ipaddr;
@@ -902,22 +933,6 @@ struct sctp_transport {
        /* SRTT        : The current smoothed round trip time.  */
        __u32 srtt;
 
-       /* RTO-Pending : A flag used to track if one of the DATA
-        *              chunks sent to this address is currently being
-        *              used to compute a RTT. If this flag is 0,
-        *              the next DATA chunk sent to this destination
-        *              should be used to compute a RTT and this flag
-        *              should be set. Every time the RTT
-        *              calculation completes (i.e. the DATA chunk
-        *              is SACK'd) clear this flag.
-        * hb_sent : a flag that signals that we have a pending heartbeat.
-        */
-       __u8 rto_pending;
-       __u8 hb_sent;
-
-       /* Flag to track the current fast recovery state */
-       __u8 fast_recovery;
-
        /*
         * These are the congestion stats.
         */
@@ -935,6 +950,8 @@ struct sctp_transport {
        /* Data that has been sent, but not acknowledged. */
        __u32 flight_size;
 
+       __u32 burst_limited;    /* Holds old cwnd when max.burst is applied */
+
        /* TSN marking the fast recovery exit point */
        __u32 fast_recovery_exit;
 
@@ -943,12 +960,6 @@ struct sctp_transport {
        /* Source address. */
        union sctp_addr saddr;
 
-       /* When was the last time(in jiffies) that a data packet was sent on
-        * this transport?  This is used to adjust the cwnd when the transport
-        * becomes inactive.
-        */
-       unsigned long last_time_used;
-
        /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to
         * the destination address every heartbeat interval.
         */
@@ -974,9 +985,6 @@ struct sctp_transport {
         */
        __u16 pathmaxrxt;
 
-       /* is the Path MTU update pending on this tranport */
-       __u8 pmtu_pending;
-
        /* PMTU       : The current known path MTU.  */
        __u32 pathmtu;
 
@@ -987,7 +995,7 @@ struct sctp_transport {
        int init_sent_count;
 
        /* state       : The current state of this destination,
-        *             : i.e. SCTP_ACTIVE, SCTP_INACTIVE, SCTP_UNKOWN.
+        *             : i.e. SCTP_ACTIVE, SCTP_INACTIVE, SCTP_UNKNOWN.
         */
        int state;
 
@@ -1020,8 +1028,6 @@ struct sctp_transport {
        /* This is the list of transports that have chunks to send.  */
        struct list_head send_ready;
 
-       int malloced; /* Is this structure kfree()able? */
-
        /* State information saved for SFR_CACC algorithm. The key
         * idea in SFR_CACC is to maintain state at the sender on a
         * per-destination basis when a changeover happens.
@@ -1063,12 +1069,14 @@ void sctp_transport_route(struct sctp_transport *, union sctp_addr *,
                          struct sctp_sock *);
 void sctp_transport_pmtu(struct sctp_transport *);
 void sctp_transport_free(struct sctp_transport *);
-void sctp_transport_reset_timers(struct sctp_transport *, int);
+void sctp_transport_reset_timers(struct sctp_transport *);
 void sctp_transport_hold(struct sctp_transport *);
 void sctp_transport_put(struct sctp_transport *);
 void sctp_transport_update_rto(struct sctp_transport *, __u32);
 void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32);
 void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t);
+void sctp_transport_burst_limited(struct sctp_transport *);
+void sctp_transport_burst_reset(struct sctp_transport *);
 unsigned long sctp_transport_timeout(struct sctp_transport *);
 void sctp_transport_reset(struct sctp_transport *);
 void sctp_transport_update_pmtu(struct sctp_transport *, u32);