mirror of
https://github.com/openvswitch/ovs
synced 2025-09-01 14:55:18 +00:00
ofpbuf: Simplify ofpbuf API.
ofpbuf was complicated due to its wide usage across all layers of OVS, Now we have introduced independent dp_packet which can be used for datapath packet, we can simplify ofpbuf. Following patch removes DPDK mbuf and access API of ofpbuf members. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -119,11 +119,11 @@ jsonrpc_run(struct jsonrpc *rpc)
|
||||
struct ofpbuf *buf = ofpbuf_from_list(rpc->output.next);
|
||||
int retval;
|
||||
|
||||
retval = stream_send(rpc->stream, ofpbuf_data(buf), ofpbuf_size(buf));
|
||||
retval = stream_send(rpc->stream, buf->data, buf->size);
|
||||
if (retval >= 0) {
|
||||
rpc->backlog -= retval;
|
||||
ofpbuf_pull(buf, retval);
|
||||
if (!ofpbuf_size(buf)) {
|
||||
if (!buf->size) {
|
||||
list_remove(&buf->list_node);
|
||||
rpc->output_count--;
|
||||
ofpbuf_delete(buf);
|
||||
@@ -257,7 +257,7 @@ jsonrpc_send(struct jsonrpc *rpc, struct jsonrpc_msg *msg)
|
||||
|
||||
buf = xmalloc(sizeof *buf);
|
||||
ofpbuf_use(buf, s, length);
|
||||
ofpbuf_set_size(buf, length);
|
||||
buf->size = length;
|
||||
list_push_back(&rpc->output, &buf->list_node);
|
||||
rpc->output_count++;
|
||||
rpc->backlog += length;
|
||||
|
Reference in New Issue
Block a user