[ovs-dev] [PATCH 07/12] dpif-netdev: Cache align netdev_flow_keys.

Bhanuprakash Bodireddy bhanuprakash.bodireddy at intel.com
Fri Oct 7 16:17:37 UTC 2016


Aligning the 'keys' array seems to positively impact performance.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy at intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti at intel.com>
---
 lib/dpif-netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index d0bb191..dfc9cbd 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -4157,7 +4157,7 @@ dp_netdev_input__(struct dp_netdev_pmd_thread *pmd,
     /* Sparse or MSVC doesn't like variable length array. */
     enum { PKT_ARRAY_SIZE = NETDEV_MAX_BURST };
 #endif
-    struct netdev_flow_key keys[PKT_ARRAY_SIZE];
+    struct netdev_flow_key keys[PKT_ARRAY_SIZE] __attribute__((aligned(64)));
     struct packet_batch_per_flow batches[PKT_ARRAY_SIZE];
     long long now = time_msec();
     size_t newcnt, n_batches, i;
-- 
2.4.11




More information about the dev mailing list