Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ The key components are

## Supported tuners

- congestion tuner: auto-tune choice of congestion control algorithm.
See bpftune-tcp-cong (8).
- TCP connection tuner: auto-tune choice of congestion control algorithm.
See bpftune-tcp-conn (8).
- neighbour table tuner: auto-tune neighbour table sizes by growing
tables when approaching full. See bpftune-neigh (8).
- route table tuner: auto-tune route table size by growing tables
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ installprefix = $(DESTDIR)/$(prefix)
mandir ?= $(prefix)/man
man8dir = $(mandir)/man8

MAN8_RST = bpftune.rst bpftune-sysctl.rst bpftune-tcp-cong.rst \
MAN8_RST = bpftune.rst bpftune-sysctl.rst bpftune-tcp-conn.rst \
bpftune-neigh.rst bpftune-tcp-buffer.rst bpftune-netns.rst \
bpftune-net-buffer.rst

Expand Down
8 changes: 4 additions & 4 deletions docs/bpftune-tcp-cong.rst → docs/bpftune-tcp-conn.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
================
BPFTUNE-TCP-CONG
================
-------------------------------------------------------------------------------
Congestion bpftune plugin for auto-selection of congestion control algorithm
-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
TCP connection bpftune plugin for auto-selection of congestion control algorithm
--------------------------------------------------------------------------------

:Manual section: 8


DESCRIPTION
===========
The congestion algorithm tuner sets congestion control algorithm on
The TCP connection algorithm tuner sets congestion control algorithm on
TCP sockets. Linux uses cubic by default, and it works well in a wide
range of settings, however it can under-perform in lossy networks.

Expand Down
2 changes: 1 addition & 1 deletion include/bpftune/bpftune.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ struct bpftuner_strategy {
const char *name;
const char *description;
/* return a number to compare with other strategies */
int (*evaluate)(struct bpftuner *tuner, struct bpftuner_strategy *strategy);
long double (*evaluate)(struct bpftuner *tuner, struct bpftuner_strategy *strategy);
unsigned long timeout; /* time in seconds until evaluation */
const char **bpf_progs; /* programs to load in BPF skeleton for this
* strategy; if NULL, all */
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ submake_extras := feature_display=0
endif

TUNERS = tcp_buffer_tuner route_table_tuner neigh_table_tuner sysctl_tuner \
tcp_cong_tuner netns_tuner net_buffer_tuner
tcp_conn_tuner netns_tuner net_buffer_tuner

TUNER_OBJS = $(patsubst %,%.o,$(TUNERS))
TUNER_SRCS = $(patsubst %,%.c,$(TUNERS))
Expand Down
2 changes: 1 addition & 1 deletion src/libbpftune.c
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ int bpftune_module_unload(const char *name)
static void bpftuner_strategy_update(struct bpftuner *tuner)
{
struct bpftuner_strategy *strategy, *max_strategy = NULL;
int curr, max = 0;
long double curr, max = 0;

if (!tuner->strategies)
return;
Expand Down
2 changes: 1 addition & 1 deletion src/probe.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <bpftune/bpftune.bpf.h>
#include "netns_tuner.h"
#include "tcp_cong_tuner.h"
#include "tcp_conn_tuner.h"

/* probe hash map */
BPF_MAP_DEF(probe_hash_map, BPF_MAP_TYPE_HASH, __u64, __u64, 65536);
Expand Down
2 changes: 1 addition & 1 deletion src/tcp_cong_tuner.bpf.c → src/tcp_conn_tuner.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <bpftune/bpftune.bpf.h>

#include "tcp_cong_tuner.h"
#include "tcp_conn_tuner.h"

const char bbr[4] = { 'b', 'b', 'r', '\0' };

Expand Down
12 changes: 6 additions & 6 deletions src/tcp_cong_tuner.c → src/tcp_conn_tuner.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/

#include <bpftune/libbpftune.h>
#include "tcp_cong_tuner.h"
#include "tcp_cong_tuner.skel.h"
#include "tcp_cong_tuner.skel.legacy.h"
#include "tcp_cong_tuner.skel.nobtf.h"
#include "tcp_conn_tuner.h"
#include "tcp_conn_tuner.skel.h"
#include "tcp_conn_tuner.skel.legacy.h"
#include "tcp_conn_tuner.skel.nobtf.h"

#include <arpa/inet.h>
#include <errno.h>
Expand All @@ -40,7 +40,7 @@ static struct bpftunable_scenario scenarios[] = {
"Because loss rate has exceeded 1 percent for a connection, use bbr congestion control algorithm instead of default" },
};

struct tcp_cong_tuner_bpf *skel;
struct tcp_conn_tuner_bpf *skel;

int tcp_iter_fd;

Expand All @@ -56,7 +56,7 @@ int init(struct bpftuner *tuner)
bpftune_log(LOG_DEBUG, "could not load tcp_bbr module: %s\n",
strerror(-err));

err = bpftuner_bpf_init(tcp_cong, tuner, NULL);
err = bpftuner_bpf_init(tcp_conn, tuner, NULL);
if (err)
return err;

Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions test/strategy/strategy_tuner.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
#include "strategy_tuner.skel.legacy.h"
#include "strategy_tuner.skel.nobtf.h"

static int evaluate_A(struct bpftuner *tuner, struct bpftuner_strategy *strategy)
static long double evaluate_A(struct bpftuner *tuner, struct bpftuner_strategy *strategy)
{
if (tuner->strategy == strategy)
return 0;
return (long double)0;
else
return 1;
return (long double)1;
}

const char *progs_A[] = { "entry__proc_dostring_coredump", NULL };
Expand All @@ -41,12 +41,12 @@ struct bpftuner_strategy strategy_A = {
.bpf_progs = progs_A,
};

static int evaluate_B(struct bpftuner *tuner, struct bpftuner_strategy *strategy)
static long double evaluate_B(struct bpftuner *tuner, struct bpftuner_strategy *strategy)
{
if (tuner->strategy == strategy)
return 0;
return (long double)0;
else
return 1;
return (long double)1;
}

const char *progs_B[] = { "entry__proc_dostring", NULL };
Expand Down