[ovs-git] [openvswitch/ovs] 549d38: ofproto-dpif-xlate: Only learn MAC addresses upon ...

GitHub noreply at github.com
Mon Aug 25 15:54:30 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 549d38611ec0b2f1571700e110830565a80dd568
      https://github.com/openvswitch/ovs/commit/549d38611ec0b2f1571700e110830565a80dd568
  Author: Ben Pfaff <blp at nicira.com>
  Date:   2014-08-25 (Mon, 25 Aug 2014)

  Changed paths:
    M ofproto/ofproto-dpif-xlate.c

  Log Message:
  -----------
  ofproto-dpif-xlate: Only learn MAC addresses upon handling packets.

MAC learning, like flow entry learning via the "learn" action, should only
happen if a packet was actually received.

Signed-off-by: Ben Pfaff <blp at nicira.com>
Acked-by: Joe Stringer <joestringer at nicira.com>


  Commit: bc3885835b181e79cf9eec66153a3486fccdc2e6
      https://github.com/openvswitch/ovs/commit/bc3885835b181e79cf9eec66153a3486fccdc2e6
  Author: Ben Pfaff <blp at nicira.com>
  Date:   2014-08-25 (Mon, 25 Aug 2014)

  Changed paths:
    M ofproto/ofproto-dpif-xlate.c

  Log Message:
  -----------
  ofproto-dpif-xlate: Skip pushing stats if there are no packets to push.

xlate_push_stats() mostly does nothing if 'stats->n_packets' is 0.  This
commit allows it to skip more complicated internal logic in that case.

The one case I see in which xlate_push_stats() does do something if
'stats->n_packets' is 0 is in the case of a cached fin_timeout translation.
That translation changes the idle and hard timeouts of a flow if tcp_flags
has FIN or RST set, even if n_packets is 0.  But I don't think that can
happen anyway; how would FIN or RST be set without receiving a packet?

More broadly, the xlate_push_stats handles two functions - pushing stats
and implementing side-effects from actions. If there are no packets, the
stats shouldn't need updating. If there were no packets, then no packets
could have hit actions for things such as mac learning/openflow learning,
so xlate_push_stats() should be a no-op.

Signed-off-by: Ben Pfaff <blp at nicira.com>
Acked-by: Joe Stringer <joestringer at nicira.com>


  Commit: 0725e74731e4ea3e49dae7200835050f0b726c88
      https://github.com/openvswitch/ovs/commit/0725e74731e4ea3e49dae7200835050f0b726c88
  Author: Ben Pfaff <blp at nicira.com>
  Date:   2014-08-25 (Mon, 25 Aug 2014)

  Changed paths:
    M ofproto/ofproto-dpif-upcall.c
    M ofproto/ofproto-dpif-xlate.c
    M ofproto/ofproto-dpif-xlate.h

  Log Message:
  -----------
  ofproto-dpif-xlate: Drop 'may_learn' parameter from xlate_push_stats().

Both existing callers calculated 'may_learn' as 'stats->n_packets > 0', so
it was redundant.  Because xlate_push_stats() is now entirely a no-op if
'stats->n_packets' is 0, we can now delete the tests entirely from the
cases that previously only ran if 'may_learn'.

Signed-off-by: Ben Pfaff <blp at nicira.com>
Acked-by: Joe Stringer <joestringer at nicira.com>


Compare: https://github.com/openvswitch/ovs/compare/826bc7b61345...0725e74731e4


More information about the git mailing list