diff options
author | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2017-07-27 12:00:57 +0100 |
---|---|---|
committer | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2017-07-27 20:24:53 +0100 |
commit | 7e18fa1bf263822c46d7431a911b41d6377d5f69 (patch) | |
tree | ddf5ce05545419d6d77bb9d8b3c48fc90d221a7a /lib/libtle_l4p/tle_tcp.h | |
parent | e151ee29d02d7802fab9e32b50ced54fd8d64160 (diff) |
- Introduce tle_tcp_stream_readv() and tle_tcp_stream_writev().
- Introduce flags for tle_ctx_param.
- Introduce TLE_CTX_FLAG_ST - indicates that given ctx will be used
by single thread only.
- Introduce new parameters for tcp context:
timewait - allows user to configure max timeout in TCP_TIMEWAIT state.
icw - allows user to specify desired initial congestion window
for new connections.
-Few optimisations:
cache tx.ol_flags inside tle destination.
calcualte and cache inside ctx cycles_to_ms shift value.
reorder restoring SYN opts and filling TCB a bit.
Change-Id: Ie05087783b3b7f1e4ce99d3555bc5bd098f83fe0
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Diffstat (limited to 'lib/libtle_l4p/tle_tcp.h')
-rw-r--r-- | lib/libtle_l4p/tle_tcp.h | 72 |
1 files changed, 60 insertions, 12 deletions
diff --git a/lib/libtle_l4p/tle_tcp.h b/lib/libtle_l4p/tle_tcp.h index 9086658..b0cbda6 100644 --- a/lib/libtle_l4p/tle_tcp.h +++ b/lib/libtle_l4p/tle_tcp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Intel Corporation. + * Copyright (c) 2016-2017 Intel Corporation. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -120,6 +120,16 @@ tle_tcp_stream_get_addr(const struct tle_stream *s, struct tle_tcp_stream_addr *addr); /** + * Get current TCP maximum segment size + * @param ts + * Stream to retrieve MSS information from. + * @return + * Maximum segment size in bytes, if successful. + * Negative on failure. + */ +int tle_tcp_stream_get_mss(const struct tle_stream *ts); + +/** * Client mode connect API. */ @@ -258,6 +268,28 @@ uint16_t tle_tcp_stream_recv(struct tle_stream *s, struct rte_mbuf *pkt[], uint16_t num); /** + * Reads iovcnt buffers from the for given TCP stream. + * Note that the stream has to be in connected state. + * Data ordering is preserved. + * Buffers are processed in array order. + * This means that the function will comppletely fill iov[0] + * before proceeding to iov[1], and so on. + * If there is insufficient data, then not all buffers pointed to by iov + * may be filled. + * @param ts + * TCP stream to receive data from. + * @param iov + * Points to an array of iovec structures. + * @param iovcnt + * Number of elements in the *iov* array. + * @return + * On success, number of bytes read in the stream receive buffer. + * In case of error, returns -1 and error code will be set in rte_errno. + */ +ssize_t tle_tcp_stream_readv(struct tle_stream *ts, const struct iovec *iov, + int iovcnt); + +/** * Consume and queue up to *num* packets, that will be sent eventually * by tle_tcp_tx_bulk(). * Note that the stream has to be in connected state. @@ -281,7 +313,7 @@ uint16_t tle_tcp_stream_recv(struct tle_stream *s, struct rte_mbuf *pkt[], * number of packets successfully queued in the stream send buffer. * In case of error, error code can be set in rte_errno. * Possible rte_errno errors include: - * - EAGAIN - operation can be perfomed right now + * - EAGAIN - operation can't be perfomed right now * (most likely close() was perfomed on that stream allready). * - ENOTCONN - the stream is not connected. */ @@ -289,6 +321,32 @@ uint16_t tle_tcp_stream_send(struct tle_stream *s, struct rte_mbuf *pkt[], uint16_t num); /** + * Writes iovcnt buffers of data described by iov to the for given TCP stream. + * Note that the stream has to be in connected state. + * Data ordering is preserved. + * Buffers are processed in array order. + * This means that the function will write out the entire contents of iov[0] + * before proceeding to iov[1], and so on. + * If there is insufficient space in stream send buffer, + * then not all buffers pointed to by iov may be written out. + * @param ts + * TCP stream to send data to. + * @param iov + * Points to an array of iovec structures. + * @param iovcnt + * Number of elements in the *iov* array. + * @return + * On success, number of bytes written to the stream send buffer. + * In case of error, returns -1 and error code will be set in rte_errno. + * - EAGAIN - operation can't be perfomed right now + * (most likely close() was perfomed on that stream allready). + * - ENOTCONN - the stream is not connected. + * - ENOMEM - not enough internal buffer (mbuf) to store user provided data. + */ +ssize_t tle_tcp_stream_writev(struct tle_stream *ts, struct rte_mempool *mp, + const struct iovec *iov, int iovcnt); + +/** * Back End (BE) API. * BE API functions are not multi-thread safe. * Supposed to be called by the L2/L3 processing layer. @@ -362,16 +420,6 @@ uint16_t tle_tcp_tx_bulk(struct tle_dev *dev, struct rte_mbuf *pkt[], */ int tle_tcp_process(struct tle_ctx *ctx, uint32_t num); -/** - * Get current TCP maximum segment size - * @param stream - * Stream to get MSS from. - * @return - * Maximum segment size in bytes, if successful. - * Negative on failure. - */ -int tle_tcp_stream_get_mss(const struct tle_stream * const stream); - #ifdef __cplusplus } #endif |