[ovs-dev] [netlink v4 27/52] datapath: Change userspace vport interface to use Netlink attributes.
Ben Pfaff
blp at nicira.com
Fri Jan 14 01:05:33 UTC 2011
On Tue, Jan 11, 2011 at 09:49:39PM -0800, Ben Pfaff wrote:
> One of the goals for Open vSwitch is to decouple kernel and userspace
> software, so that either one can be upgraded or rolled back independent of
> the other. To do this in full generality, it must be possible to add new
> features to the kernel vport layer without changing userspace software.
> The customary way to do this in the Linux networking stack is to use
> Netlink and in particular Netlink attributes. This commit adopts that
> model for the vport layer. It does not yet actually start using the
> Netlink socket layer, which will come later.
>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
This patch had a small bug that I just discovered, here's a fix:
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
index f931e25..b0f3c9b 100644
--- a/lib/dpif-linux.c
+++ b/lib/dpif-linux.c
@@ -275,9 +275,10 @@ dpif_linux_set_drop_frags(struct dpif *dpif_, bool drop_frags)
}
static int
-dpif_linux_port_add(struct dpif *dpif, struct netdev *netdev,
+dpif_linux_port_add(struct dpif *dpif_, struct netdev *netdev,
uint16_t *port_nop)
{
+ struct dpif_linux *dpif = dpif_linux_cast(dpif_);
const char *name = netdev_get_name(netdev);
const char *type = netdev_get_type(netdev);
struct dpif_linux_vport request, reply;
@@ -287,11 +288,12 @@ dpif_linux_port_add(struct dpif *dpif, struct netdev *netdev,
dpif_linux_vport_init(&request);
request.cmd = ODP_VPORT_NEW;
+ request.dp_idx = dpif->minor;
request.type = netdev_vport_get_vport_type(netdev);
if (request.type == ODPVT_UNSPEC) {
VLOG_WARN_RL(&error_rl, "%s: cannot create port `%s' because it has "
"unsupported type `%s'",
- dpif_name(dpif), name, type);
+ dpif_name(dpif_), name, type);
return EINVAL;
}
request.name = name;
@@ -374,7 +376,6 @@ struct dpif_linux_port_state {
uint32_t next;
};
-
static int
dpif_linux_port_dump_start(const struct dpif *dpif OVS_UNUSED, void **statep)
{
More information about the dev
mailing list