On Fri, Feb 02, 2024 at 03:11:36PM +0100, Laurent Vivier wrote: Even more than the previous patch, this doesn't really seem like "buffer management" to me. I'd say rather that this is extracting maximum mss calculation into a helper. > Signed-off-by: Laurent Vivier > --- > tcp.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/tcp.c b/tcp.c > index 20ad8a4e5271..cdbceed65033 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -1813,6 +1813,14 @@ int tcp_conn_new_sock(const struct ctx *c, sa_family_t af) > return s; > } > Function comment. > +static uint16_t tcp_buf_conn_tap_mss(const struct tcp_tap_conn *conn) > +{ > + if (CONN_V4(conn)) > + return MSS4; > + > + return MSS6; > +} > + > /** > * tcp_conn_tap_mss() - Get MSS value advertised by tap/guest > * @conn: Connection pointer > @@ -1832,10 +1840,7 @@ static uint16_t tcp_conn_tap_mss(const struct tcp_tap_conn *conn, > else > mss = ret; > > - if (CONN_V4(conn)) > - mss = MIN(MSS4, mss); > - else > - mss = MIN(MSS6, mss); > + mss = MIN(tcp_buf_conn_tap_mss(conn), mss); > > return MIN(mss, USHRT_MAX); > } -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson