CC: Min Chen <ustcer.tonyc...@gmail.com>
Signed-off-by: Ben Pfaff <b...@nicira.com>
---
Min, here is a little documentation for the function that
confused you.

 AUTHORS                |    1 +
 ofproto/ofproto-dpif.c |   18 +++++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 958d7f5..bb3cede 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -114,6 +114,7 @@ Michael Hu              m...@nicira.com
 Michael Mao             m...@nicira.com
 Mike Bursell            mike.burs...@citrix.com
 Mike Kruze              mkr...@nicira.com
+Min Chen                ustcer.tonyc...@gmail.com
 Murphy McCauley         murphy.mccau...@gmail.com
 Mikael Doverhag         mdover...@nicira.com
 Niklas Andersson        nanders...@nicira.com
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 7ad6569..ac14fee 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -6322,6 +6322,13 @@ hash_realdev_vid(uint16_t realdev_ofp_port, int vid)
     return hash_2words(realdev_ofp_port, vid);
 }
 
+/* Returns the ODP port number of the Linux VLAN device that corresponds to
+ * 'vlan_tci' on the network device with port number 'realdev_odp_port' in
+ * 'ofproto'.  For example, given 'realdev_odp_port' of eth0 and 'vlan_tci' 9,
+ * it would return the port number of eth0.9.
+ *
+ * Unless VLAN splinters are enabled for port 'realdev_odp_port', this
+ * function just returns its 'realdev_odp_port' argument. */
 static uint32_t
 vsp_realdev_to_vlandev(const struct ofproto_dpif *ofproto,
                        uint32_t realdev_odp_port, ovs_be16 vlan_tci)
@@ -6358,9 +6365,18 @@ vlandev_find(const struct ofproto_dpif *ofproto, 
uint16_t vlandev_ofp_port)
     return NULL;
 }
 
+/* Returns the OpenFlow port number of the "real" device underlying the Linux
+ * VLAN device with OpenFlow port number 'vlandev_ofp_port' and stores the
+ * VLAN VID of the Linux VLAN device in '*vid'.  For example, given
+ * 'vlandev_ofp_port' of eth0.9, it would return the OpenFlow port number of
+ * eth0 and store 9 in '*vid'.
+ *
+ * Returns 0 and does not modify '*vid' if 'vlandev_ofp_port' is not a Linux
+ * VLAN device.  Unless VLAN splinters are enabled, this is what this function
+ * always does.*/
 static uint16_t
 vsp_vlandev_to_realdev(const struct ofproto_dpif *ofproto,
-                   uint16_t vlandev_ofp_port, int *vid)
+                       uint16_t vlandev_ofp_port, int *vid)
 {
     if (!hmap_is_empty(&ofproto->vlandev_map)) {
         const struct vlan_splinter *vsp;
-- 
1.7.2.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to