X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ofproto%2Fofproto-dpif.h;h=a8c5d48c155974a9cc5723116922253091f39a1b;hb=c1aadf4aace5e58855de3bf19fa4d0a161bf759a;hp=c238b24408c8117ecc6c2c26bfc2aa0b4bb12ccf;hpb=d611866c67ba06213040b27186e402717f77d72e;p=mirror_ovs.git diff --git a/ofproto/ofproto-dpif.h b/ofproto/ofproto-dpif.h index c238b2440..a8c5d48c1 100644 --- a/ofproto/ofproto-dpif.h +++ b/ofproto/ofproto-dpif.h @@ -27,6 +27,9 @@ #include "util.h" #include "ovs-thread.h" +/* Priority for internal rules created to handle recirculation */ +#define RECIRC_RULE_PRIORITY 20 + union user_action_cookie; struct dpif_flow_stats; struct ofproto; @@ -53,8 +56,6 @@ enum rule_dpif_lookup_verdict { * dropped. */ }; -/* For lock annotation below only. */ -extern struct ovs_rwlock xlate_rwlock; /* Ofproto-dpif -- DPIF based ofproto implementation. * @@ -115,6 +116,8 @@ uint8_t rule_dpif_get_table(const struct rule_dpif *); bool table_is_internal(uint8_t table_id); const struct rule_actions *rule_dpif_get_actions(const struct rule_dpif *); +uint32_t rule_dpif_get_recirc_id(struct rule_dpif *); +void rule_set_recirc_id(struct rule *, uint32_t id); ovs_be64 rule_dpif_get_flow_cookie(const struct rule_dpif *rule); @@ -140,12 +143,12 @@ bool ofproto_has_vlan_splinters(const struct ofproto_dpif *); ofp_port_t vsp_realdev_to_vlandev(const struct ofproto_dpif *, ofp_port_t realdev_ofp_port, ovs_be16 vlan_tci); -bool vsp_adjust_flow(const struct ofproto_dpif *, struct flow *); +bool vsp_adjust_flow(const struct ofproto_dpif *, struct flow *, + struct ofpbuf *packet); int ofproto_dpif_execute_actions(struct ofproto_dpif *, const struct flow *, struct rule_dpif *, const struct ofpact *, - size_t ofpacts_len, struct ofpbuf *) - OVS_EXCLUDED(xlate_rwlock); + size_t ofpacts_len, struct ofpbuf *); void ofproto_dpif_send_packet_in(struct ofproto_dpif *, struct ofproto_packet_in *); bool ofproto_dpif_wants_packet_in_on_miss(struct ofproto_dpif *); @@ -221,6 +224,7 @@ uint32_t ofproto_dpif_alloc_recirc_id(struct ofproto_dpif *ofproto); void ofproto_dpif_free_recirc_id(struct ofproto_dpif *ofproto, uint32_t recirc_id); int ofproto_dpif_add_internal_flow(struct ofproto_dpif *, const 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 *, @@ -258,6 +262,15 @@ static inline void rule_dpif_ref(struct rule_dpif *rule) } } +static inline bool rule_dpif_try_ref(struct rule_dpif *rule) +{ + if (rule) { + return ofproto_rule_try_ref(RULE_CAST(rule)); + } + return false; +} + + static inline void rule_dpif_unref(struct rule_dpif *rule) { if (rule) {