All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Cc: grygorii.strashko@ti.com, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	hawk@kernel.org, xdp-newbies@vger.kernel.org, ast@kernel.org,
	aniel@iogearbox.net, jakub.kicinski@netronome.com,
	john.fastabend@gmail.com
Subject: Re: [RFC PATCH 3/3] net: ethernet: ti: cpsw: add XDP support
Date: Fri, 19 Apr 2019 11:31:56 +0300	[thread overview]
Message-ID: <20190419083156.GA6687@apalos> (raw)
In-Reply-To: <20190417174942.11811-4-ivan.khoronzhuk@linaro.org>

Hi Ivan, 

> +static struct page *cpsw_alloc_page(struct cpsw_common *cpsw)
> +{
> +	struct page_pool *pool = cpsw->rx_page_pool;
> +	struct page *page;
> +	int i = 0;
> +
> +	do {
> +		page = page_pool_dev_alloc_pages(pool);
> +		if (!page)
> +			return NULL;
> +
> +		/* skip pages used by skb netstack */
I think the comment here is wrong and might confuse people.
The page ref cnt is 1, which means the packet was *processed* and netstack is
done with it, hence you can re-use it.
If it's !=1 then you correctly unmap the buffer and decrease the ref cnt, so it
will eventually be freed and not returned to the pool, right?
> +		if (page_ref_count(page) == 1)
> +			break;
> +
> +		/* it's a pitty, but free page */
> +		page_pool_recycle_direct(pool, page);
> +	} while (++i < descs_pool_size);
> +
> +	return page;
> +}
> +
 
 /Ilias

  parent reply	other threads:[~2019-04-19  8:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17 17:49 [RFC PATCH 0/3] net: ethernet: ti: cpsw: Add XDP support Ivan Khoronzhuk
2019-04-17 17:49 ` [RFC PATCH 1/3] net: ethernet: ti: davinci_cpdma: add dma mapped submit Ivan Khoronzhuk
2019-04-17 17:49 ` [RFC PATCH 2/3] net: ethernet: ti: davinci_cpdma: return handler status Ivan Khoronzhuk
2019-04-17 17:49 ` [RFC PATCH 3/3] net: ethernet: ti: cpsw: add XDP support Ivan Khoronzhuk
2019-04-17 22:46   ` Jakub Kicinski
2019-04-18  9:40     ` Ivan Khoronzhuk
2019-04-18 17:41       ` Jakub Kicinski
2019-04-18 18:30         ` Ivan Khoronzhuk
2019-04-18 18:30           ` Ivan Khoronzhuk
2019-04-18 18:44           ` Jakub Kicinski
2019-04-19  8:31   ` Ilias Apalodimas [this message]
2019-04-19 10:42     ` Ivan Khoronzhuk
2019-04-18  6:12 ` [RFC PATCH 0/3] net: ethernet: ti: cpsw: Add " Björn Töpel
2019-04-18  9:47   ` Ivan Khoronzhuk
2019-04-19  8:24 ` Grygorii Strashko
2019-04-19  8:24   ` Grygorii Strashko

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=20190419083156.GA6687@apalos \
    --to=ilias.apalodimas@linaro.org \
    --cc=aniel@iogearbox.net \
    --cc=ast@kernel.org \
    --cc=grygorii.strashko@ti.com \
    --cc=hawk@kernel.org \
    --cc=ivan.khoronzhuk@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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.