aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi Pokala <rpokala@FreeBSD.org>2020-06-19 07:07:10 +0000
committerRavi Pokala <rpokala@FreeBSD.org>2020-06-19 07:07:10 +0000
commit8cebe0d35ca72b1a823e0a129bd08f60407b340d (patch)
treeb71995775cfca2e8322a7ba3c37d6fbb86b8e954
parent1ae4bac217163b0cfd834213dbe1d64464baef5b (diff)
downloadsrc-8cebe0d35ca72b1a823e0a129bd08f60407b340d.tar.gz
src-8cebe0d35ca72b1a823e0a129bd08f60407b340d.zip
MFC r362078:
Decode the "LACP Fast Timeout" LAGG option flag r286700 added the "lacp_fast_timeout" option to `ifconfig', but we forgot to include the new option in the string used to decode the option bits. Add "LACP_FAST_TIMO" to LAGG_OPT_BITS. Also, s/LAGG_OPT_LACP_TIMEOUT/LAGG_OPT_LACP_FAST_TIMO/g , to be clearer that the flag indicates "Fast Timeout" mode.
Notes
Notes: svn path=/stable/10/; revision=362368
-rw-r--r--sbin/ifconfig/iflagg.c8
-rw-r--r--sys/net/if_lagg.c10
-rw-r--r--sys/net/if_lagg.h5
3 files changed, 12 insertions, 11 deletions
diff --git a/sbin/ifconfig/iflagg.c b/sbin/ifconfig/iflagg.c
index 5f6cb56bc012..696802eb3dd3 100644
--- a/sbin/ifconfig/iflagg.c
+++ b/sbin/ifconfig/iflagg.c
@@ -115,8 +115,8 @@ setlaggsetopt(const char *val, int d, int s, const struct afswtch *afp)
case -LAGG_OPT_LACP_TXTEST:
case LAGG_OPT_LACP_RXTEST:
case -LAGG_OPT_LACP_RXTEST:
- case LAGG_OPT_LACP_TIMEOUT:
- case -LAGG_OPT_LACP_TIMEOUT:
+ case LAGG_OPT_LACP_FAST_TIMO:
+ case -LAGG_OPT_LACP_FAST_TIMO:
break;
default:
err(1, "Invalid lagg option");
@@ -286,8 +286,8 @@ static struct cmd lagg_cmds[] = {
DEF_CMD("-lacp_txtest", -LAGG_OPT_LACP_TXTEST, setlaggsetopt),
DEF_CMD("lacp_rxtest", LAGG_OPT_LACP_RXTEST, setlaggsetopt),
DEF_CMD("-lacp_rxtest", -LAGG_OPT_LACP_RXTEST, setlaggsetopt),
- DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_TIMEOUT, setlaggsetopt),
- DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_TIMEOUT, setlaggsetopt),
+ DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_FAST_TIMO, setlaggsetopt),
+ DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_FAST_TIMO, setlaggsetopt),
DEF_CMD_ARG("flowid_shift", setlaggflowidshift),
};
static struct afswtch af_lagg = {
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index a892f8bd1cbb..69e4ed8a7ebe 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -1100,7 +1100,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
if (lsc->lsc_strict_mode != 0)
ro->ro_opts |= LAGG_OPT_LACP_STRICT;
if (lsc->lsc_fast_timeout != 0)
- ro->ro_opts |= LAGG_OPT_LACP_TIMEOUT;
+ ro->ro_opts |= LAGG_OPT_LACP_FAST_TIMO;
ro->ro_active = sc->sc_active;
} else {
@@ -1136,8 +1136,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case -LAGG_OPT_LACP_RXTEST:
case LAGG_OPT_LACP_STRICT:
case -LAGG_OPT_LACP_STRICT:
- case LAGG_OPT_LACP_TIMEOUT:
- case -LAGG_OPT_LACP_TIMEOUT:
+ case LAGG_OPT_LACP_FAST_TIMO:
+ case -LAGG_OPT_LACP_FAST_TIMO:
valid = lacp = 1;
break;
default:
@@ -1189,14 +1189,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case -LAGG_OPT_LACP_STRICT:
lsc->lsc_strict_mode = 0;
break;
- case LAGG_OPT_LACP_TIMEOUT:
+ case LAGG_OPT_LACP_FAST_TIMO:
LACP_LOCK(lsc);
LIST_FOREACH(lp, &lsc->lsc_ports, lp_next)
lp->lp_state |= LACP_STATE_TIMEOUT;
LACP_UNLOCK(lsc);
lsc->lsc_fast_timeout = 1;
break;
- case -LAGG_OPT_LACP_TIMEOUT:
+ case -LAGG_OPT_LACP_FAST_TIMO:
LACP_LOCK(lsc);
LIST_FOREACH(lp, &lsc->lsc_ports, lp_next)
lp->lp_state &= ~LACP_STATE_TIMEOUT;
diff --git a/sys/net/if_lagg.h b/sys/net/if_lagg.h
index ac0103227abd..67358ed4e634 100644
--- a/sys/net/if_lagg.h
+++ b/sys/net/if_lagg.h
@@ -148,7 +148,7 @@ struct lagg_reqopts {
#define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */
#define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */
#define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */
-#define LAGG_OPT_LACP_TIMEOUT 0x80 /* LACP timeout */
+#define LAGG_OPT_LACP_FAST_TIMO 0x80 /* LACP fast timeout */
u_int ro_count; /* number of ports */
u_int ro_active; /* active port count */
u_int ro_flapping; /* number of flapping */
@@ -159,7 +159,8 @@ struct lagg_reqopts {
#define SIOCSLAGGOPTS _IOW('i', 153, struct lagg_reqopts)
#define LAGG_OPT_BITS "\020\001USE_FLOWID\005LACP_STRICT" \
- "\006LACP_TXTEST\007LACP_RXTEST"
+ "\006LACP_TXTEST\007LACP_RXTEST" \
+ "\010LACP_FAST_TIMO"
#ifdef _KERNEL