}
tnl_cfg = netdev_get_tunnel_config(netdev);
- if (tnl_cfg && tnl_cfg->dst_port != 0) {
+ if (tnl_cfg && (tnl_cfg->dst_port != 0 || tnl_cfg->exts)) {
ofpbuf_use_stack(&options, options_stub, sizeof options_stub);
- nl_msg_put_u16(&options, OVS_TUNNEL_ATTR_DST_PORT,
- ntohs(tnl_cfg->dst_port));
+ if (tnl_cfg->dst_port) {
+ nl_msg_put_u16(&options, OVS_TUNNEL_ATTR_DST_PORT,
+ ntohs(tnl_cfg->dst_port));
+ }
+ if (tnl_cfg->exts) {
+ size_t ext_ofs;
+ int i;
+
+ ext_ofs = nl_msg_start_nested(&options, OVS_TUNNEL_ATTR_EXTENSION);
+ for (i = 0; i < 32; i++) {
+ if (tnl_cfg->exts & (1 << i)) {
+ nl_msg_put_flag(&options, i);
+ }
+ }
+ nl_msg_end_nested(&options, ext_ofs);
+ }
request.options = ofpbuf_data(&options);
request.options_len = ofpbuf_size(&options);
}
!strcmp(node->key, "in_key") ||
!strcmp(node->key, "out_key")) {
/* Handled separately below. */
+ } else if (!strcmp(node->key, "exts")) {
+ char *str = xstrdup(node->value);
+ char *ext, *save_ptr = NULL;
+
+ tnl_cfg.exts = 0;
+
+ ext = strtok_r(str, ",", &save_ptr);
+ while (ext) {
+ if (!strcmp(type, "vxlan") && !strcmp(ext, "gbp")) {
+ tnl_cfg.exts |= (1 << OVS_VXLAN_EXT_GBP);
+ } else {
+ VLOG_WARN("%s: unknown extension '%s'", name, ext);
+ }
+
+ ext = strtok_r(NULL, ",", &save_ptr);
+ }
+
+ free(str);
} else {
VLOG_WARN("%s: unknown %s argument '%s'", name, type, node->key);
}
ovs_be32 ip_src;
ovs_be32 ip_dst;
+ uint32_t exts;
+
uint8_t ttl;
bool ttl_inherit;
to <code>false</code> to disable.
</column>
+ <group title="Tunnel Options: vxlan only">
+
+ <column name="options" key="exts">
+ <p>Optional. Comma separated list of optional VXLAN extensions to
+ enable. The following extensions are supported:</p>
+
+ <ul>
+ <li>
+ <code>gbp</code>: VXLAN-GBP allows to transport the group policy
+ context of a packet across the VXLAN tunnel to other network
+ peers. See the field description of <code>tun_gbp_id</code> and
+ <code>tun_gbp_flags</code> in ovs-ofctl(8) for additional
+ information.
+ (<code>https://tools.ietf.org/html/draft-smith-vxlan-group-policy</code>)
+ </li>
+ </ul>
+ </column>
+
+ </group>
+
<group title="Tunnel Options: gre and ipsec_gre only">
<p>
Only <code>gre</code> and <code>ipsec_gre</code> interfaces support