aboutsummaryrefslogtreecommitdiff
path: root/lib/dpif-linux.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-10-12 11:04:10 -0700
committerBen Pfaff <blp@nicira.com>2011-10-12 16:27:08 -0700
commitea36840fa4d6e9ce1e29fa8ce148edd3caef0072 (patch)
tree1d176632aff4252ece1d34e44fef84183f54f671 /lib/dpif-linux.c
parent98403001ece61cbf783297c467a06032b200b8d0 (diff)
datapath: Require explicit upcall_pid for new datapaths and vports.
This increases consistency with the OVS_ACTION_ATTR_USERSPACE action, which also requires an explicit pid. Suggested-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'lib/dpif-linux.c')
-rw-r--r--lib/dpif-linux.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
index 1e1afe50..08ac4425 100644
--- a/lib/dpif-linux.c
+++ b/lib/dpif-linux.c
@@ -235,6 +235,7 @@ dpif_linux_open(const struct dpif_class *class OVS_UNUSED, const char *name,
{
struct dpif_linux_dp dp_request, dp;
struct ofpbuf *buf;
+ uint32_t upcall_pid;
int error;
error = dpif_linux_init();
@@ -244,7 +245,13 @@ dpif_linux_open(const struct dpif_class *class OVS_UNUSED, const char *name,
/* Create or look up datapath. */
dpif_linux_dp_init(&dp_request);
- dp_request.cmd = create ? OVS_DP_CMD_NEW : OVS_DP_CMD_GET;
+ if (create) {
+ dp_request.cmd = OVS_DP_CMD_NEW;
+ upcall_pid = 0;
+ dp_request.upcall_pid = &upcall_pid;
+ } else {
+ dp_request.cmd = OVS_DP_CMD_GET;
+ }
dp_request.name = name;
error = dpif_linux_dp_transact(&dp_request, &dp, &buf);
if (error) {