git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Global replace of Nicira Networks.
[sliver-openvswitch.git]
/
lib
/
dpif-linux.c
diff --git
a/lib/dpif-linux.c
b/lib/dpif-linux.c
index
94526f5
..
3b2fba3
100644
(file)
--- a/
lib/dpif-linux.c
+++ b/
lib/dpif-linux.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira
Networks
.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira
, Inc
.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-823,8
+823,12
@@
dpif_linux_operate__(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops)
struct op_auxdata {
struct nl_transaction txn;
struct op_auxdata {
struct nl_transaction txn;
+
struct ofpbuf request;
uint64_t request_stub[1024 / 8];
struct ofpbuf request;
uint64_t request_stub[1024 / 8];
+
+ struct ofpbuf reply;
+ uint64_t reply_stub[1024 / 8];
} auxes[MAX_OPS];
struct nl_transaction *txnsp[MAX_OPS];
} auxes[MAX_OPS];
struct nl_transaction *txnsp[MAX_OPS];
@@
-843,12
+847,16
@@
dpif_linux_operate__(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops)
aux->request_stub, sizeof aux->request_stub);
aux->txn.request = &aux->request;
aux->request_stub, sizeof aux->request_stub);
aux->txn.request = &aux->request;
+ ofpbuf_use_stub(&aux->reply, aux->reply_stub, sizeof aux->reply_stub);
+ aux->txn.reply = NULL;
+
switch (op->type) {
case DPIF_OP_FLOW_PUT:
put = &op->u.flow_put;
dpif_linux_init_flow_put(dpif_, put, &flow);
if (put->stats) {
flow.nlmsg_flags |= NLM_F_ECHO;
switch (op->type) {
case DPIF_OP_FLOW_PUT:
put = &op->u.flow_put;
dpif_linux_init_flow_put(dpif_, put, &flow);
if (put->stats) {
flow.nlmsg_flags |= NLM_F_ECHO;
+ aux->txn.reply = &aux->reply;
}
dpif_linux_flow_to_ofpbuf(&flow, &aux->request);
break;
}
dpif_linux_flow_to_ofpbuf(&flow, &aux->request);
break;
@@
-858,6
+866,7
@@
dpif_linux_operate__(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops)
dpif_linux_init_flow_del(dpif_, del, &flow);
if (del->stats) {
flow.nlmsg_flags |= NLM_F_ECHO;
dpif_linux_init_flow_del(dpif_, del, &flow);
if (del->stats) {
flow.nlmsg_flags |= NLM_F_ECHO;
+ aux->txn.reply = &aux->reply;
}
dpif_linux_flow_to_ofpbuf(&flow, &aux->request);
break;
}
dpif_linux_flow_to_ofpbuf(&flow, &aux->request);
break;
@@
-879,6
+888,7
@@
dpif_linux_operate__(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops)
nl_sock_transact_multiple(genl_sock, txnsp, n_ops);
for (i = 0; i < n_ops; i++) {
nl_sock_transact_multiple(genl_sock, txnsp, n_ops);
for (i = 0; i < n_ops; i++) {
+ struct op_auxdata *aux = &auxes[i];
struct nl_transaction *txn = &auxes[i].txn;
struct dpif_op *op = ops[i];
struct dpif_flow_put *put;
struct nl_transaction *txn = &auxes[i].txn;
struct dpif_op *op = ops[i];
struct dpif_flow_put *put;
@@
-918,8
+928,8
@@
dpif_linux_operate__(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops)
NOT_REACHED();
}
NOT_REACHED();
}
- ofpbuf_uninit(
txn
->request);
- ofpbuf_
delete(txn
->reply);
+ ofpbuf_uninit(
&aux
->request);
+ ofpbuf_
uninit(&aux
->reply);
}
}
}
}
@@
-1079,7
+1089,8
@@
parse_odp_packet(struct ofpbuf *buf, struct dpif_upcall *upcall,
}
static int
}
static int
-dpif_linux_recv(struct dpif *dpif_, struct dpif_upcall *upcall)
+dpif_linux_recv(struct dpif *dpif_, struct dpif_upcall *upcall,
+ struct ofpbuf *buf)
{
struct dpif_linux *dpif = dpif_linux_cast(dpif_);
int read_tries = 0;
{
struct dpif_linux *dpif = dpif_linux_cast(dpif_);
int read_tries = 0;
@@
-1113,7
+1124,6
@@
dpif_linux_recv(struct dpif *dpif_, struct dpif_upcall *upcall)
dpif->ready_mask &= ~(1u << indx);
for (;;) {
dpif->ready_mask &= ~(1u << indx);
for (;;) {
- struct ofpbuf *buf;
int dp_ifindex;
int error;
int dp_ifindex;
int error;
@@
-1121,10
+1131,11
@@
dpif_linux_recv(struct dpif *dpif_, struct dpif_upcall *upcall)
return EAGAIN;
}
return EAGAIN;
}
- error = nl_sock_recv(upcall_sock, &buf, false);
- if (error == EAGAIN) {
- break;
- } else if (error) {
+ error = nl_sock_recv(upcall_sock, buf, false);
+ if (error) {
+ if (error == EAGAIN) {
+ break;
+ }
return error;
}
return error;
}
@@
-1132,8
+1143,6
@@
dpif_linux_recv(struct dpif *dpif_, struct dpif_upcall *upcall)
if (!error && dp_ifindex == dpif->dp_ifindex) {
return 0;
}
if (!error && dp_ifindex == dpif->dp_ifindex) {
return 0;
}
-
- ofpbuf_delete(buf);
if (error) {
return error;
}
if (error) {
return error;
}