Commit ce226579 authored by Adam Wujek's avatar Adam Wujek 💬

userspace: clean up drop parameter of VLANs in dot-config

In few places drop parameter of VLANs in dot-config was descibed that
can take different set of parameters, while the only accepted was y or n.
Now it can be y, yes, 1, n, no, 0. However, the tool (wrs_vlans) can use
only 1 or 0 for "drop" parameter.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent ec91b2b7
...@@ -1456,9 +1456,9 @@ config VLANS_VLAN0000 ...@@ -1456,9 +1456,9 @@ config VLANS_VLAN0000
--"prio" is a priority of a VLAN; can take values between -1 and 7 --"prio" is a priority of a VLAN; can take values between -1 and 7
-1 disables priority override, any other valid value takes -1 disables priority override, any other valid value takes
precedence over port priority precedence over port priority
--If "drop" is set to "y", all frames belonging to this VID are --If "drop" is set to y, yes or 1 all frames belonging to this VID are
dropped (note that frame can belong to a VID as a consequence of dropped (note that frame can belong to a VID as a consequence of
per-port Endpoint configuration); can take values "y" and "n" per-port Endpoint configuration); can take values y, yes, 1, n, no, 0
--"ports" is a list of ports separated with a semicolon sign (";"); --"ports" is a list of ports separated with a semicolon sign (";");
ports ranges are supported (with a minus sign) ports ranges are supported (with a minus sign)
...@@ -1620,9 +1620,9 @@ config VLANS_VLAN0023 ...@@ -1620,9 +1620,9 @@ config VLANS_VLAN0023
--"prio" is a priority of a VLAN; can take values between -1 and 7 --"prio" is a priority of a VLAN; can take values between -1 and 7
-1 disables priority override, any other valid value takes -1 disables priority override, any other valid value takes
precedence over port priority precedence over port priority
--If "drop" is set to "y", all frames belonging to this VID are --If "drop" is set to y, yes or 1 all frames belonging to this VID are
dropped (note that frame can belong to a VID as a consequence of dropped (note that frame can belong to a VID as a consequence of
per-port Endpoint configuration); can take values "y" and "n" per-port Endpoint configuration); can take values y, yes, 1, n, no, 0
--"ports" is a list of ports separated with a semicolon sign (";"); --"ports" is a list of ports separated with a semicolon sign (";");
ports ranges are supported (with a minus sign) ports ranges are supported (with a minus sign)
...@@ -2114,9 +2114,9 @@ config VLANS_VLAN0101 ...@@ -2114,9 +2114,9 @@ config VLANS_VLAN0101
--"prio" is a priority of a VLAN; can take values between -1 and 7 --"prio" is a priority of a VLAN; can take values between -1 and 7
-1 disables priority override, any other valid value takes -1 disables priority override, any other valid value takes
precedence over port priority precedence over port priority
--If "drop" is set to "y", all frames belonging to this VID are --If "drop" is set to y, yes or 1 all frames belonging to this VID are
dropped (note that frame can belong to a VID as a consequence of dropped (note that frame can belong to a VID as a consequence of
per-port Endpoint configuration); can take values "y" and "n" per-port Endpoint configuration); can take values y, yes, 1, n, no, 0
--"ports" is a list of ports separated with a semicolon sign (";"); --"ports" is a list of ports separated with a semicolon sign (";");
ports ranges are supported (with a minus sign) ports ranges are supported (with a minus sign)
......
...@@ -898,9 +898,10 @@ value is changed by the web interface, proper action is taken. ...@@ -898,9 +898,10 @@ value is changed by the web interface, proper action is taken.
7; 7;
-1 disables priority override, any other valid value takes -1 disables priority override, any other valid value takes
precedence over port priority precedence over port priority
@item If @t{drop} is set to @t{y}, all frames belonging to this VID are @item If @t{drop} is set to @t{y}, @t{yes} or @t{1}, all frames
dropped (note that frame can belong to a VID as a consequence of belonging to this VID are dropped (note that frame can belong to a
per-port Endpoint configuration); can take values @t{y} and @t{n} VID as a consequence of per-port Endpoint configuration); can take
values @t{y}, @t{yes}, @t{1}, @t{n}, @t{no}, @t{0}
@item @t{ports} is a list of ports separated with the semicolon sign @item @t{ports} is a list of ports separated with the semicolon sign
VLANs configuration per VLANS. VLANs configuration per VLANS.
@end itemize @end itemize
...@@ -1228,8 +1229,8 @@ CONFIG_VLANS_PORT03_VID=2 ...@@ -1228,8 +1229,8 @@ CONFIG_VLANS_PORT03_VID=2
CONFIG_VLANS_PORT03_VID_PTP="2" CONFIG_VLANS_PORT03_VID_PTP="2"
CONFIG_VLANS_ENABLE_SET1=y CONFIG_VLANS_ENABLE_SET1=y
CONFIG_VLANS_VLAN0001="fid=1,prio=4,drop=no,ports=1" CONFIG_VLANS_VLAN0001="fid=1,prio=4,drop=n,ports=1"
CONFIG_VLANS_VLAN0002="fid=2,prio=4,drop=no,ports=2;3" CONFIG_VLANS_VLAN0002="fid=2,prio=4,drop=n,ports=2;3"
@end smallexample @end smallexample
@c =------------------------------------------------------------------------- @c =-------------------------------------------------------------------------
...@@ -1240,12 +1241,18 @@ To configure the switch in the way descibed in the ...@@ -1240,12 +1241,18 @@ To configure the switch in the way descibed in the
@ref{Example VLAN configuration}, using the command line tools please perform @ref{Example VLAN configuration}, using the command line tools please perform
the following actions: the following actions:
Clear the current configuration:
@smallexample
# wrs_vlans --clear
# wrs_vlans --rvid 0 --del
@end smallexample
Set ports' configuration by using the @t{wrs_vlans}: Set ports' configuration by using the @t{wrs_vlans}:
@smallexample @smallexample
# wrs_vlans \ # wrs_vlans \
--port 1 --pmode 0 --pprio 4 --pvid 1 --puntag 1 \ --port 1 --pmode 0 --pprio 4 --pvid 1 --puntag 1 \
--port 2 --pmode 1 --pprio -1 \ --port 2 --pmode 1 --pprio -1 \
--port 3 --pmode 0 --pprio 4 --pvid 2 --puntag 1 --port 3 --pmode 0 --pprio 7 --pvid 2 --puntag 1
@end smallexample @end smallexample
Set VID configuration by using @t{wrs_vlans}: Set VID configuration by using @t{wrs_vlans}:
......
...@@ -204,9 +204,9 @@ for set_i in {1..3}; do ...@@ -204,9 +204,9 @@ for set_i in {1..3}; do
echo " --\"prio\" is a priority of a VLAN; can take values between -1 and 7" echo " --\"prio\" is a priority of a VLAN; can take values between -1 and 7"
echo " -1 disables priority override, any other valid value takes" echo " -1 disables priority override, any other valid value takes"
echo " precedence over port priority" echo " precedence over port priority"
echo " --If \"drop\" is set to \"y\", all frames belonging to this VID are" echo " --If \"drop\" is set to y, yes or 1 all frames belonging to this VID are"
echo " dropped (note that frame can belong to a VID as a consequence of" echo " dropped (note that frame can belong to a VID as a consequence of"
echo " per-port Endpoint configuration); can take values \"y\" and \"n\"" echo " per-port Endpoint configuration); can take values y, yes, 1, n, no, 0"
echo " --\"ports\" is a list of ports separated with a semicolon sign (\";\");" echo " --\"ports\" is a list of ports separated with a semicolon sign (\";\");"
echo " ports ranges are supported (with a minus sign)" echo " ports ranges are supported (with a minus sign)"
else else
......
...@@ -1064,9 +1064,13 @@ static void read_dot_config_vlans(int vlan_min, int vlan_max) ...@@ -1064,9 +1064,13 @@ static void read_dot_config_vlans(int vlan_min, int vlan_max)
} }
if (!libwr_cfg_convert2("VLANS_VLAN%04d", "drop", LIBWR_STRING, if (!libwr_cfg_convert2("VLANS_VLAN%04d", "drop", LIBWR_STRING,
buff, vlan)) { buff, vlan)) {
if (!strcmp(buff, "y")) if (!strcmp(buff, "y") /* "y", "yes" or "1" */
|| !strcmp(buff, "yes")
|| !strcmp(buff, "1"))
sprintf(buff, "1"); sprintf(buff, "1");
else if (!strcmp(buff, "n")) else if (!strcmp(buff, "n") /* "n", "no" or "0" */
|| !strcmp(buff, "no")
|| !strcmp(buff, "0"))
sprintf(buff, "0"); sprintf(buff, "0");
else { else {
pr_error("invalid drop parameter \"%s\" in " pr_error("invalid drop parameter \"%s\" in "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment