linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcin Wojtas <mw@semihalf.com>
To: Jisheng.Zhang@synaptics.com
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	netdev <netdev@vger.kernel.org>,
	"Antoine Tenart" <antoine.tenart@bootlin.com>,
	"Grzegorz Jaszczyk" <jaz@semihalf.com>,
	"Grégory Clement" <gregory.clement@bootlin.com>,
	"Russell King - ARM Linux" <linux@armlinux.org.uk>,
	"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
	nadavh@marvell.com,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Stefan Chulski" <stefanc@marvell.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH net] net: mvneta: fix operation for 64K PAGE_SIZE
Date: Wed, 12 Dec 2018 12:04:58 +0100	[thread overview]
Message-ID: <CAPv3WKd71XBeUo2d7199f-LNs3ZVKOMBDBB69Mtufy_Qr_w81Q@mail.gmail.com> (raw)
In-Reply-To: <20181212172006.0814cf03@xhacker.debian>

Hi Jisheng,

śr., 12 gru 2018 o 10:25 Jisheng Zhang <Jisheng.Zhang@synaptics.com> napisał(a):
>
> Hi Marcin,
>
> On Wed, 12 Dec 2018 09:22:57 +0100 Marcin Wojtas <mw@semihalf.com> wrote:
>
> > Hi Jisheng,
> >
> > śr., 12 gru 2018 o 03:48 Jisheng Zhang <Jisheng.Zhang@synaptics.com> napisał(a):
> > >
> > > Hi,
> > >
> > > On Tue, 11 Dec 2018 13:56:49 +0100 Marcin Wojtas wrote:
> > >
> > > > Recent changes in the mvneta driver reworked allocation
> > > > and handling of the ingress buffers to use entire pages.
> > > > Apart from that in SW BM scenario the HW must be informed
> > > > via PRXDQS about the biggest possible incoming buffer
> > > > that can be propagated by RX descriptors.
> > > >
> > > > The BufferSize field was filled according to the MTU-dependent
> > > > pkt_size value. Later change to PAGE_SIZE broke RX operation
> > > > when usin 64K pages, as the field is simply too small.
> > > >
> > > > This patch conditionally limits the value passed to the BufferSize
> > > > of the PRXDQS register, depending on the PAGE_SIZE used.
> > > > On the occasion remove now unused frag_size field of the mvneta_port
> > > > structure.
> > > >
> > > > Fixes: 562e2f467e71 ("net: mvneta: Improve the buffer allocation
> > > > method for SWBM")
> > >
> > > IMHO, we'd better revert 562e2f467e71 and 7e47fd84b56bb
> > >
> > > The issue commit 562e2f467e71 wants to solve is due to commit 7e47fd84b56bb
> > > It looks a bit wired, to introduce regression then submit another commit(in
> > > the same patch set) solve it
> > >
> > > Per my test, after reverting 562e2f467e71 and 7e47fd84b56bb, I can't reproduce
> > > what's claimed in commit 562e2f467e71 -- "With system having a small memory
> > > (around 256MB), the state "cannot allocate memory to refill with new buffer"
> > > is reach pretty quickly."
> >
> > I am not the one to decide about patch reverting. From what I
> > understand, commit 7e47fd84b56bb was intorduced in order to increase
> > performance thanks to replacing mvneta_frag_alloc/free with using
> > entire pages for RX buffers. I have 2 questions:
> > - without reverting anything, do you observe memory allocation
> > problems during refill?
>
> I see memory waste: For normal 1500 MTU, before commit 7e47fd84b56bb we
> allocate 1920Bytes for rx. After commit 7e47fd84b56bb, we always allocate
> PAGE_SIZE bytes, if PAGE_SIZE=4096, we waste 53% memory for each rx buf.
>
> > - are you able to check L2 forwarding numbers on top of the pure
> > mainline branch and after reverting the mentioned patches? I'm
> > wondering what would be the performance penalty (if any).
>
> I didn't have the numbers. IMHO, when the performance number should
> be put into the commit msg when introducing commit 7e47fd84b56bb.
>

In general I agree with you about the memory waste and lack of numbers
backing the 7e47fd84b56bb change. However the improved refill
mechanism from 562e2f467e71 is something IMO worth to keep, so simple
reverts may not be the best idea. We should focus on dropping the full
page per descriptor dependency - I want to do it, but since it's a
slightly bigger rework, I cannot promise it will happen fast.

Best regards,
Marcin

  reply	other threads:[~2018-12-12 11:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 12:56 [PATCH net] net: mvneta: fix operation for 64K PAGE_SIZE Marcin Wojtas
2018-12-12  2:48 ` Jisheng Zhang
2018-12-12  8:22   ` Marcin Wojtas
2018-12-12  9:25     ` Jisheng Zhang
2018-12-12 11:04       ` Marcin Wojtas [this message]
2018-12-16 20:41 ` David Miller
2018-12-16 23:25   ` Marcin Wojtas
2018-12-17  7:37     ` Thomas Petazzoni
2018-12-19  3:11       ` Jisheng Zhang
2018-12-19  9:24         ` Marcin Wojtas
2018-12-19 10:21           ` Jisheng Zhang

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=CAPv3WKd71XBeUo2d7199f-LNs3ZVKOMBDBB69Mtufy_Qr_w81Q@mail.gmail.com \
    --to=mw@semihalf.com \
    --cc=Jisheng.Zhang@synaptics.com \
    --cc=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=gregory.clement@bootlin.com \
    --cc=jaz@semihalf.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=nadavh@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=stefanc@marvell.com \
    --cc=thomas.petazzoni@bootlin.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).