From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: netdev@vger.kernel.org, lorenzo.bianconi@redhat.com,
davem@davemloft.net, thomas.petazzoni@bootlin.com,
brouer@redhat.com, ilias.apalodimas@linaro.org,
matteo.croce@redhat.com, mw@semihalf.com
Subject: Re: [PATCH v3 net-next 2/8] net: mvneta: introduce page pool API for sw buffer manager
Date: Wed, 16 Oct 2019 10:32:54 +0200 [thread overview]
Message-ID: <20191016083254.GA2638@localhost.localdomain> (raw)
In-Reply-To: <20191015154107.08c4e9e1@cakuba.netronome.com>
[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]
> On Mon, 14 Oct 2019 12:49:49 +0200, Lorenzo Bianconi wrote:
> > +static int mvneta_create_page_pool(struct mvneta_port *pp,
> > + struct mvneta_rx_queue *rxq, int size)
> > +{
> > + struct page_pool_params pp_params = {
> > + .order = 0,
> > + .flags = PP_FLAG_DMA_MAP,
> > + .pool_size = size,
> > + .nid = cpu_to_node(0),
> > + .dev = pp->dev->dev.parent,
> > + .dma_dir = DMA_FROM_DEVICE,
> > + };
> > + int err;
> > +
> > + rxq->page_pool = page_pool_create(&pp_params);
> > + if (IS_ERR(rxq->page_pool)) {
> > + err = PTR_ERR(rxq->page_pool);
> > + rxq->page_pool = NULL;
> > + return err;
> > + }
> > +
> > + err = xdp_rxq_info_reg(&rxq->xdp_rxq, pp->dev, 0);
>
> The queue_index is always passed as 0, is there only a single queue?
> XDP programs can read this field.
Hi Jakub,
thx for the review. You are right, I will fix it in v4.
Regards,
Lorenzo
>
> > + if (err < 0)
> > + goto err_free_pp;
> > +
> > + err = xdp_rxq_info_reg_mem_model(&rxq->xdp_rxq, MEM_TYPE_PAGE_POOL,
> > + rxq->page_pool);
> > + if (err)
> > + goto err_unregister_rxq;
> > +
> > + return 0;
> > +
> > +err_unregister_rxq:
> > + xdp_rxq_info_unreg(&rxq->xdp_rxq);
> > +err_free_pp:
> > + page_pool_destroy(rxq->page_pool);
> > + return err;
> > +}
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2019-10-16 8:33 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-14 10:49 [PATCH v3 net-next 0/8] add XDP support to mvneta driver Lorenzo Bianconi
2019-10-14 10:49 ` [PATCH v3 net-next 1/8] net: mvneta: introduce mvneta_update_stats routine Lorenzo Bianconi
2019-10-14 10:49 ` [PATCH v3 net-next 2/8] net: mvneta: introduce page pool API for sw buffer manager Lorenzo Bianconi
2019-10-15 22:41 ` Jakub Kicinski
2019-10-16 8:32 ` Lorenzo Bianconi [this message]
2019-10-14 10:49 ` [PATCH v3 net-next 3/8] net: mvneta: rely on build_skb in mvneta_rx_swbm poll routine Lorenzo Bianconi
2019-10-14 10:49 ` [PATCH v3 net-next 4/8] net: mvneta: sync dma buffers before refilling hw queues Lorenzo Bianconi
2019-10-15 23:01 ` Jakub Kicinski
2019-10-16 9:09 ` Lorenzo Bianconi
2019-10-14 10:49 ` [PATCH v3 net-next 5/8] net: mvneta: add basic XDP support Lorenzo Bianconi
2019-10-14 12:48 ` Jesper Dangaard Brouer
2019-10-14 13:27 ` Lorenzo Bianconi
2019-10-15 23:20 ` Jakub Kicinski
2019-10-16 8:39 ` Lorenzo Bianconi
2019-10-14 10:49 ` [PATCH v3 net-next 6/8] net: mvneta: move header prefetch in mvneta_swbm_rx_frame Lorenzo Bianconi
2019-10-14 10:49 ` [PATCH v3 net-next 7/8] net: mvneta: make tx buffer array agnostic Lorenzo Bianconi
2019-10-16 0:03 ` Jakub Kicinski
2019-10-16 8:18 ` Ilias Apalodimas
2019-10-14 10:49 ` [PATCH v3 net-next 8/8] net: mvneta: add XDP_TX support Lorenzo Bianconi
2019-10-16 0:11 ` Jakub Kicinski
2019-10-16 10:09 ` Lorenzo Bianconi
2019-10-16 10:55 ` Ilias Apalodimas
2019-10-16 11:16 ` Jesper Dangaard Brouer
2019-10-16 12:00 ` Lorenzo Bianconi
2019-10-16 16:27 ` Jakub Kicinski
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=20191016083254.GA2638@localhost.localdomain \
--to=lorenzo@kernel.org \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=ilias.apalodimas@linaro.org \
--cc=jakub.kicinski@netronome.com \
--cc=lorenzo.bianconi@redhat.com \
--cc=matteo.croce@redhat.com \
--cc=mw@semihalf.com \
--cc=netdev@vger.kernel.org \
--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).