/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
static int
-dpif_linux_open(const char *name UNUSED, char *suffix, bool create,
+dpif_linux_open(const char *name OVS_UNUSED, char *suffix, bool create,
struct dpif **dpifp)
{
int minor;
static int
dpif_linux_get_stats(const struct dpif *dpif_, struct odp_stats *stats)
{
+ memset(stats, 0, sizeof *stats);
return do_ioctl(dpif_, ODP_DP_STATS, stats);
}
return do_ioctl(dpif_, ODP_SET_LISTEN_MASK, &listen_mask);
}
+static int
+dpif_linux_get_sflow_probability(const struct dpif *dpif_,
+ uint32_t *probability)
+{
+ return do_ioctl(dpif_, ODP_GET_SFLOW_PROBABILITY, probability);
+}
+
+static int
+dpif_linux_set_sflow_probability(struct dpif *dpif_, uint32_t probability)
+{
+ return do_ioctl(dpif_, ODP_SET_SFLOW_PROBABILITY, &probability);
+}
+
static int
dpif_linux_recv(struct dpif *dpif_, struct ofpbuf **bufp)
{
dpif_linux_execute,
dpif_linux_recv_get_mask,
dpif_linux_recv_set_mask,
+ dpif_linux_get_sflow_probability,
+ dpif_linux_set_sflow_probability,
dpif_linux_recv,
dpif_linux_recv_wait,
};
struct stat s;
char fn[128];
+ *fnp = NULL;
+
major = get_openvswitch_major();
if (major < 0) {
return -major;
}
dev = makedev(major, minor);
- *fnp = NULL;
sprintf(fn, "%s/dp%d", dirname, minor);
if (!stat(fn, &s)) {
if (!S_ISCHR(s.st_mode)) {