[ovs-dev] [netlink v4 38/52] ofproto: Avoid using ODPFF_ZERO_TCP_FLAGS.
Ethan Jackson
ethan at nicira.com
Sat Jan 22 22:41:37 UTC 2011
Looks Good.
On Tue, Jan 11, 2011 at 9:49 PM, Ben Pfaff <blp at nicira.com> wrote:
> I'm planning to remove this flag, since it is a bit of a wart, so this
> commit deletes its only actual user.
> ---
> ofproto/ofproto.c | 34 ++++++++--------------------------
> 1 files changed, 8 insertions(+), 26 deletions(-)
>
> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
> index 9184988..6169ec7 100644
> --- a/ofproto/ofproto.c
> +++ b/ofproto/ofproto.c
> @@ -4581,36 +4581,18 @@ facet_active_timeout(struct ofproto *ofproto, struct facet *facet)
> netflow_active_timeout_expired(ofproto->netflow, &facet->nf_flow)) {
> struct ofexpired expired;
>
> - expired.flow = facet->flow;
> - expired.packet_count = facet->packet_count;
> - expired.byte_count = facet->byte_count;
> - expired.used = facet->used;
> -
> - /* Get updated flow stats.
> - *
> - * XXX We could avoid this call entirely if (1) ofproto_update_used()
> - * updated TCP flags and (2) the dpif_flow_list_all() in
> - * ofproto_update_used() zeroed TCP flags. */
> if (facet->installed) {
> - uint32_t keybuf[ODPUTIL_FLOW_KEY_U32S];
> struct dpif_flow_stats stats;
> - struct ofpbuf key;
> -
> - ofpbuf_use_stack(&key, keybuf, sizeof keybuf);
> - odp_flow_key_from_flow(&key, &facet->flow);
> -
> - if (!dpif_flow_get(ofproto->dpif, ODPFF_ZERO_TCP_FLAGS,
> - key.data, key.size, NULL, &stats)) {
> - expired.packet_count += stats.n_packets;
> - expired.byte_count += stats.n_bytes;
> - if (stats.n_packets) {
> - facet_update_time(ofproto, facet, &stats);
> - netflow_flow_update_flags(&facet->nf_flow,
> - stats.tcp_flags);
> - }
> - }
> +
> + facet_put__(ofproto, facet, facet->actions, facet->actions_len,
> + &stats);
> + facet_update_stats(ofproto, facet, &stats);
> }
>
> + expired.flow = facet->flow;
> + expired.packet_count = facet->packet_count;
> + expired.byte_count = facet->byte_count;
> + expired.used = facet->used;
> netflow_expire(ofproto->netflow, &facet->nf_flow, &expired);
> }
> }
> --
> 1.7.1
>
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org
>
More information about the dev
mailing list