*
* ofproto-dpif provides an ofproto implementation for those platforms which
* implement the netdev and dpif interface defined in netdev.h and dpif.h. The
- * most important of which is the Linux Kernel Module (dpif-linux), but
+ * most important of which is the Linux Kernel Module (dpif-netlink), but
* alternatives are supported such as a userspace only implementation
* (dpif-netdev), and a dummy implementation used for unit testing.
*
#include "ovs-thread.h"
#include "ofproto-provider.h"
#include "util.h"
-#include "ovs-thread.h"
struct dpif_flow_stats;
struct ofproto_async_msg;
struct ofproto_dpif;
struct uuid;
struct xlate_cache;
+struct xlate_ctx;
/* Number of implemented OpenFlow tables. */
enum { N_TABLES = 255 };
* - Do include packets and bytes from datapath flows which have not
* recently been processed by a revalidator. */
struct ovs_mutex stats_mutex;
- struct dpif_flow_stats stats OVS_GUARDED;
+ struct dpif_flow_detailed_stats stats OVS_GUARDED;
/* In non-NULL, will point to a new rule (for which a reference is held) to
* which all the stats updates should be forwarded. This exists only
struct xlate_cache *);
void rule_dpif_credit_stats(struct rule_dpif *,
- const struct dpif_flow_stats *);
+ const struct dpif_flow_stats *, bool);
void rule_set_recirc_id(struct rule *, uint32_t id);
\f
/* Groups. */
+enum group_selection_method {
+ SEL_METHOD_DEFAULT,
+ SEL_METHOD_DP_HASH,
+ SEL_METHOD_HASH,
+};
+
struct group_dpif {
struct ofgroup up;
struct ovs_mutex stats_mutex;
uint64_t packet_count OVS_GUARDED; /* Number of packets received. */
uint64_t byte_count OVS_GUARDED; /* Number of bytes received. */
+
+ enum group_selection_method selection_method;
+ enum ovs_hash_alg hash_alg; /* dp_hash algorithm to be applied. */
+ uint32_t hash_basis; /* Basis for dp_hash. */
+ uint32_t hash_mask; /* Used to mask dp_hash (2^N - 1).*/
+ struct ofputil_bucket **hash_map; /* Map hash values to buckets. */
};
void group_dpif_credit_stats(struct group_dpif *,
struct group_dpif *group_dpif_lookup(struct ofproto_dpif *,
uint32_t group_id, ovs_version_t version,
bool take_ref);
+
\f
/* Backers.
*
DPIF_SUPPORT_FIELD(bool, ct_eventmask, "Conntrack eventmask") \
\
/* True if the datapath supports OVS_ACTION_ATTR_CT_CLEAR action. */ \
- DPIF_SUPPORT_FIELD(bool, ct_clear, "Conntrack clear")
+ DPIF_SUPPORT_FIELD(bool, ct_clear, "Conntrack clear") \
+ \
+ /* Highest supported dp_hash algorithm. */ \
+ DPIF_SUPPORT_FIELD(size_t, max_hash_alg, "Max dp_hash algorithm") \
+ \
+ /* True if the datapath supports OVS_ACTION_ATTR_CHECK_PKT_LEN. */ \
+ DPIF_SUPPORT_FIELD(bool, check_pkt_len, "Check pkt length action") \
+ \
+ /* True if the datapath supports OVS_CT_ATTR_TIMEOUT in \
+ * OVS_ACTION_ATTR_CT action. */ \
+ DPIF_SUPPORT_FIELD(bool, ct_timeout, "Conntrack timeout policy") \
+ \
+ /* True if the datapath supports explicit drop action. */ \
+ DPIF_SUPPORT_FIELD(bool, explicit_drop_action, "Explicit Drop action") \
+ \
+ /* True if the datapath supports balance_tcp optimization */ \
+ DPIF_SUPPORT_FIELD(bool, lb_output_action, "Optimized Balance TCP mode")
+
/* Stores the various features which the corresponding backer supports. */
struct dpif_backer_support {
/* Meter. */
struct id_pool *meter_ids; /* Datapath meter allocation. */
+ /* Connection tracking. */
+ struct id_pool *tp_ids; /* Datapath timeout policy id
+ * allocation. */
+ struct cmap ct_zones; /* "struct ct_zone"s indexed by zone
+ * id. */
+ struct hmap ct_tps; /* "struct ct_timeout_policy"s indexed
+ * by timeout policy (struct simap). */
+ struct ovs_list ct_tp_kill_list; /* A list of timeout policy to be
+ * deleted. */
+
/* Version string of the datapath stored in OVSDB. */
char *dp_version_string;
struct guarded_list ams; /* Contains "struct ofproto_async_msgs"s. */
struct seq *ams_seq; /* For notifying 'ams' reception. */
uint64_t ams_seqno;
+
+ bool is_controller_connected; /* True if any controller admitted this
+ * switch connection. */
};
struct ofproto_dpif *ofproto_dpif_lookup_by_name(const char *name);
ofp_port_t);
int ofproto_dpif_add_internal_flow(struct ofproto_dpif *,
- const struct match *, int priority,
+ struct match *, int priority,
uint16_t idle_timeout,
const struct ofpbuf *ofpacts,
struct rule **rulep);
int ofproto_dpif_delete_internal_flow(struct ofproto_dpif *, struct match *,
int priority);
+int ofproto_dpif_add_lb_output_buckets(struct ofproto_dpif *, uint32_t bond_id,
+ const ofp_port_t *member_map);
+int ofproto_dpif_delete_lb_output_buckets(struct ofproto_dpif *,
+ uint32_t bond_id);
+bool ovs_lb_output_action_supported(struct ofproto_dpif *);
bool ovs_native_tunneling_is_on(struct ofproto_dpif *);
+bool ofproto_dpif_ct_zone_timeout_policy_get_name(
+ const struct dpif_backer *backer, uint16_t zone, uint16_t dl_type,
+ uint8_t nw_proto, char **tp_name, bool *unwildcard);
+
+bool ovs_explicit_drop_action_supported(struct ofproto_dpif *);
+
#endif /* ofproto-dpif.h */