aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libtle_l4p/tcp_stream.c12
-rw-r--r--lib/libtle_l4p/tle_tcp.h10
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/libtle_l4p/tcp_stream.c b/lib/libtle_l4p/tcp_stream.c
index af65967..99791d0 100644
--- a/lib/libtle_l4p/tcp_stream.c
+++ b/lib/libtle_l4p/tcp_stream.c
@@ -604,3 +604,15 @@ tle_tcp_stream_update_cfg(struct tle_stream *ts[],
return i;
}
+
+int
+tle_tcp_stream_get_mss(const struct tle_stream * stream)
+{
+ struct tle_tcp_stream *tcp;
+
+ if (stream == NULL)
+ return -EINVAL;
+
+ tcp = TCP_STREAM(stream);
+ return tcp->tcb.snd.mss;
+}
diff --git a/lib/libtle_l4p/tle_tcp.h b/lib/libtle_l4p/tle_tcp.h
index ec89746..9086658 100644
--- a/lib/libtle_l4p/tle_tcp.h
+++ b/lib/libtle_l4p/tle_tcp.h
@@ -362,6 +362,16 @@ 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