diff options
author | Cy Schubert <cy@FreeBSD.org> | 2020-06-24 00:20:45 +0000 |
---|---|---|
committer | Cy Schubert <cy@FreeBSD.org> | 2020-06-24 00:20:45 +0000 |
commit | 3914721463f70500ecc1f59312b122d8788465cf (patch) | |
tree | f253e72838d762e229ca71912a4a928e96cac2bd /include/recvbuff.h | |
parent | 5171bc9b11192d9ad273db7854787eaa65eb9997 (diff) |
Notes
Diffstat (limited to 'include/recvbuff.h')
-rw-r--r-- | include/recvbuff.h | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/include/recvbuff.h b/include/recvbuff.h index 42597153eea2..2a4c84c5afc3 100644 --- a/include/recvbuff.h +++ b/include/recvbuff.h @@ -10,10 +10,26 @@ /* * recvbuf memory management */ -#define RECV_INIT 10 /* 10 buffers initially */ +#define RECV_INIT 64 /* 64 buffers initially */ #define RECV_LOWAT 3 /* when we're down to three buffers get more */ -#define RECV_INC 5 /* get 5 more at a time */ -#define RECV_TOOMANY 40 /* this is way too many buffers */ +#define RECV_INC 32 /* [power of 2] get 32 more at a time */ +#define RECV_BATCH 128 /* [power of 2] max increment in one sweep */ +#define RECV_TOOMANY 4096 /* this should suffice, really. TODO: tos option? */ + +/* If we have clocks, keep an iron reserve of receive buffers for + * clocks only. + */ +#if defined(REFCLOCK) +# if !defined(RECV_CLOCK) || RECV_CLOCK == 0 +# undef RECV_CLOCK +# define RECV_CLOCK 16 +# endif +#else +# if defined(RECV_CLOCK) +# undef RECV_CLOCK +# endif +# define RECV_CLOCK 0 +#endif #if defined HAVE_IO_COMPLETION_PORT # include "ntp_iocompletionport.h" @@ -90,10 +106,10 @@ extern void freerecvbuf(struct recvbuf *); * you put it back with freerecvbuf() or */ -/* signal safe - no malloc */ -extern struct recvbuf *get_free_recv_buffer(void); -/* signal unsafe - may malloc, never returs NULL */ -extern struct recvbuf *get_free_recv_buffer_alloc(void); +/* signal safe - no malloc, returns NULL when no bufs */ +extern struct recvbuf *get_free_recv_buffer(int /*BOOL*/ urgent); +/* signal unsafe - may malloc, returns NULL when no bufs */ +extern struct recvbuf *get_free_recv_buffer_alloc(int /*BOOL*/ urgent); /* Add a buffer to the full list */ |