public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat•com>
To: Ivan Khoronzhuk <ivan.khoronzhuk@linaro•org>
Cc: grygorii.strashko@ti•com, davem@davemloft•net, ast@kernel•org,
	linux-kernel@vger•kernel.org, linux-omap@vger•kernel.org,
	xdp-newbies@vger•kernel.org, ilias.apalodimas@linaro•org,
	netdev@vger•kernel.org, daniel@iogearbox•net,
	jakub.kicinski@netronome•com, john.fastabend@gmail•com,
	brouer@redhat•com, Tariq Toukan <tariqt@mellanox•com>
Subject: Re: [PATCH net-next 3/3] net: ethernet: ti: cpsw: add XDP support
Date: Fri, 24 May 2019 13:54:18 +0200	[thread overview]
Message-ID: <20190524135418.5408591e@carbon> (raw)
In-Reply-To: <20190523182035.9283-4-ivan.khoronzhuk@linaro.org>

On Thu, 23 May 2019 21:20:35 +0300
Ivan Khoronzhuk <ivan.khoronzhuk@linaro•org> wrote:

> Add XDP support based on rx page_pool allocator, one frame per page.
> Page pool allocator is used with assumption that only one rx_handler
> is running simultaneously. DMA map/unmap is reused from page pool
> despite there is no need to map whole page.

When using page_pool for DMA-mapping, your XDP-memory model must use
1-page per packet, which you state you do.  This is because
__page_pool_put_page() fallback mode does a __page_pool_clean_page()
unmapping the DMA.  Ilias and I are looking at options for removing this
restriction as Mlx5 would need it (when we extend the SKB to return
pages to page_pool).

Unfortunately, I've found another blocker for drivers using the DMA
mapping feature of page_pool.  We don't properly handle the case, where
a remote TX-driver have xdp_frame's in-flight, and simultaneously the
sending driver is unloaded and take down the page_pool.  Nothing crash,
but we end-up calling put_page() on a page that is still DMA-mapped.

I'm working on different solutions for fixing this, see here:
 https://github.com/xdp-project/xdp-project/blob/master/areas/mem/page_pool03_shutdown_inflight.org
-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

  parent reply	other threads:[~2019-05-24 11:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 18:20 [PATCH net-next 0/3] net: ethernet: ti: cpsw: Add XDP support Ivan Khoronzhuk
2019-05-23 18:20 ` [PATCH net-next 1/3] net: ethernet: ti: davinci_cpdma: add dma mapped submit Ivan Khoronzhuk
2019-05-23 18:20 ` [PATCH net-next 2/3] net: ethernet: ti: davinci_cpdma: return handler status Ivan Khoronzhuk
2019-05-23 18:20 ` [PATCH net-next 3/3] net: ethernet: ti: cpsw: add XDP support Ivan Khoronzhuk
2019-05-24 11:05   ` Ilias Apalodimas
2019-05-27 18:21     ` Ivan Khoronzhuk
2019-05-24 11:54   ` Jesper Dangaard Brouer [this message]
2019-05-27 18:10     ` Ivan Khoronzhuk
2019-05-24 17:49   ` grygorii
2019-05-27 18:29     ` Ivan Khoronzhuk
2019-05-27  7:17   ` Dan Carpenter
2019-05-29  8:16   ` Jesper Dangaard Brouer
2019-05-29  9:58     ` Ivan Khoronzhuk
2019-05-24  9:41 ` [PATCH net-next 0/3] net: ethernet: ti: cpsw: Add " Ilias Apalodimas

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=20190524135418.5408591e@carbon \
    --to=brouer@redhat$(echo .)com \
    --cc=ast@kernel$(echo .)org \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=grygorii.strashko@ti$(echo .)com \
    --cc=ilias.apalodimas@linaro$(echo .)org \
    --cc=ivan.khoronzhuk@linaro$(echo .)org \
    --cc=jakub.kicinski@netronome$(echo .)com \
    --cc=john.fastabend@gmail$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-omap@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=tariqt@mellanox$(echo .)com \
    --cc=xdp-newbies@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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