diff options
author | Ethan Jackson <ethan@nicira.com> | 2013-09-24 13:39:56 -0700 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2013-12-19 13:27:23 -0800 |
commit | e79a6c833e0d72370951d6f8841098103cbb0b2d (patch) | |
tree | a603b8cd81ed738b961c2c93be11bd3ccf51e819 /ofproto/ofproto-dpif-upcall.h | |
parent | 1b84927316e090bc67cc6d923356857b52288670 (diff) | |
download | openvswitch-e79a6c833e0d72370951d6f8841098103cbb0b2d.tar.gz |
ofproto: Handle flow installation and eviction in upcall.
This patch moves flow installation and eviction from ofproto-dpif and
the main thread, into ofproto-dpif-upcall. This performs
significantly better (approximately 2x TCP_CRR improvement), and
allows ovs-vswitchd to maintain significantly larger datapath flow
tables. On top of that, it significantly simplifies the code,
retiring "struct facet" and friends.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'ofproto/ofproto-dpif-upcall.h')
-rw-r--r-- | ofproto/ofproto-dpif-upcall.h | 86 |
1 files changed, 10 insertions, 76 deletions
diff --git a/ofproto/ofproto-dpif-upcall.h b/ofproto/ofproto-dpif-upcall.h index a4d8228aa..d73ae4c9a 100644 --- a/ofproto/ofproto-dpif-upcall.h +++ b/ofproto/ofproto-dpif-upcall.h @@ -15,90 +15,24 @@ #ifndef OFPROTO_DPIF_UPCALL_H #define OFPROTO_DPIF_UPCALL_H -#define FLOW_MISS_MAX_BATCH 50 - -#include "dpif.h" -#include "flow.h" -#include "hmap.h" -#include "list.h" -#include "odp-util.h" -#include "ofpbuf.h" -#include "ofproto-dpif-xlate.h" +#include <stddef.h> struct dpif; struct dpif_backer; +struct seq; +struct simap; -/* udif is responsible for retrieving upcalls from the kernel, processing miss - * upcalls, and handing more complex ones up to the main ofproto-dpif - * module. */ +/* Udif is responsible for retrieving upcalls from the kernel and processing + * them. Additionally, it's responsible for maintaining the datapath flow + * table. */ struct udpif *udpif_create(struct dpif_backer *, struct dpif *); -void udpif_set_threads(struct udpif *, size_t n_handlers); +void udpif_set_threads(struct udpif *, size_t n_handlers, + size_t n_revalidators); void udpif_destroy(struct udpif *); - -void udpif_wait(struct udpif *); - void udpif_revalidate(struct udpif *); - void udpif_get_memory_usage(struct udpif *, struct simap *usage); - -/* udpif figures out how to forward packets, and does forward them, but it - * can't set up datapath flows on its own. This interface passes packet - * forwarding data from udpif to the higher level ofproto_dpif to allow the - * latter to set up datapath flows. */ - -/* Flow miss batching. - * - * Some dpifs implement operations faster when you hand them off in a batch. - * To allow batching, "struct flow_miss" queues the dpif-related work needed - * for a given flow. Each "struct flow_miss" corresponds to sending one or - * more packets, plus possibly installing the flow in the dpif. */ -struct flow_miss { - struct hmap_node hmap_node; - struct ofproto_dpif *ofproto; - - struct flow flow; - enum odp_key_fitness key_fitness; - const struct nlattr *key; - size_t key_len; - enum dpif_upcall_type upcall_type; - struct dpif_flow_stats stats; - - struct xlate_out xout; -}; - -struct flow_miss_batch { - struct list list_node; - - struct flow_miss miss_buf[FLOW_MISS_MAX_BATCH]; - struct hmap misses; - - unsigned int reval_seq; - - /* Flow misses refer to the memory held by "struct upcall"s, - * so we need to keep track of the upcalls to be able to - * free them when done. */ - struct list upcalls; /* Contains "struct upcall"s. */ -}; - -struct flow_miss_batch *flow_miss_batch_next(struct udpif *); -void flow_miss_batch_destroy(struct flow_miss_batch *); - -/* Drop keys are odp flow keys which have drop flows installed in the kernel. - * These are datapath flows which have no associated ofproto, if they did we - * would use facets. - * - * udpif can't install drop flows by itself. This interfaces allows udpif to - * pass the drop flows up to ofproto_dpif to get it to install them. */ -struct drop_key { - struct hmap_node hmap_node; - struct list list_node; - struct nlattr *key; - size_t key_len; -}; - -struct drop_key *drop_key_next(struct udpif *); -void drop_key_destroy(struct drop_key *); -void udpif_drop_key_clear(struct udpif *); +struct seq *udpif_dump_seq(struct udpif *); +void udpif_flush(void); #endif /* ofproto-dpif-upcall.h */ |