mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
lib: Switch to flow based tunneling.
With this patch, ovs-vswitchd uses flow based tunneling exclusively. I.E. each kind of tunnel shares a single tunnel backer in the datapath. Tunnel headers are set by userspace using the ipv4_tunnel datapath action. And, the configuration of individual tunnels is now a userspace responsibility, so netdev-vport no longer marshals and unmarshals Netlink attributes for tunnel configuration, instead only storing the configuration internally. There are still some significant pieces of work to do, but the basic building blocks are there to begin testing. Signed-off-by: Ethan Jackson <ethan@nicira.com> Co-authored-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
@@ -421,6 +421,40 @@ dpif_linux_get_stats(const struct dpif *dpif_, struct dpif_dp_stats *stats)
|
||||
return error;
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_vport_type(const struct dpif_linux_vport *vport)
|
||||
{
|
||||
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
|
||||
|
||||
switch (vport->type) {
|
||||
case OVS_VPORT_TYPE_NETDEV:
|
||||
return "system";
|
||||
|
||||
case OVS_VPORT_TYPE_INTERNAL:
|
||||
return "internal";
|
||||
|
||||
case OVS_VPORT_TYPE_GRE:
|
||||
return "gre";
|
||||
|
||||
case OVS_VPORT_TYPE_GRE64:
|
||||
return "gre64";
|
||||
|
||||
case OVS_VPORT_TYPE_CAPWAP:
|
||||
return "capwap";
|
||||
|
||||
case OVS_VPORT_TYPE_VXLAN:
|
||||
return "vxlan";
|
||||
|
||||
case OVS_VPORT_TYPE_UNSPEC:
|
||||
case __OVS_VPORT_TYPE_MAX:
|
||||
break;
|
||||
}
|
||||
|
||||
VLOG_WARN_RL(&rl, "dp%d: port `%s' has unsupported type %u",
|
||||
vport->dp_ifindex, vport->name, (unsigned int) vport->type);
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
static int
|
||||
dpif_linux_port_add(struct dpif *dpif_, struct netdev *netdev,
|
||||
uint32_t *port_nop)
|
||||
@@ -429,7 +463,6 @@ dpif_linux_port_add(struct dpif *dpif_, struct netdev *netdev,
|
||||
const char *name = netdev_vport_get_dpif_port(netdev);
|
||||
const char *type = netdev_get_type(netdev);
|
||||
struct dpif_linux_vport request, reply;
|
||||
const struct ofpbuf *options;
|
||||
struct nl_sock *sock = NULL;
|
||||
uint32_t upcall_pid;
|
||||
struct ofpbuf *buf;
|
||||
@@ -455,12 +488,6 @@ dpif_linux_port_add(struct dpif *dpif_, struct netdev *netdev,
|
||||
}
|
||||
request.name = name;
|
||||
|
||||
options = netdev_vport_get_options(netdev);
|
||||
if (options && options->size) {
|
||||
request.options = options->data;
|
||||
request.options_len = options->size;
|
||||
}
|
||||
|
||||
if (request.type == OVS_VPORT_TYPE_NETDEV) {
|
||||
netdev_linux_ethtool_set_flag(netdev, ETH_FLAG_LRO, "LRO", false);
|
||||
}
|
||||
@@ -547,7 +574,7 @@ dpif_linux_port_query__(const struct dpif *dpif, uint32_t port_no,
|
||||
error = ENODEV;
|
||||
} else if (dpif_port) {
|
||||
dpif_port->name = xstrdup(reply.name);
|
||||
dpif_port->type = xstrdup(netdev_vport_get_netdev_type(&reply));
|
||||
dpif_port->type = xstrdup(get_vport_type(&reply));
|
||||
dpif_port->port_no = reply.port_no;
|
||||
}
|
||||
ofpbuf_delete(buf);
|
||||
@@ -647,7 +674,7 @@ dpif_linux_port_dump_next(const struct dpif *dpif OVS_UNUSED, void *state_,
|
||||
}
|
||||
|
||||
dpif_port->name = CONST_CAST(char *, vport.name);
|
||||
dpif_port->type = CONST_CAST(char *, netdev_vport_get_netdev_type(&vport));
|
||||
dpif_port->type = CONST_CAST(char *, get_vport_type(&vport));
|
||||
dpif_port->port_no = vport.port_no;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user