datapath: Use "struct rtnl_link_stats64" instead of "struct odp_vport_stats".
[openvswitch] / datapath / vport.h
index 7a3d527ae00051dc0e49c6d52e3b1085050189aa..186d6bf74e041919b3961126b71969ddd2852362 100644 (file)
@@ -10,6 +10,7 @@
 #define VPORT_H 1
 
 #include <linux/list.h>
+#include <linux/seqlock.h>
 #include <linux/skbuff.h>
 #include <linux/spinlock.h>
 
@@ -55,7 +56,7 @@ int vport_detach(struct vport *);
 
 int vport_set_mtu(struct vport *, int mtu);
 int vport_set_addr(struct vport *, const unsigned char *);
-int vport_set_stats(struct vport *, struct odp_vport_stats *);
+int vport_set_stats(struct vport *, struct rtnl_link_stats64 *);
 
 const char *vport_get_name(const struct vport *);
 const char *vport_get_type(const struct vport *);
@@ -63,7 +64,7 @@ const unsigned char *vport_get_addr(const struct vport *);
 
 struct dp_port *vport_get_dp_port(const struct vport *);
 struct kobject *vport_get_kobj(const struct vport *);
-int vport_get_stats(struct vport *, struct odp_vport_stats *);
+int vport_get_stats(struct vport *, struct rtnl_link_stats64 *);
 
 unsigned vport_get_flags(const struct vport *);
 int vport_is_running(const struct vport *);
@@ -83,6 +84,7 @@ struct vport_percpu_stats {
        u64 rx_packets;
        u64 tx_bytes;
        u64 tx_packets;
+       seqcount_t seqlock;
 };
 
 struct vport_err_stats {
@@ -105,12 +107,13 @@ struct vport {
 
        spinlock_t stats_lock;
        struct vport_err_stats err_stats;
-       struct odp_vport_stats offset_stats;
+       struct rtnl_link_stats64 offset_stats;
 };
 
 #define VPORT_F_REQUIRED       (1 << 0) /* If init fails, module loading fails. */
 #define VPORT_F_GEN_STATS      (1 << 1) /* Track stats at the generic layer. */
-#define VPORT_F_TUN_ID         (1 << 2) /* Sets OVS_CB(skb)->tun_id. */
+#define VPORT_F_FLOW           (1 << 2) /* Sets OVS_CB(skb)->flow. */
+#define VPORT_F_TUN_ID         (1 << 3) /* Sets OVS_CB(skb)->tun_id. */
 
 /**
  * struct vport_ops - definition of a type of virtual port
@@ -174,13 +177,13 @@ struct vport_ops {
 
        int (*set_mtu)(struct vport *, int mtu);
        int (*set_addr)(struct vport *, const unsigned char *);
-       int (*set_stats)(const struct vport *, struct odp_vport_stats *);
+       int (*set_stats)(const struct vport *, struct rtnl_link_stats64 *);
 
        /* Called with rcu_read_lock or RTNL lock. */
        const char *(*get_name)(const struct vport *);
        const unsigned char *(*get_addr)(const struct vport *);
        struct kobject *(*get_kobj)(const struct vport *);
-       int (*get_stats)(const struct vport *, struct odp_vport_stats *);
+       int (*get_stats)(const struct vport *, struct rtnl_link_stats64 *);
 
        unsigned (*get_dev_flags)(const struct vport *);
        int (*is_running)(const struct vport *);
@@ -219,8 +222,7 @@ void vport_free(struct vport *);
  * area was allocated on creation.  This allows that area to be accessed and
  * used for any purpose needed by the vport implementer.
  */
-static inline void *
-vport_priv(const struct vport *vport)
+static inline void *vport_priv(const struct vport *vport)
 {
        return (u8 *)vport + ALIGN(sizeof(struct vport), VPORT_ALIGN);
 }
@@ -235,8 +237,7 @@ vport_priv(const struct vport *vport)
  * the result of a hash table lookup.  @priv must point to the start of the
  * private data area.
  */
-static inline struct vport *
-vport_from_priv(const void *priv)
+static inline struct vport *vport_from_priv(const void *priv)
 {
        return (struct vport *)(priv - ALIGN(sizeof(struct vport), VPORT_ALIGN));
 }
@@ -250,5 +251,6 @@ extern struct vport_ops netdev_vport_ops;
 extern struct vport_ops internal_vport_ops;
 extern struct vport_ops patch_vport_ops;
 extern struct vport_ops gre_vport_ops;
+extern struct vport_ops capwap_vport_ops;
 
 #endif /* vport.h */