[ovs-git] Open vSwitch: ofpbuf: Abstract 'l2' pointer and document usage conventions. (master)

dev at openvswitch.org dev at openvswitch.org
Thu Apr 3 18:48:41 UTC 2014

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  cf3b7538666cd1efa314ce4944e4efdf3dd81d99 (commit)
       via  6b8c377a6e25b18da473c3a24dfad8ec9e01ad7f (commit)
      from  631cf301a6f342fe832a54e8755c7fae5ffcdfa0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cf3b7538666cd1efa314ce4944e4efdf3dd81d99
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=cf3b7538666cd1efa314ce4944e4efdf3dd81d99
Author: Jarno Rajahalme <jrajahalme at nicira.com>
ofpbuf: Abstract 'l2' pointer and document usage conventions.
Rename 'l2' to 'frame' and add new ofpbuf_set_frame() and ofpbuf_l2().
ofpbuf_set_frame() alse resets all the layer offsets.  ofpbuf_l2()
returns NULL if the packet has no Ethernet header, as indicated either
by unset l3 offset or NULL frame pointer.  Callers of ofpbuf_l2() are
supposed to check the return value, unless they can otherwise be sure
that the packet has a valid Ethernet header.

The recent commit 437d0d22 made some assumptions that were not valid
regarding the use of the 'l2' pointer in rconn module and by
compose_rarp().  This is now fixed as follows: rconn now relies on the
fact that once OpenFlow messages are given to rconn for transport, the
frame pointer is no longer needed to refer to the OpenFlow header; and
compose_rarp() now sets the frame pointer and offsets as expected.

In addition to storing network frames, ofpbufs are also used for
handling OpenFlow messages and action lists.  lib/ofpbuf.h now has a
comment documenting the current usage conventions and invariants.

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Signed-off-by: Ben Pfaff <blp at nicira.com>

commit 6b8c377a6e25b18da473c3a24dfad8ec9e01ad7f
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=6b8c377a6e25b18da473c3a24dfad8ec9e01ad7f
Author: Jarno Rajahalme <jrajahalme at nicira.com>
ofpbuf: Rename trivial _get_ functions without the "get".
Code reads better without the "get", for example "ofpbuf_l3()"
v.s. "ofpbuf_get_l3()".  L4 payoad access functions still use the
"get" (e.g., "ofpbuf_get_tcp_payload()").

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>


Summary of changes:
 lib/bundle.c           |    4 +-
 lib/cfm.c              |    6 +--
 lib/flow.c             |    7 +---
 lib/lacp.c             |    2 +-
 lib/learn.c            |    4 +-
 lib/odp-execute.c      |   10 +++--
 lib/ofp-actions.c      |   10 ++---
 lib/ofp-msgs.c         |   72 +++++++++++++++++------------------
 lib/ofp-parse.c        |    3 --
 lib/ofp-print.c        |    8 ++--
 lib/ofp-util.c         |   63 +++++++++++++++----------------
 lib/ofpbuf.c           |   23 ++++++------
 lib/ofpbuf.h           |   97 +++++++++++++++++++++++++++++++++---------------
 lib/packets.c          |   58 ++++++++++++++++-------------
 lib/pcap-file.c        |    2 +-
 lib/rconn.c            |   13 +++----
 lib/stp.c              |    3 +-
 ofproto/ofproto-dpif.c |   14 +++----
 tests/test-stp.c       |    2 +-
 utilities/ovs-ofctl.c  |    4 +-
 20 files changed, 221 insertions(+), 184 deletions(-)

Open vSwitch

More information about the git mailing list