Changing the number of potential Exact Match Cache entries
will yield improved performance for different traffic
configurations. For instance, increasing the size will
improve performance with large numbers of flows. Of course,
this comes with some tradeoffs, in particular between
memory usage and performance.

This introduces the configure flag '--with-emc=size' that
changes the number of EMC entries from 2^10 to 2^size.

Signed-off-by: Ciara Loftus <ciara.lof...@intel.com>
---
 acinclude.m4      | 15 +++++++++++++++
 configure.ac      |  1 +
 lib/dpif-netdev.c |  1 -
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/acinclude.m4 b/acinclude.m4
index b09f2f2..5571e1b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -225,6 +225,21 @@ AC_DEFUN([OVS_CHECK_DPDK], [
   AM_CONDITIONAL([DPDK_NETDEV], test -n "$RTE_SDK")
 ])
 
+dnl OVS_CHECK_EMC
+dnl
+dnl Specify the relative EMC size.
+AC_DEFUN([OVS_CHECK_EMC], [
+  AC_ARG_WITH([emcsize],
+              [AC_HELP_STRING([--with-emcsize=size],
+                              [Specify the relative EMC size.])])
+
+  if test X"$with_emcsize" != X; then
+    AC_DEFINE_UNQUOTED([EM_FLOW_HASH_SHIFT], [$with_emcsize], [EMC Size is 
2^EM_FLOW_HASH_SHIFT entries.])
+  else
+    AC_DEFINE([EM_FLOW_HASH_SHIFT], [10], [EMC Size is 2^EM_FLOW_HASH_SHIFT 
entries.])
+  fi
+])
+
 dnl OVS_GREP_IFELSE(FILE, REGEX, [IF-MATCH], [IF-NO-MATCH])
 dnl
 dnl Greps FILE for REGEX.  If it matches, runs IF-MATCH, otherwise IF-NO-MATCH.
diff --git a/configure.ac b/configure.ac
index d1b48ca..7490cd5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,6 +164,7 @@ AC_ARG_VAR(KARCH, [Kernel Architecture String])
 AC_SUBST(KARCH)
 OVS_CHECK_LINUX
 OVS_CHECK_DPDK
+OVS_CHECK_EMC
 OVS_CHECK_PRAGMA_MESSAGE
 AC_SUBST([OVS_CFLAGS])
 AC_SUBST([OVS_LDFLAGS])
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 2ff2eac..af58204 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -117,7 +117,6 @@ struct netdev_flow_key {
  * If dp_netdev_input is not called from a pmd thread, a mutex is used.
  */
 
-#define EM_FLOW_HASH_SHIFT 10
 #define EM_FLOW_HASH_ENTRIES (1u << EM_FLOW_HASH_SHIFT)
 #define EM_FLOW_HASH_MASK (EM_FLOW_HASH_ENTRIES - 1)
 #define EM_FLOW_HASH_SEGS 2
-- 
1.9.3

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to