netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: netdev@vger.kernel.org, jaswinder.singh@linaro.org,
	ard.biesheuvel@linaro.org, bjorn.topel@intel.com,
	magnus.karlsson@intel.com, daniel@iogearbox.net, ast@kernel.org,
	makita.toshiaki@lab.ntt.co.jp, jakub.kicinski@netronome.com,
	john.fastabend@gmail.com, davem@davemloft.net
Subject: Re: [RFC, PATCH 1/2, net-next] net: netsec: Use page_pool API
Date: Thu, 27 Jun 2019 12:40:26 +0300	[thread overview]
Message-ID: <20190627094026.GA21962@apalos> (raw)
In-Reply-To: <20190627113708.67a8575a@carbon>

Hi Jepser, 

> On Tue, 25 Jun 2019 18:06:18 +0300
> Ilias Apalodimas <ilias.apalodimas@linaro.org> wrote:
> 
> > @@ -1059,7 +1059,23 @@ static void netsec_setup_tx_dring(struct netsec_priv *priv)
> >  static int netsec_setup_rx_dring(struct netsec_priv *priv)
> >  {
> >  	struct netsec_desc_ring *dring = &priv->desc_ring[NETSEC_RING_RX];
> > -	int i;
> > +	struct page_pool_params pp_params = { 0 };
> > +	int i, err;
> > +
> > +	pp_params.order = 0;
> > +	/* internal DMA mapping in page_pool */
> > +	pp_params.flags = PP_FLAG_DMA_MAP;
> > +	pp_params.pool_size = DESC_NUM;
> > +	pp_params.nid = cpu_to_node(0);
> > +	pp_params.dev = priv->dev;
> > +	pp_params.dma_dir = DMA_FROM_DEVICE;
> 
> I was going to complain about this DMA_FROM_DEVICE, until I noticed
> that in next patch you have:
> 
>  pp_params.dma_dir = xdp_prog ? DMA_BIDIRECTIONAL : DMA_FROM_DEVICE;
True. Since the first patch only adds page_pool support, i wanted to be clear
that DMA_BIDIRECTIONAL is only needed for XDP use cases (and especially XDP_TX)

> 
> Making a note here to help other reviewers.
Thanks

> 
> > +	dring->page_pool = page_pool_create(&pp_params);
> > +	if (IS_ERR(dring->page_pool)) {
> > +		err = PTR_ERR(dring->page_pool);
> > +		dring->page_pool = NULL;
> > +		goto err_out;
> > +	}
> >  

Cheers
/Ilias

  reply	other threads:[~2019-06-27  9:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25 15:06 [RFC, PATCH 0/2, net-next] net: netsec: Add XDP Support Ilias Apalodimas
2019-06-25 15:06 ` [RFC, PATCH 1/2, net-next] net: netsec: Use page_pool API Ilias Apalodimas
2019-06-27  9:37   ` Jesper Dangaard Brouer
2019-06-27  9:40     ` Ilias Apalodimas [this message]
2019-06-25 15:06 ` [RFC, PATCH 2/2, net-next] net: netsec: add XDP support Ilias Apalodimas
2019-06-27 12:23   ` Jesper Dangaard Brouer
2019-06-27 12:24     ` Ilias Apalodimas
2019-06-27 14:18   ` Maciej Fijalkowski
2019-06-28  6:54     ` 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=20190627094026.GA21962@apalos \
    --to=ilias.apalodimas@linaro.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=john.fastabend@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=makita.toshiaki@lab.ntt.co.jp \
    --cc=netdev@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).