linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
To: Saeed Mahameed <saeedm@mellanox.com>
Cc: "brouer@redhat.com" <brouer@redhat.com>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
	"ilias.apalodimas@linaro.org" <ilias.apalodimas@linaro.org>,
	"grygorii.strashko@ti.com" <grygorii.strashko@ti.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"ast@kernel.org" <ast@kernel.org>,
	"hawk@kernel.org" <hawk@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"jakub.kicinski@netronome.com" <jakub.kicinski@netronome.com>
Subject: Re: [PATCH v2 net-next 7/7] net: ethernet: ti: cpsw: add XDP support
Date: Sat, 1 Jun 2019 02:00:10 +0300	[thread overview]
Message-ID: <20190531230008.GA15675@khorivan> (raw)
In-Reply-To: <a65de3a257ab5ebec83e817c092f074b58b9ae47.camel@mellanox.com>

On Fri, May 31, 2019 at 10:08:03PM +0000, Saeed Mahameed wrote:
>On Fri, 2019-05-31 at 20:03 +0300, Ivan Khoronzhuk wrote:
>> On Fri, May 31, 2019 at 06:32:41PM +0200, Jesper Dangaard Brouer
>> wrote:
>> > On Fri, 31 May 2019 19:25:24 +0300 Ivan Khoronzhuk <
>> > ivan.khoronzhuk@linaro.org> wrote:
>> >
>> > > On Fri, May 31, 2019 at 05:46:43PM +0200, Jesper Dangaard Brouer
>> > > wrote:
>> > > > From below code snippets, it looks like you only allocated 1
>> > > > page_pool
>> > > > and sharing it with several RX-queues, as I don't have the full
>> > > > context
>> > > > and don't know this driver, I might be wrong?
>> > > >
>> > > > To be clear, a page_pool object is needed per RX-queue, as it
>> > > > is
>> > > > accessing a small RX page cache (which protected by
>> > > > NAPI/softirq).
>> > >
>> > > There is one RX interrupt and one RX NAPI for all rx channels.
>> >
>> > So, what are you saying?
>> >
>> > You _are_ sharing the page_pool between several RX-channels, but it
>> > is
>> > safe because this hardware only have one RX interrupt + NAPI
>> > instance??
>>
>> I can miss smth but in case of cpsw technically it means:
>> 1) RX interrupts are disabled while NAPI is scheduled,
>>    not for particular CPU or channel, but at all, for whole cpsw
>> module.
>> 2) RX channels are handled one by one by priority.
>
>Hi Ivan, I got a silly question..
>
>What is the reason behind having multiple RX rings and one CPU/NAPI
>handling all of them ? priority ? how do you priorities ?
Several.
One of the reason, from what I know, it can handle for several cpus/napi but
because of errata on some SoCs or for all of them it was discarded, but idea was
it can. Second it uses same davinci_cpdma API as tx channels that can be rate
limited, and it's used not only by cpsw but also by other driver, so can't be
modified easily and no reason. And third one, h/w has ability to steer some
filtered traffic to rx queues and can be potentially configured with ethtool
ntuples or so, but it's not implemented....yet.

>
>> 3) After all of them handled and no more in budget - interrupts are
>> enabled.
>> 4) If page is returned to the pool, and it's within NAPI, no races as
>> it's
>>    returned protected by softirq. If it's returned not in softirq
>> it's protected
>>    by producer lock of the ring.
>>
>> Probably it's not good example for others how it should be used, not
>> a big
>> problem to move it to separate pools.., even don't remember why I
>> decided to
>> use shared pool, there was some more reasons... need search in
>> history.
>>
>> > --
>> > Best regards,
>> >  Jesper Dangaard Brouer
>> >  MSc.CS, Principal Kernel Engineer at Red Hat
>> >  LinkedIn: http://www.linkedin.com/in/brouer

-- 
Regards,
Ivan Khoronzhuk

  reply	other threads:[~2019-05-31 23:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 18:20 [PATCH v2 net-next 0/7] net: ethernet: ti: cpsw: Add XDP support Ivan Khoronzhuk
2019-05-30 18:20 ` [PATCH v2 net-next 1/7] net: page_pool: add helper function to retrieve dma addresses Ivan Khoronzhuk
2019-05-30 18:20 ` [PATCH v2 net-next 2/7] net: page_pool: add helper function to unmap " Ivan Khoronzhuk
2019-05-30 18:20 ` [PATCH v2 net-next 3/7] net: ethernet: ti: cpsw: use cpsw as drv data Ivan Khoronzhuk
2019-06-01 10:49   ` grygorii
2019-05-30 18:20 ` [PATCH v2 net-next 4/7] net: ethernet: ti: cpsw_ethtool: simplify slave loops Ivan Khoronzhuk
2019-06-01 10:55   ` grygorii
2019-05-30 18:20 ` [PATCH v2 net-next 5/7] net: ethernet: ti: davinci_cpdma: add dma mapped submit Ivan Khoronzhuk
2019-05-30 18:20 ` [PATCH v2 net-next 6/7] net: ethernet: ti: davinci_cpdma: return handler status Ivan Khoronzhuk
2019-05-30 18:20 ` [PATCH v2 net-next 7/7] net: ethernet: ti: cpsw: add XDP support Ivan Khoronzhuk
2019-05-31 15:46   ` Jesper Dangaard Brouer
2019-05-31 16:25     ` Ivan Khoronzhuk
2019-05-31 16:32       ` Jesper Dangaard Brouer
2019-05-31 17:03         ` Ivan Khoronzhuk
2019-05-31 22:08           ` Saeed Mahameed
2019-05-31 23:00             ` Ivan Khoronzhuk [this message]
2019-05-31 22:37           ` Jesper Dangaard Brouer
2019-05-31 23:27             ` Ivan Khoronzhuk

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=20190531230008.GA15675@khorivan \
    --to=ivan.khoronzhuk@linaro.org \
    --cc=ast@kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=grygorii.strashko@ti.com \
    --cc=hawk@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=xdp-newbies@vger.kernel.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).