DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "David Marchand" <david.marchand@redhat.com>
Cc: "Konstantin Ananyev" <konstantin.ananyev@huawei.com>,
	<bruce.richardson@intel.com>, <konstantin.v.ananyev@yandex.ru>,
	<stephen@networkplumber.org>, <roretzla@linux.microsoft.com>,
	<mattias.ronnblom@ericsson.com>, <aconole@redhat.com>,
	<dev@dpdk.org>
Subject: RE: [PATCH v8] eal/x86: improve rte_memcpy const size 16 performance
Date: Tue, 9 Jul 2024 14:43:12 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F5A4@smartserver.smartshare.dk> (raw)
In-Reply-To: <CAJFAV8xO9GEA6fde3MPSP9sPL3-J3Mtmfg1OFt+rz5TiBzSWCg@mail.gmail.com>

> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Tuesday, 9 July 2024 13.43
> 
> Hello,
> 
> On Tue, Jul 9, 2024 at 11:24 AM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > On Mon, Jun 10, 2024 at 3:40 PM Konstantin Ananyev
> > <konstantin.ananyev@huawei.com> wrote:
> > > > When the rte_memcpy() size is 16, the same 16 bytes are copied
> twice.
> > > > In the case where the size is known to be 16 at build time, omit
> the
> > > > duplicate copy.
> > > >
> > > > Reduced the amount of effectively copy-pasted code by using #ifdef
> > > > inside functions instead of outside functions.
> > > >
> > > > Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
> > > > Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
> >
> > Applied, thanks for the cleanup.
> 
> This breaks OVS compilation (clang and gcc).
> 
> make[1]: *** [Makefile:4722: lib/ofp-packet.lo] Error 1
> make[1]: *** Waiting for unfinished jobs....
> In file included from lib/ofp-print.c:34:
> In file included from ./lib/dp-packet.h:25:
> In file included from /home/runner/work/ovs/ovs/dpdk-
> dir/include/rte_mbuf.h:38:
> In file included from
> /home/runner/work/ovs/ovs/dpdk-dir/include/rte_mempool.h:50:
> /home/runner/work/ovs/ovs/dpdk-dir/include/rte_memcpy.h:113:25: error:
> cast from 'const uint8_t *' (aka 'const unsigned char *') to 'const
> __m128i *' increases required alignment from 1 to 16
> [-Werror,-Wcast-align]
> xmm0 = _mm_loadu_si128((const __m128i *)src);
> ^~~~~~~~~~~~~~~~~~~~
> /home/runner/work/ovs/ovs/dpdk-dir/include/rte_memcpy.h:114:19: error:
> cast from 'uint8_t *' (aka 'unsigned char *') to '__m128i *' increases
> required alignment from 1 to 16 [-Werror,-Wcast-align]
> _mm_storeu_si128((__m128i *)dst, xmm0);
> ^~~~~~~~~~~~~~
> 2 errors generated.
> make[1]: *** [Makefile:4722: lib/ofp-print.lo] Error 1
> make[1]: Leaving directory '/home/runner/work/ovs/ovs'
> make: *** [Makefile:3102: all] Error 2
> 
> I dropped this patch from main for now.
> Can you have a look please?

It seems the new code casts directly to the vector register size, while the original code first cast to void*, and then to the register size.

I'll try to fix it and post a new version.

PS: The CI should catch this stuff.


  reply	other threads:[~2024-07-09 12:43 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-02 23:48 [PATCH] " Morten Brørup
2024-03-03  0:38 ` Morten Brørup
2024-03-03  5:40 ` Stephen Hemminger
2024-03-03  5:47   ` Stephen Hemminger
2024-03-03  5:58     ` Stephen Hemminger
2024-03-03  5:58   ` Stephen Hemminger
2024-03-03 10:07     ` Morten Brørup
2024-03-03  5:41 ` Stephen Hemminger
2024-03-03  9:46 ` [PATCH v2] " Morten Brørup
2024-04-04  9:18   ` Morten Brørup
2024-04-04 10:07   ` Bruce Richardson
2024-04-04 11:19     ` Morten Brørup
2024-04-04 13:29       ` Bruce Richardson
2024-04-04 15:37         ` Morten Brørup
2024-04-04 15:55           ` Stephen Hemminger
2024-04-04 16:10             ` Morten Brørup
2024-04-04 16:55               ` Bruce Richardson
2024-03-03 16:05 ` [PATCH] " Stephen Hemminger
2024-04-05 12:46 ` [PATCH v3] " Morten Brørup
2024-04-05 13:17   ` Bruce Richardson
2024-04-05 13:48 ` [PATCH v4] " Morten Brørup
2024-05-27 13:15 ` Morten Brørup
2024-05-27 13:16 ` [PATCH v5] " Morten Brørup
2024-05-27 14:13   ` Morten Brørup
2024-05-28  6:18 ` Morten Brørup
2024-05-28  6:22 ` [PATCH v6] " Morten Brørup
2024-05-28  7:05 ` [PATCH v7] " Morten Brørup
2024-05-30 15:41 ` [PATCH v8] " Morten Brørup
2024-06-10  9:05   ` Morten Brørup
2024-06-10 13:40   ` Konstantin Ananyev
2024-06-10 13:59     ` Morten Brørup
2024-07-09  9:24     ` David Marchand
2024-07-09 11:42       ` David Marchand
2024-07-09 12:43         ` Morten Brørup [this message]
2024-07-09 12:47           ` David Marchand
2024-07-09 12:54             ` Morten Brørup
2024-07-09 15:26             ` Patrick Robb
2024-07-09 13:27 ` [PATCH v9] " Morten Brørup
2024-07-09 15:42   ` David Marchand
2024-07-10  8:03   ` David Marchand

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=98CBD80474FA8B44BF855DF32C47DC35E9F5A4@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=aconole@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@huawei.com \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=stephen@networkplumber.org \
    /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).