openvswitch: Simplify datapath locking.
[cascardo/linux.git] / net / openvswitch / vport.h
index 3f7961e..7282b84 100644 (file)
@@ -68,10 +68,10 @@ struct vport_err_stats {
 /**
  * struct vport - one port within a datapath
  * @rcu: RCU callback head for deferred destruction.
- * @port_no: Index into @dp's @ports array.
  * @dp: Datapath to which this port belongs.
  * @upcall_portid: The Netlink port to use for packets received on this port that
  * miss the flow table.
+ * @port_no: Index into @dp's @ports array.
  * @hash_node: Element in @dev_table hash table in vport.c.
  * @dp_hash_node: Element in @datapath->ports hash table in datapath.c.
  * @ops: Class structure.
@@ -81,9 +81,9 @@ struct vport_err_stats {
  */
 struct vport {
        struct rcu_head rcu;
-       u16 port_no;
        struct datapath *dp;
        u32 upcall_portid;
+       u16 port_no;
 
        struct hlist_node hash_node;
        struct hlist_node dp_hash_node;
@@ -138,14 +138,14 @@ struct vport_parms {
 struct vport_ops {
        enum ovs_vport_type type;
 
-       /* Called with RTNL lock. */
+       /* Called with ovs_mutex. */
        struct vport *(*create)(const struct vport_parms *);
        void (*destroy)(struct vport *);
 
        int (*set_options)(struct vport *, struct nlattr *);
        int (*get_options)(const struct vport *, struct sk_buff *);
 
-       /* Called with rcu_read_lock or RTNL lock. */
+       /* Called with rcu_read_lock or ovs_mutex. */
        const char *(*get_name)(const struct vport *);
        void (*get_config)(const struct vport *, void *);
        int (*get_ifindex)(const struct vport *);