summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-10-10 13:52:04 -0700
committerDave Barach <openvpp@barachs.net>2019-10-11 15:03:56 +0000
commitbbcfaac9571004d87998684c123354667b726532 (patch)
treea472215f21a2d108daca04b058d48792e6d6d5fb /src/vnet/tcp/tcp.h
parent3d36f19a0febaed532bd255a150504f7af8f18c2 (diff)
tcp: refactor flags into cfg and conn flags
Type: refactor Change-Id: Ib5e2ecf55732599e1322736e3662178c9da49c7d Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp.h')
-rw-r--r--src/vnet/tcp/tcp.h40
1 files changed, 33 insertions, 7 deletions
diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h
index 5e683f72dbd..097a1475185 100644
--- a/src/vnet/tcp/tcp.h
+++ b/src/vnet/tcp/tcp.h
@@ -103,6 +103,29 @@ extern timer_expiration_handler tcp_timer_retransmit_syn_handler;
#define TCP_RTO_BOFF_MAX 8 /* Max number of retries before reset */
#define TCP_ESTABLISH_TIME (60 * THZ) /* Connection establish timeout */
+/** Connection configuration flags */
+#define foreach_tcp_cfg_flag \
+ _(RATE_SAMPLE, "Rate sampling") \
+ _(NO_CSUM_OFFLOAD, "No csum offload") \
+ _(NO_TSO, "TSO off") \
+ _(TSO, "TSO") \
+
+typedef enum tcp_cfg_flag_bits_
+{
+#define _(sym, str) TCP_CFG_F_##sym##_BIT,
+ foreach_tcp_cfg_flag
+#undef _
+ TCP_CFG_N_FLAG_BITS
+} tcp_cfg_flag_bits_e;
+
+typedef enum tcp_cfg_flag_
+{
+#define _(sym, str) TCP_CFG_F_##sym = 1 << TCP_CFG_F_##sym##_BIT,
+ foreach_tcp_cfg_flag
+#undef _
+ TCP_CFG_N_FLAGS
+} tcp_cfg_flags_e;
+
/** TCP connection flags */
#define foreach_tcp_connection_flag \
_(SNDACK, "Send ACK") \
@@ -113,16 +136,14 @@ extern timer_expiration_handler tcp_timer_retransmit_syn_handler;
_(HALF_OPEN_DONE, "Half-open completed") \
_(FINPNDG, "FIN pending") \
_(RXT_PENDING, "Retransmit pending") \
- _(FRXT_FIRST, "Fast-retransmit first again") \
- _(DEQ_PENDING, "Pending dequeue acked") \
+ _(FRXT_FIRST, "Retransmit first") \
+ _(DEQ_PENDING, "Dequeue pending ") \
_(PSH_PENDING, "PSH pending") \
_(FINRCVD, "FIN received") \
- _(RATE_SAMPLE, "Conn does rate sampling") \
_(TRACK_BURST, "Track burst") \
_(ZERO_RWND_SENT, "Zero RWND sent") \
- _(NO_CSUM_OFFLOAD, "No Checksum Offload") \
-typedef enum _tcp_connection_flag_bits
+typedef enum tcp_connection_flag_bits_
{
#define _(sym, str) TCP_CONN_##sym##_BIT,
foreach_tcp_connection_flag
@@ -130,7 +151,7 @@ typedef enum _tcp_connection_flag_bits
TCP_CONN_N_FLAG_BITS
} tcp_connection_flag_bits_e;
-typedef enum _tcp_connection_flag
+typedef enum tcp_connection_flag_
{
#define _(sym, str) TCP_CONN_##sym = 1 << TCP_CONN_##sym##_BIT,
foreach_tcp_connection_flag
@@ -310,7 +331,7 @@ typedef struct _tcp_connection
transport_connection_t connection; /**< Common transport data. First! */
u8 state; /**< TCP state as per tcp_state_t */
- u8 is_tso; /** is connection could use tso */
+ u8 cfg_flags; /**< Connection configuration flags */
u16 flags; /**< Connection flags (see tcp_conn_flags_e) */
u32 timers[TCP_N_TIMERS]; /**< Timer handles into timer wheel */
@@ -451,6 +472,8 @@ struct _tcp_cc_algorithm
#define tcp_in_cong_recovery(tc) ((tc)->flags & \
(TCP_CONN_FAST_RECOVERY | TCP_CONN_RECOVERY))
+#define tcp_csum_offload(tc) (!((tc)->cfg_flags & TCP_CFG_F_NO_CSUM_OFFLOAD))
+
always_inline void
tcp_cong_recovery_off (tcp_connection_t * tc)
{
@@ -534,6 +557,9 @@ typedef struct tcp_configuration_
/** Enable tx pacing for new connections */
u8 enable_tx_pacing;
+ /** Allow use of TSO whenever available */
+ u8 allow_tso;
+
/** Default congestion control algorithm type */
tcp_cc_algorithm_type_e cc_algo;