From: "Czekaj, Maciej" <Maciej.Czekaj@caviumnetworks.com>
To: "Kulasek, TomaszX" <tomaszx.kulasek@intel.com>,
"thomas.monjalon@6wind.com" <thomas.monjalon@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: [dpdk-dev] Odp.: [PATCH v3] examples/l3fwd: em path performance fix
Date: Tue, 15 Mar 2016 19:42:57 +0000 [thread overview]
Message-ID: <CO2PR0701MB1032634C01BAC346B5B88CF486890@CO2PR0701MB1032.namprd07.prod.outlook.com> (raw)
In-Reply-To: <3042915272161B4EB253DA4D77EB373A14E6BE0E@IRSMSX102.ger.corp.intel.com>
________________________________________
Od: Kulasek, TomaszX <tomaszx.kulasek@intel.com>
Wysłane: 15 marca 2016 17:06
Do: Thomas Monjalon; Czekaj, Maciej
DW: dev@dpdk.org
Temat: RE: [dpdk-dev] [PATCH v3] examples/l3fwd: em path performance fix
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Tuesday, March 15, 2016 15:50
> To: Kulasek, TomaszX <tomaszx.kulasek@intel.com>; Maciej Czekaj
> <maciej.czekaj@caviumnetworks.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3] examples/l3fwd: em path performance fix
>
> 2016-03-15 14:31, Kulasek, TomaszX:
> > From: Kulasek, TomaszX
> > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > > > There is an error:
> > > > examples/l3fwd/l3fwd_em_hlm_sse.h:72:38: error:
> > > > incompatible type for argument 2 of ‘_mm_and_si128’
> > >
> > > It's caused by
> > >
> > > commit 64d3955de1de4d7879a0930a6d2f501369d3445a
> > > Author: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
> > > Date: Thu Mar 10 17:06:22 2016 +0100
> > >
> > > examples/l3fwd: fix ARM build
> > >
> > > Enable NEON support in exact match mode.
> > > l3fwd example did not compile on ARM due to SSE2 instrincics used
> > > in generic part.
> > > Some instrinsins were used to initialize data structures and
> > > those were
> > > replaced by ordinary structure initalization.
> > > All SSE2 intrinsics used in forwarding, i.e. masking the IP/TCP
> header
> > > are moved to single inline function and made arch-specific.
> > >
> > > Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
> > >
> > > Which doesn't include rework of l3fwd_em_hlm_sse.h file.
> > >
> > > When you compile it now with global "#define HASH_MULTI_LOOKUP 1"
> > > and alternative classification is used, and compilation will also fail
> now.
> > >
> > > I need a little bit more time to investigate it, because I'm not an
> > > expert in ARM. It will be nice if Maciej will help me in that.
> > >
> > > Tomasz
> >
> > Will be that ok for you to disable this path for arm?
>
> Please, what do you mean?
> Maciej, have you looked at this issue?
This fix uses platform specific part of code which wasn't reworked in previous patch for ARM. It causes compilation error.
What I mean, is to leave current classification path for ARM and turn on alternative only for Intel platform.
Like that:
60 +#if defined(NO_HASH_MULTI_LOOKUP) || defined(__ARM_NEON)
61 #include "l3fwd_em_sse.h"
62 #else
63 #include "l3fwd_em_hlm_sse.h"
Thanks guys for pointing this out. The issue is that after my patch mask0, mask1 and mask2 are now defined as:
static rte_xmm_t mask0;
static rte_xmm_t mask1;
static rte_xmm_t mask2;
rte_xmm_t is a union with xmm_t field inside.
Apparently, I overlooked the HASH_MULTI_LOOKUP define
I can provide a quick fix for that, I need to rename all maskN references to maskN.x, to point out to xmm_t variable. E.g. the following diff is fixing the compilation.
diff --git a/examples/l3fwd/l3fwd_em_hlm_sse.h b/examples/l3fwd/l3fwd_em_hlm_sse.h
index d3388da..eb23163 100644
--- a/examples/l3fwd/l3fwd_em_hlm_sse.h
+++ b/examples/l3fwd/l3fwd_em_hlm_sse.h
@@ -77,14 +77,14 @@ em_get_dst_port_ipv4x8(struct lcore_conf *qconf, struct rte_mbuf *m[8],
sizeof(struct ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
- key[0].xmm = _mm_and_si128(data[0], mask0);
- key[1].xmm = _mm_and_si128(data[1], mask0);
- key[2].xmm = _mm_and_si128(data[2], mask0);
- key[3].xmm = _mm_and_si128(data[3], mask0);
- key[4].xmm = _mm_and_si128(data[4], mask0);
- key[5].xmm = _mm_and_si128(data[5], mask0);
- key[6].xmm = _mm_and_si128(data[6], mask0);
- key[7].xmm = _mm_and_si128(data[7], mask0);
+ key[0].xmm = _mm_and_si128(data[0], mask0.x);
+ key[1].xmm = _mm_and_si128(data[1], mask0.x);
+ key[2].xmm = _mm_and_si128(data[2], mask0.x);
+ key[3].xmm = _mm_and_si128(data[3], mask0.x);
+ key[4].xmm = _mm_and_si128(data[4], mask0.x);
+ key[5].xmm = _mm_and_si128(data[5], mask0.x);
+ key[6].xmm = _mm_and_si128(data[6], mask0.x);
+ key[7].xmm = _mm_and_si128(data[7], mask0.x);
const void *key_array[8] = {&key[0], &key[1], &key[2], &key[3],
&key[4], &key[5], &key[6], &key[7]};
@@ -175,14 +175,14 @@ em_get_dst_port_ipv6x8(struct lcore_conf *qconf, struct rte_mbuf *m[8],
int32_t ret[8];
union ipv6_5tuple_host key[8];
- get_ipv6_5tuple(m[0], mask1, mask2, &key[0]);
- get_ipv6_5tuple(m[1], mask1, mask2, &key[1]);
- get_ipv6_5tuple(m[2], mask1, mask2, &key[2]);
- get_ipv6_5tuple(m[3], mask1, mask2, &key[3]);
- get_ipv6_5tuple(m[4], mask1, mask2, &key[4]);
- get_ipv6_5tuple(m[5], mask1, mask2, &key[5]);
- get_ipv6_5tuple(m[6], mask1, mask2, &key[6]);
- get_ipv6_5tuple(m[7], mask1, mask2, &key[7]);
+ get_ipv6_5tuple(m[0], mask1.x, mask2.x, &key[0]);
+ get_ipv6_5tuple(m[1], mask1.x, mask2.x, &key[1]);
+ get_ipv6_5tuple(m[2], mask1.x, mask2.x, &key[2]);
+ get_ipv6_5tuple(m[3], mask1.x, mask2.x, &key[3]);
+ get_ipv6_5tuple(m[4], mask1.x, mask2.x, &key[4]);
+ get_ipv6_5tuple(m[5], mask1.x, mask2.x, &key[5]);
+ get_ipv6_5tuple(m[6], mask1.x, mask2.x, &key[6]);
+ get_ipv6_5tuple(m[7], mask1.x, mask2.x, &key[7]);
const void *key_array[8] = {&key[0], &key[1], &key[2], &key[3],
&key[4], &key[5], &key[6], &key[7]};
Would you like me to re-post the patch?
Thanks
Maciej
next prev parent reply other threads:[~2016-03-15 19:43 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-03 17:23 [dpdk-dev] [PATCH] " Tomasz Kulasek
2016-03-07 6:19 ` Xu, Qian Q
2016-03-08 12:58 ` [dpdk-dev] [PATCH v2] " Tomasz Kulasek
2016-03-11 11:14 ` Thomas Monjalon
2016-03-11 12:28 ` Kulasek, TomaszX
2016-03-11 12:10 ` [dpdk-dev] [PATCH v3] " Tomasz Kulasek
2016-03-11 16:23 ` Thomas Monjalon
2016-03-11 17:48 ` Kulasek, TomaszX
2016-03-15 14:31 ` Kulasek, TomaszX
2016-03-15 14:49 ` Thomas Monjalon
2016-03-15 16:06 ` Kulasek, TomaszX
2016-03-15 19:42 ` Czekaj, Maciej [this message]
2016-03-18 9:36 ` [dpdk-dev] [PATCH v4] " Tomasz Kulasek
2016-03-18 9:43 ` Kulasek, TomaszX
2016-03-18 9:52 ` [dpdk-dev] [PATCH v5] " Tomasz Kulasek
2016-03-18 10:04 ` Thomas Monjalon
2016-03-18 10:52 ` Jerin Jacob
2016-03-18 11:00 ` Thomas Monjalon
2016-03-18 11:16 ` [dpdk-dev] [PATCH] examples/l3fwd: prefer probed NEON flag to ARM gcc flag Thomas Monjalon
2016-03-18 11:20 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
2016-03-18 11:56 ` [dpdk-dev] [PATCH v5] examples/l3fwd: em path performance fix Jan Viktorin
2016-03-18 12:45 ` Kulasek, TomaszX
2016-03-18 12:50 ` Jan Viktorin
2016-03-18 13:31 ` [dpdk-dev] [PATCH v6] " Tomasz Kulasek
2016-03-21 11:57 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CO2PR0701MB1032634C01BAC346B5B88CF486890@CO2PR0701MB1032.namprd07.prod.outlook.com \
--to=maciej.czekaj@caviumnetworks.com \
--cc=dev@dpdk.org \
--cc=thomas.monjalon@6wind.com \
--cc=tomaszx.kulasek@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).