diff options
author | Jianfeng Tan <henry.tjf@antfin.com> | 2019-11-18 06:59:50 +0000 |
---|---|---|
committer | Jianfeng Tan <henry.tjf@antfin.com> | 2020-03-05 01:31:33 +0800 |
commit | 78c896b3b3127515478090c19447e27dc406427e (patch) | |
tree | d6d67d4683e9ca0409f9984a834547a572fb5310 /lib/libtle_l4p/tle_ctx.h | |
parent | e4380f4866091fd92a7a57667dd938a99144f9cd (diff) |
TLDKv2dev-next-socket
Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com>
Signed-off-by: Jielong Zhou <jielong.zjl@antfin.com>
Signed-off-by: Jian Zhang <wuzai.zj@antfin.com>
Signed-off-by: Chen Zhao <winters.zc@antfin.com>
Change-Id: I55c39de4c6cd30f991f35631eb507f770230f08e
Diffstat (limited to 'lib/libtle_l4p/tle_ctx.h')
-rw-r--r-- | lib/libtle_l4p/tle_ctx.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/libtle_l4p/tle_ctx.h b/lib/libtle_l4p/tle_ctx.h index de78a6b..f0efd51 100644 --- a/lib/libtle_l4p/tle_ctx.h +++ b/lib/libtle_l4p/tle_ctx.h @@ -54,6 +54,43 @@ extern "C" { struct tle_ctx; struct tle_dev; +typedef union tle_stream_options { + struct { + uint32_t reuseaddr: 1; + uint32_t reuseport: 1; + uint32_t keepalive: 1; + uint32_t ipv6only: 1; + uint32_t oobinline: 1; + uint32_t tcpcork: 1; + uint32_t tcpnodelay: 1; + uint32_t mulloop: 1; + uint32_t timestamp: 1; + uint32_t reserve: 3; + uint32_t tcpquickack: 4; + uint32_t multtl: 8; + uint32_t keepcnt: 8; + uint16_t keepidle; + uint16_t keepintvl; + }; + uint64_t raw; +} tle_stream_options_t; + +static inline void +tle_set_timestamp(struct msghdr *msg, struct rte_mbuf *m) +{ + struct timeval *tv; + struct cmsghdr *cmsg; + + cmsg = CMSG_FIRSTHDR(msg); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval)); + msg->msg_controllen = cmsg->cmsg_len; + tv = (struct timeval*)CMSG_DATA(cmsg); + tv->tv_sec = m->timestamp >> 20; + tv->tv_usec = m->timestamp & 0xFFFFFUL; +} + /** * Blocked L4 ports info. */ @@ -112,6 +149,8 @@ struct tle_ctx_param { int32_t socket_id; /**< socket ID to allocate memory for. */ uint32_t proto; /**< L4 proto to handle. */ uint32_t max_streams; /**< max number of streams in context. */ + uint32_t min_streams; /**< min number of streams at init. */ + uint32_t delta_streams; /**< delta of streams of each allocation. */ uint32_t max_stream_rbufs; /**< max recv mbufs per stream. */ uint32_t max_stream_sbufs; /**< max send mbufs per stream. */ uint32_t send_bulk_size; /**< expected # of packets per send call. */ @@ -145,6 +184,8 @@ struct tle_ctx_param { */ #define TLE_TCP_TIMEWAIT_DEFAULT UINT32_MAX +#define TLE_TCP_FINWAIT_TIMEOUT 60000 + /** * create L4 processing context. * @param ctx_prm |