lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190628150701.383b17f6@carbon>
Date:   Fri, 28 Jun 2019 15:07:01 +0200
From:   Jesper Dangaard Brouer <brouer@...hat.com>
To:     Ilias Apalodimas <ilias.apalodimas@...aro.org>
Cc:     netdev@...r.kernel.org, jaswinder.singh@...aro.org,
        ard.biesheuvel@...aro.org, bjorn.topel@...el.com,
        magnus.karlsson@...el.com, daniel@...earbox.net, ast@...nel.org,
        makita.toshiaki@....ntt.co.jp, jakub.kicinski@...ronome.com,
        john.fastabend@...il.com, davem@...emloft.net,
        maciejromanfijalkowski@...il.com, brouer@...hat.com
Subject: Re: [PATCH 2/3, net-next] net: page_pool: add helper function for
 retrieving dma direction

On Fri, 28 Jun 2019 13:39:14 +0300
Ilias Apalodimas <ilias.apalodimas@...aro.org> wrote:

> Since the dma direction is stored in page pool params, offer an API
> helper for driver that choose not to keep track of it locally
> 
> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@...aro.org>
> ---
>  include/net/page_pool.h | 9 +++++++++
>  1 file changed, 9 insertions(+)

Acked-by: Jesper Dangaard Brouer <brouer@...hat.com>

This is simple enough and you also explained the downside.
Thanks for adding a helper for this.

 
> diff --git a/include/net/page_pool.h b/include/net/page_pool.h
> index f07c518ef8a5..ee9c871d2043 100644
> --- a/include/net/page_pool.h
> +++ b/include/net/page_pool.h
> @@ -112,6 +112,15 @@ static inline struct page *page_pool_dev_alloc_pages(struct page_pool *pool)
>  	return page_pool_alloc_pages(pool, gfp);
>  }
>  
> +/* get the stored dma direction. A driver might decide to treat this locally and
> + * avoid the extra cache line from page_pool to determine the direction
> + */
> +static
> +inline enum dma_data_direction page_pool_get_dma_dir(struct page_pool *pool)
> +{
> +	return pool->p.dma_dir;
> +}
> +
>  struct page_pool *page_pool_create(const struct page_pool_params *params);
>  
>  void __page_pool_free(struct page_pool *pool);


-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ