[ovs-git] [openvswitch/ovs] 79df31: dpif-netdev: Introduce netdev_flow_key_* functions

GitHub noreply at github.com
Wed Sep 17 22:15:35 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 79df317f0b3e31212d62d1af7b0dcbb2b908075d
      https://github.com/openvswitch/ovs/commit/79df317f0b3e31212d62d1af7b0dcbb2b908075d
  Author: Daniele Di Proietto <ddiproietto at vmware.com>
  Date:   2014-09-17 (Wed, 17 Sep 2014)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Introduce netdev_flow_key_* functions

netdev_flow_key is a miniflow with the following constraints:

1) It is used only inside dpif-netdev.c.
2) It always has inline values.
3) It contains only miniflows created by miniflow_extract().

Therefore, by using these new functions instead of the miniflow_*
ones, we get the following (performance related) benefits:

- Because of (1) the functions can be inlined.
- Because of (2) and (3) the netdev_flow_key can be treated as POD.
  Specifically, because of (3), we can do comparisons with memcmp,
  since if the map is different the miniflow must be different.

Signed-off-by: Daniele Di Proietto <ddiproietto at vmware.com>
Acked-by: Jarno Rajahalme <jrajahalme at nicira.com>


  Commit: 0023a1cb45400262820cc69c9dbd15fc8a95eb48
      https://github.com/openvswitch/ovs/commit/0023a1cb45400262820cc69c9dbd15fc8a95eb48
  Author: Daniele Di Proietto <ddiproietto at vmware.com>
  Date:   2014-09-17 (Wed, 17 Sep 2014)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Store miniflow length in exact match cache

This optimization is done to avoid calling count_1bits(), which, if
the popcnt istruction is not available might is slow. popcnt may not
be available because:

- We are running on old hardware
- (more likely) We're using a generic build (i.e. packaged OVS from a
  distro), not tuned for the specific CPU

Signed-off-by: Daniele Di Proietto <ddiproietto at vmware.com>
Acked-by: Jarno Rajahalme <jrajahalme at nicira.com>


Compare: https://github.com/openvswitch/ovs/compare/16194afdafe8...0023a1cb4540


More information about the git mailing list