Skip to content

Commit

Permalink
Correct ethtype referencing incorrect values
Browse files Browse the repository at this point in the history
documentation in OVN-NB in Logical_Switch_Port for Ethtype references
incorrect values

"Supported values: 802.11q (default), 802.11ad."

This should be 802.1q and 802.1ad.

Correct this in the code and documentation. For now I logged as a
warning that the incorrect value is used and maybe in the future the
incorrect value could be removed.

Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2023-December/052836.html
Fixes: 50f4ea0 ("Support 802.11ad EthType for localnet ports")

Submitted-at: #229
Signed-off-by: Jacob Tanenbaum <jtanenba@redhat.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
  • Loading branch information
JacobTanenbaum authored and dceara committed Jan 3, 2024
1 parent 78851b6 commit 58dcbef
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
25 changes: 18 additions & 7 deletions controller/physical.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,22 +703,33 @@ put_replace_chassis_mac_flows(const struct simap *ct_zones,
}
}

#define VLAN_80211AD_ETHTYPE 0x88a8
#define VLAN_80211Q_ETHTYPE 0x8100
#define VLAN_8021AD_ETHTYPE 0x88a8
#define VLAN_8021Q_ETHTYPE 0x8100

static void
ofpact_put_push_vlan(struct ofpbuf *ofpacts, const struct smap *options, int tag)
{
const char *ethtype_opt = options ? smap_get(options, "ethtype") : NULL;

int ethtype = VLAN_80211Q_ETHTYPE;
int ethtype = VLAN_8021Q_ETHTYPE;
if (ethtype_opt) {
if (!strcasecmp(ethtype_opt, "802.11ad")) {
ethtype = VLAN_80211AD_ETHTYPE;
} else if (strcasecmp(ethtype_opt, "802.11q")) {
if (!strcasecmp(ethtype_opt, "802.11ad")
|| !strcasecmp(ethtype_opt, "802.1ad")) {
ethtype = VLAN_8021AD_ETHTYPE;
} else if (!strcasecmp(ethtype_opt, "802.11q")
|| !strcasecmp(ethtype_opt, "802.1q")) {
ethtype = VLAN_8021Q_ETHTYPE;
} else {
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
VLOG_WARN_RL(&rl, "Unknown port ethtype: %s", ethtype_opt);
}
}
if (!strcasecmp(ethtype_opt, "802.11ad")
|| !strcasecmp(ethtype_opt, "802.11q")) {
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
VLOG_WARN_RL(&rl, "Using incorrect value ethtype: %s for either "
"802.1q or 802.1ad please correct this value",
ethtype_opt);
}
}

struct ofpact_push_vlan *push_vlan;
Expand Down
2 changes: 1 addition & 1 deletion ovn-nb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@

<column name="options" key="ethtype">
Optional. VLAN EtherType field value for encapsulating VLAN
headers. Supported values: 802.11q (default), 802.11ad.
headers. Supported values: 802.1q (default), 802.1ad.
</column>

<column name="options" key="localnet_learn_fdb"
Expand Down
2 changes: 1 addition & 1 deletion tests/ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -3885,7 +3885,7 @@ OVN_FOR_EACH_NORTHD([
AT_SETUP([VLAN transparency, passthru=true, multiple hosts, custom ethtype])
ovn_start

ethtype=802.11ad
ethtype=802.1ad

check ovn-nbctl ls-add ls
check ovn-nbctl --wait=sb add Logical-Switch ls other_config vlan-passthru=true
Expand Down

0 comments on commit 58dcbef

Please sign in to comment.