From: Matan Azrad <matan@mellanox.com>
To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
Thomas Monjalon <thomas@monjalon.net>,
"Konstantin Ananyev" <konstantin.ananyev@intel.com>,
Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Subject: Re: [dpdk-dev] [PATCH v2] ethdev: make ethdev data cache aligned
Date: Mon, 12 Feb 2018 12:10:13 +0000 [thread overview]
Message-ID: <AM4PR0501MB2657773CA5E49A486698609CD2F70@AM4PR0501MB2657.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20180212102041.GA29193@jerin>
Hi Jerin
From: Jerin Jacob, Sent: Monday, February 12, 2018 12:21 PM
> -----Original Message-----
> > Date: Mon, 12 Feb 2018 09:49:55 +0000
> > From: Matan Azrad <matan@mellanox.com>
> > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > CC: "dev@dpdk.org" <dev@dpdk.org>, "ferruh.yigit@intel.com"
> > <ferruh.yigit@intel.com>, Thomas Monjalon <thomas@monjalon.net>,
> > Konstantin Ananyev <konstantin.ananyev@intel.com>, Pavan Nikhilesh
> > <pbhagavatula@caviumnetworks.com>
> > Subject: RE: [dpdk-dev] [PATCH v2] ethdev: make ethdev data cache
> > aligned
> >
> > Hi Jerin
> >
> > From: Jerin Jacob, Sent: Monday, February 12, 2018 11:26 AM
> > > -----Original Message-----
> > > > Date: Mon, 12 Feb 2018 09:04:07 +0000
> > > > From: Matan Azrad <matan@mellanox.com>
> > > > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, "dev@dpdk.org"
> > > > <dev@dpdk.org>
> > > > CC: "ferruh.yigit@intel.com" <ferruh.yigit@intel.com>, Thomas
> > > > Monjalon <thomas@monjalon.net>, Konstantin Ananyev
> > > > <konstantin.ananyev@intel.com>, Pavan Nikhilesh
> > > > <pbhagavatula@caviumnetworks.com>
> > > > Subject: RE: [dpdk-dev] [PATCH v2] ethdev: make ethdev data cache
> > > > aligned
> > > >
> > > > Hi Jerin
> > > >
> > > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > > > > Since struct rte_eth_dev_data used in the fast path, making it
> > > > > as cache aligned.
> > > > >
> > > > > Fixes: af75078fece3 ("first public release")
> > > > > Fixes: 5b7ba31148a8 ("ethdev: add port ownership")
> > > >
> > > > Looks like it is just improvement.
> > > > No need the above "fixes" lines (also fix title is not needed as you did).
> > >
> > > I think, It varies the way we look at it. I don't think, either way
> > > it matters in the commit log.
> >
> > I think this commit improves " af75078fece3 ("first public release")"
> > since there was no intention to aligned rte_eth_dev_data in the first
> commit created it, The relevant fields in the first port probably was aligned
> without any intention(if no , what's about the other ports?).
>
> In my view it is a bug as it missed to align to cache line from the first release.
Can be a fix of the first release.
> and before adding struct rte_vlan_filter_conf vlan_filter_conf and struct
> rte_eth_dev_owner owner; it was 128B aligned just by luck for all the ports.
> and further ("ethdev: add port ownership") changes the complete alignment
> by introducing a container type on top of it.
>
So, ("ethdev: add port ownership") and rte_vlan_filter_conf vlan_filter_conf patch just exposed another issue of performance...
Moreover any fields adding patch to the rte_eth_dev_data structure from the first release didn't took the performance into account..
So, all of them have a bug?
I think that if you want to consider it as a fix it should be for the first commit didn't take into account the performance alignment.
And you should backport it with Cc: stable@dpdk.org.
> Do you think, any reason why this fastpath structure SHOULD NOT BE cache
> aligned ?
>
I agree it should be(actually the datapath fields should be in the same cache line).
I think also it will be good to detail the fields which should be in the same cache line.
> >
> > My suggestion is to just explain why the rte_eth_dev_data structure
> should be aligned and to align it as improvement, even to backport it to
> stable branch to improve the early LTS versions for all the ports.
>
> I don't think, There is a VERY specific reason for rte_eth_dev_data to cache
> aligned. it applies to all fastpath functions.
> IMO, We are making fastpath structure cache aligned due to,
> 1) Avoid sharing the element with another cache line
> 2) Compiler/CPU can access the elements in natural alignment if the top most
> element is aligned.
Agree.
>
> It simple, 1 port, 1 queue l3fwd setup.
> sudo ./examples/l3fwd/build/l3fwd -c 0xff00 -- -p 0x1 --config="(0,0,9)"
>
> It is not black and white. it will vary based on global variable alignment etc in
> the binary.
> i.e if apply this patch on any RANDOM change set you will not get a fixed
> improvement.
>
> Hope this clarifies.
Yes, you should add the improved scenario to the commit log with the results.
next prev parent reply other threads:[~2018-02-12 12:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-10 9:42 [dpdk-dev] [PATCH] ethdev: fix a regression due to cache alignment issue Jerin Jacob
2018-02-10 18:23 ` Matan Azrad
2018-02-12 5:33 ` Jerin Jacob
2018-02-12 5:54 ` [dpdk-dev] [PATCH v2] ethdev: make ethdev data cache aligned Jerin Jacob
2018-02-12 9:04 ` Matan Azrad
2018-02-12 9:25 ` Jerin Jacob
2018-02-12 9:49 ` Matan Azrad
2018-02-12 10:20 ` Jerin Jacob
2018-02-12 12:10 ` Matan Azrad [this message]
2018-02-12 13:13 ` [dpdk-dev] [PATCH v3] ethdev: fix ethdev data alignment Jerin Jacob
2018-02-12 13:44 ` Matan Azrad
2018-02-12 13:50 ` Jerin Jacob
2018-02-12 14:02 ` Matan Azrad
2018-02-12 14:11 ` Jerin Jacob
2018-02-13 9:42 ` Ferruh Yigit
2018-02-13 15:16 ` 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=AM4PR0501MB2657773CA5E49A486698609CD2F70@AM4PR0501MB2657.eurprd05.prod.outlook.com \
--to=matan@mellanox.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jerin.jacob@caviumnetworks.com \
--cc=konstantin.ananyev@intel.com \
--cc=pbhagavatula@caviumnetworks.com \
--cc=thomas@monjalon.net \
/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).