Richard Scheffenegger cb0dd7e122 tcp: reduce memory footprint when listing tcp hostcache
In tcp_hostcache_list, the sbuf used would need a large (~2MB)
blocking allocation of memory (M_WAITOK), when listing a
full hostcache. This may stall the requestor for an indeterminate
time.

A further optimization is to return the expected userspace
buffersize right away, rather than preparing the output of
each current entry of the hostcase, provided by: @tuexen.

This makes use of the ready-made functions of sbuf to work
with sysctl, and repeatedly drain the much smaller buffer.

PR: 254333
MFC after: 2 weeks
Reviewed By: #transport, tuexen
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29471
2021-03-28 23:50:23 +02:00
..
2020-12-25 11:33:17 +00:00
2020-11-29 13:41:49 +00:00
2021-02-25 10:13:52 +01:00
2020-11-22 20:21:10 +00:00
2021-02-25 10:13:52 +01:00
2021-02-16 20:00:46 +00:00
2019-12-06 16:35:48 +00:00
2019-10-07 22:40:05 +00:00
2020-10-07 15:22:48 +00:00
2020-09-24 12:26:06 +00:00
2021-01-24 00:07:41 +01:00
2020-09-24 12:26:06 +00:00
2021-01-31 23:46:53 +01:00
2020-09-24 12:26:06 +00:00
2021-01-24 00:07:41 +01:00
2021-02-18 22:36:01 -06:00
2021-02-18 22:36:01 -06:00
2021-03-26 00:01:34 +01:00