diff mbox

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

Message ID 1476455835-77641-8-git-send-email-bhanuprakash.bodireddy@intel.com
State Superseded
Delegated to: Daniele Di Proietto
Headers show

Commit Message

Bodireddy, Bhanuprakash Oct. 14, 2016, 2:37 p.m. UTC
Aligning the 'keys' array seems to have positive performance impact.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
---
 lib/dpif-netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joe Stringer Oct. 19, 2016, 5:01 p.m. UTC | #1
On 14 October 2016 at 07:37, Bhanuprakash Bodireddy
<bhanuprakash.bodireddy@intel.com> wrote:
> Aligning the 'keys' array seems to have positive performance impact.
>
> Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
> Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>

It looks like the Windows build was broken after this change:
https://ci.appveyor.com/project/blp/ovs/build/1.0.2391

Will one of you take a look?
Jarno Rajahalme Oct. 19, 2016, 8:42 p.m. UTC | #2
> On Oct 19, 2016, at 10:01 AM, Joe Stringer <joe@ovn.org> wrote:
> 
> On 14 October 2016 at 07:37, Bhanuprakash Bodireddy
> <bhanuprakash.bodireddy@intel.com> wrote:
>> Aligning the 'keys' array seems to have positive performance impact.
>> 
>> Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
>> Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
>> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
>> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
> 
> It looks like the Windows build was broken after this change:
> https://ci.appveyor.com/project/blp/ovs/build/1.0.2391
> 
> Will one of you take a look?

The example in include/openvswitch/compiler.c has the OVS_ALIGNED_VAR() before the declaration, not after, so changing the modified line accordingly might help. I’d not want to propose a patch before testing that this fixes the Windows build, though, and I do not have access to a Windows build system…

  Jarno
Daniele Di Proietto Oct. 19, 2016, 8:48 p.m. UTC | #3
2016-10-19 13:42 GMT-07:00 Jarno Rajahalme <jarno@ovn.org>:

>
> > On Oct 19, 2016, at 10:01 AM, Joe Stringer <joe@ovn.org> wrote:
> >
> > On 14 October 2016 at 07:37, Bhanuprakash Bodireddy
> > <bhanuprakash.bodireddy@intel.com> wrote:
> >> Aligning the 'keys' array seems to have positive performance impact.
> >>
> >> Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com
> >
> >> Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
> >> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
> >> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
> >
> > It looks like the Windows build was broken after this change:
> > https://ci.appveyor.com/project/blp/ovs/build/1.0.2391
> >
> > Will one of you take a look?
>
> The example in include/openvswitch/compiler.c has the OVS_ALIGNED_VAR()
> before the declaration, not after, so changing the modified line
> accordingly might help. I’d not want to propose a patch before testing that
> this fixes the Windows build, though, and I do not have access to a Windows
> build system…
>

I tried that on a Windows system and it appears to fix the issue.

I'm sending a patch

Sorry for the breakage and thanks for reporting this Joe!
Ben Pfaff Oct. 19, 2016, 8:54 p.m. UTC | #4
On Wed, Oct 19, 2016 at 01:42:50PM -0700, Jarno Rajahalme wrote:
> 
> > On Oct 19, 2016, at 10:01 AM, Joe Stringer <joe@ovn.org> wrote:
> > 
> > On 14 October 2016 at 07:37, Bhanuprakash Bodireddy
> > <bhanuprakash.bodireddy@intel.com> wrote:
> >> Aligning the 'keys' array seems to have positive performance impact.
> >> 
> >> Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
> >> Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
> >> Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
> >> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
> > 
> > It looks like the Windows build was broken after this change:
> > https://ci.appveyor.com/project/blp/ovs/build/1.0.2391
> > 
> > Will one of you take a look?
> 
> The example in include/openvswitch/compiler.c has the
> OVS_ALIGNED_VAR() before the declaration, not after, so changing the
> modified line accordingly might help. I’d not want to propose a patch
> before testing that this fixes the Windows build, though, and I do not
> have access to a Windows build system…

You can always just push to a test repo of your own in github and then
wait for appveyor to succeed or fail.
diff mbox

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 95a04df..b5efb45 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -4166,7 +4166,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] OVS_ALIGNED_VAR(CACHE_LINE_SIZE);
     struct packet_batch_per_flow batches[PKT_ARRAY_SIZE];
     long long now = time_msec();
     size_t newcnt, n_batches, i;