X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=ofproto%2Fofproto-provider.h;h=2c6e4839f2da4869a2b294d95fb8ef3aef80d7db;hb=6c6eedc5d6730835a0d9724e2e8cfe9cdf03b07d;hp=117cd1fcc02ee10e2ab3ef52ce74793a4c7e55c1;hpb=898dcef1ccbe39efdc3c32a6b368c403c34bd3d1;p=cascardo%2Fovs.git diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h index 117cd1fcc..2c6e4839f 100644 --- a/ofproto/ofproto-provider.h +++ b/ofproto/ofproto-provider.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,7 @@ struct ofproto { char *sw_desc; /* Software version (NULL for default). */ char *serial_desc; /* Serial number (NULL for default). */ char *dp_desc; /* Datapath description (NULL for default). */ - enum ofp_config_flags frag_handling; /* One of OFPC_*. */ + enum ofputil_frag_handling frag_handling; /* Datapath. */ struct hmap ports; /* Contains "struct ofport"s. */ @@ -256,6 +256,18 @@ struct oftable { #define EVICTION_OPENFLOW (1 << 1) /* Set to 1 if OpenFlow enables eviction. */ unsigned int eviction; + /* If zero, vacancy events are disabled. If nonzero, this is the type of + vacancy event that is enabled: either OFPTR_VACANCY_DOWN or + OFPTR_VACANCY_UP. Only one type of vacancy event can be enabled at a + time. */ + enum ofp14_table_reason vacancy_event; + + /* Non-zero values for vacancy_up and vacancy_down indicates that vacancy + * is enabled by table-mod, else these values are set to zero when + * vacancy is disabled */ + uint8_t vacancy_down; /* Vacancy threshold when space decreases (%). */ + uint8_t vacancy_up; /* Vacancy threshold when space increases (%). */ + atomic_ulong n_matched; atomic_ulong n_missed; }; @@ -473,9 +485,6 @@ extern unsigned ofproto_max_idle; * ofproto-dpif implementation. */ extern size_t n_handlers, n_revalidators; -/* Number of rx queues to be created for each dpdk interface. */ -extern size_t n_dpdk_rxqs; - /* Cpu mask for pmd threads. */ extern char *pmd_cpu_mask; @@ -890,12 +899,36 @@ struct ofproto_class { * initialization, and construct and destruct ofports to reflect all of * the changes. * + * - On graceful shutdown, the base ofproto code will destruct all + * the ports. + * * ->port_construct() returns 0 if successful, otherwise a positive errno * value. + * + * + * ->port_destruct() + * ================= + * + * ->port_destruct() takes a 'del' parameter. If the provider implements + * the datapath itself (e.g. dpif-netdev, it can ignore 'del'. On the + * other hand, if the provider is an interface to an external datapath + * (e.g. to a kernel module that implement the datapath) then 'del' should + * influence destruction behavior in the following way: + * + * - If 'del' is true, it should remove the port from the underlying + * implementation. This is the common case. + * + * - If 'del' is false, it should leave the port in the underlying + * implementation. This is used when Open vSwitch is performing a + * graceful shutdown and ensures that, across Open vSwitch restarts, + * the underlying ports are not removed and recreated. That makes an + * important difference for, e.g., "internal" ports that have + * configured IP addresses; without this distinction, the IP address + * and other configured state for the port is lost. */ struct ofport *(*port_alloc)(void); int (*port_construct)(struct ofport *ofport); - void (*port_destruct)(struct ofport *ofport); + void (*port_destruct)(struct ofport *ofport, bool del); void (*port_dealloc)(struct ofport *ofport); /* Called after 'ofport->netdev' is replaced by a new netdev object. If @@ -1226,22 +1259,22 @@ struct ofproto_class { * which takes one of the following values, with the corresponding * meanings: * - * - OFPC_FRAG_NORMAL: The switch should treat IP fragments the same way - * as other packets, omitting TCP and UDP port numbers (always setting - * them to 0). + * - OFPUTIL_FRAG_NORMAL: The switch should treat IP fragments the same + * way as other packets, omitting TCP and UDP port numbers (always + * setting them to 0). * - * - OFPC_FRAG_DROP: The switch should drop all IP fragments without + * - OFPUTIL_FRAG_DROP: The switch should drop all IP fragments without * passing them through the flow table. * - * - OFPC_FRAG_REASM: The switch should reassemble IP fragments before + * - OFPUTIL_FRAG_REASM: The switch should reassemble IP fragments before * passing packets through the flow table. * - * - OFPC_FRAG_NX_MATCH (a Nicira extension): Similar to OFPC_FRAG_NORMAL, - * except that TCP and UDP port numbers should be included in fragments - * with offset 0. + * - OFPUTIL_FRAG_NX_MATCH (a Nicira extension): Similar to + * OFPUTIL_FRAG_NORMAL, except that TCP and UDP port numbers should be + * included in fragments with offset 0. * * Implementations are not required to support every mode. - * OFPC_FRAG_NORMAL is the default mode when an ofproto is created. + * OFPUTIL_FRAG_NORMAL is the default mode when an ofproto is created. * * At the time of the call to ->set_frag_handling(), the current mode is * available in 'ofproto->frag_handling'. ->set_frag_handling() returns @@ -1251,7 +1284,7 @@ struct ofproto_class { * reflect the new mode. */ bool (*set_frag_handling)(struct ofproto *ofproto, - enum ofp_config_flags frag_handling); + enum ofputil_frag_handling frag_handling); /* Implements the OpenFlow OFPT_PACKET_OUT command. The datapath should * execute the 'ofpacts_len' bytes of "struct ofpacts" in 'ofpacts'. @@ -1296,6 +1329,9 @@ struct ofproto_class { const struct ofpact *ofpacts, size_t ofpacts_len); + enum ofperr (*nxt_resume)(struct ofproto *ofproto, + const struct ofputil_packet_in_private *); + /* ## ------------------------- ## */ /* ## OFPP_NORMAL configuration ## */ /* ## ------------------------- ## */ @@ -1787,6 +1823,9 @@ void ofproto_delete_flow(struct ofproto *, const struct match *, int priority) OVS_EXCLUDED(ofproto_mutex); void ofproto_flush_flows(struct ofproto *); +enum ofperr ofproto_check_ofpacts(struct ofproto *, + const struct ofpact ofpacts[], + size_t ofpacts_len); static inline const struct rule_actions * rule_get_actions(const struct rule *rule)