dpif-netdev: Introduce netdev_flow_key_* functions
authorDaniele Di Proietto <ddiproietto@vmware.com>
Sat, 6 Sep 2014 08:10:42 +0000 (08:10 +0000)
committerJarno Rajahalme <jrajahalme@nicira.com>
Wed, 17 Sep 2014 22:09:45 +0000 (15:09 -0700)
commit79df317f0b3e31212d62d1af7b0dcbb2b908075d
tree58728b713f30725bc6fcb728688b8135363a598c
parent16194afdafe84c14cb6fc1311fe20624a04fe8ad
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@vmware.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
lib/dpif-netdev.c