Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
tcp_buffer_tuner: make tcp_sndbuf_expand optional
in some cases this static function is inlined; make it optional to
avoid failure to attach tuner as a whole.

Reported-by: sm99c (https://github.com/sm9cc)
Signed-off-by: Alan Maguire <[email protected]>
  • Loading branch information
alan-maguire committed Sep 11, 2023
commit 944bd688e378e4f5ab5a5f8ceee5a1029675178f
4 changes: 3 additions & 1 deletion src/tcp_buffer_tuner.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ long nr_free_buffer_pages(bool initial)

int init(struct bpftuner *tuner)
{
/* on some platforms, this function is inlined */
const char *optionals[] = { "tcp_sndbuf_expand", NULL };
int pagesize;
int err;

Expand All @@ -162,7 +164,7 @@ int init(struct bpftuner *tuner)
ilog2(SK_MEM_QUANTUM));
bpftuner_bpf_var_set(tcp_buffer, tuner, nr_free_buffer_pages,
nr_free_buffer_pages(true));
err = bpftuner_bpf_attach(tcp_buffer, tuner, NULL);
err = bpftuner_bpf_attach(tcp_buffer, tuner, optionals);
if (err)
return err;
return bpftuner_tunables_init(tuner, TCP_BUFFER_NUM_TUNABLES, descs,
Expand Down