summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authoraraujo <araujo@FreeBSD.org>2016-01-23 04:18:44 +0000
committeraraujo <araujo@FreeBSD.org>2016-01-23 04:18:44 +0000
commita1319b3488144e197659231fc31c2faf78d916a4 (patch)
tree3b63e586885747ce4a58a6bd68574755c0ad2399 /sbin/ifconfig
parent7e5d57d7f131dab88d272d449b72eee8d68773b0 (diff)
downloadFreeBSD-src-a1319b3488144e197659231fc31c2faf78d916a4.zip
FreeBSD-src-a1319b3488144e197659231fc31c2faf78d916a4.tar.gz
Add an IOCTL rr_limit to let users fine tuning the number of packets to be
sent using roundrobin protocol and set a better granularity and distribution among the interfaces. Tuning the number of packages sent by interface can increase throughput and reduce unordered packets as well as reduce SACK. Example of usage: # ifconfig bge0 up # ifconfig bge1 up # ifconfig lagg0 create # ifconfig lagg0 laggproto roundrobin laggport bge0 laggport bge1 \ 192.168.1.1 netmask 255.255.255.0 # ifconfig lagg0 rr_limit 500 Reviewed by: thompsa, glebius, adrian (old patch) Approved by: bapt (mentor) Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D540
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/iflagg.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sbin/ifconfig/iflagg.c b/sbin/ifconfig/iflagg.c
index 97b42e3..cbf58f7 100644
--- a/sbin/ifconfig/iflagg.c
+++ b/sbin/ifconfig/iflagg.c
@@ -100,6 +100,19 @@ setlaggflowidshift(const char *val, int d, int s, const struct afswtch *afp)
}
static void
+setlaggrr_limit(const char *val, int d, int s, const struct afswtch *afp)
+{
+ struct lagg_reqopts ro;
+
+ bzero(&ro, sizeof(ro));
+ strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname));
+ ro.ro_bkt = (int)strtol(val, NULL, 10);
+
+ if (ioctl(s, SIOCSLAGGOPTS, &ro) != 0)
+ err(1, "SIOCSLAGG");
+}
+
+static void
setlaggsetopt(const char *val, int d, int s, const struct afswtch *afp)
{
struct lagg_reqopts ro;
@@ -252,6 +265,8 @@ lagg_status(int s)
printb("\t\tflags", ro.ro_opts, LAGG_OPT_BITS);
putchar('\n');
printf("\t\tflowid_shift: %d\n", ro.ro_flowid_shift);
+ if (ra.ra_proto == LAGG_PROTO_ROUNDROBIN)
+ printf("\t\trr_limit: %d\n", ro.ro_bkt);
printf("\tlagg statistics:\n");
printf("\t\tactive ports: %d\n", ro.ro_active);
printf("\t\tflapping: %u\n", ro.ro_flapping);
@@ -298,6 +313,7 @@ static struct cmd lagg_cmds[] = {
DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_TIMEOUT, setlaggsetopt),
DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_TIMEOUT, setlaggsetopt),
DEF_CMD_ARG("flowid_shift", setlaggflowidshift),
+ DEF_CMD_ARG("rr_limit", setlaggrr_limit),
};
static struct afswtch af_lagg = {
.af_name = "af_lagg",
OpenPOWER on IntegriCloud