tcp: reorganize connection members 96/32096/5
authorFlorin Coras <fcoras@cisco.com>
Thu, 22 Apr 2021 23:58:23 +0000 (16:58 -0700)
committerDave Barach <openvpp@barachs.net>
Fri, 23 Apr 2021 15:00:50 +0000 (15:00 +0000)
Optimize connection size and move timestamp_delta closer to other
timestamp related members.

Type: refactor

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iec42efb46482ebfdf234518a4e91af836e4f4c07

src/vnet/tcp/tcp_packet.h
src/vnet/tcp/tcp_types.h

index f9c6db4..b0636d8 100644 (file)
@@ -142,12 +142,12 @@ typedef struct _sack_block
 
 typedef struct
 {
-  u8 flags;            /** Option flags, see above */
-  u8 wscale;           /**< Window scale advertised */
-  u16 mss;             /**< Maximum segment size advertised */
+  sack_block_t *sacks; /**< SACK blocks */
   u32 tsval;           /**< Timestamp value */
   u32 tsecr;           /**< Echoed/reflected time stamp */
-  sack_block_t *sacks; /**< SACK blocks */
+  u16 mss;             /**< Maximum segment size advertised */
+  u8 flags;            /**< Option flags, see above */
+  u8 wscale;           /**< Window scale advertised */
   u8 n_sack_blocks;    /**< Number of SACKs blocks */
 } tcp_options_t;
 
index 2575156..aacfd8f 100644 (file)
@@ -307,20 +307,19 @@ typedef struct _tcp_connection
   u32 rcv_wnd;         /**< receive window we expect */
 
   u32 rcv_las;         /**< rcv_nxt at last ack sent/rcv_wnd update */
-  u32 iss;             /**< initial sent sequence */
-  u32 irs;             /**< initial remote sequence */
 
   /* Options */
   u8 snd_opts_len;             /**< Tx options len */
+  u8 snd_sack_pos;             /**< Position in vec of first block to send */
   u8 rcv_wscale;               /**< Window scale to advertise to peer */
   u8 snd_wscale;               /**< Window scale to use when sending */
   u32 tsval_recent;            /**< Last timestamp received */
   u32 tsval_recent_age;                /**< When last updated tstamp_recent*/
+  u32 timestamp_delta;         /**< Offset for timestamp */
   tcp_options_t snd_opts;      /**< Tx options for connection */
   tcp_options_t rcv_opts;      /**< Rx options for connection */
 
   sack_block_t *snd_sacks;     /**< Vector of SACKs to send. XXX Fixed size? */
-  u8 snd_sack_pos;             /**< Position in vec of first block to send */
   sack_block_t *snd_sacks_fl;  /**< Vector for building new list */
   sack_scoreboard_t sack_sb;   /**< SACK "scoreboard" that tracks holes */
 
@@ -380,10 +379,11 @@ typedef struct _tcp_connection
 
   tcp_errors_t errors; /**< Soft connection errors */
 
+  u32 iss;             /**< initial sent sequence */
+  u32 irs;             /**< initial remote sequence */
   f64 start_ts;                /**< Timestamp when connection initialized */
   u32 last_fib_check;  /**< Last time we checked fib route for peer */
   u16 mss;             /**< Our max seg size that includes options */
-  u32 timestamp_delta; /**< Offset for timestamp */
   u32 ipv6_flow_label; /**< flow label for ipv6 header */
 
 #define rst_state snd_wl1