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: 
 <SJ2PR18MB5635B9F20BB6CE1CC945F3B2A23B2@SJ2PR18MB5635.namprd18.prod.outlook.com>
Date: Thu, 28 Mar 2024 12:06:56 +0000
From: Naveen Mamindlapalli <naveenm@...vell.com>
To: Julien Panis <jpanis@...libre.com>,
        "David S. Miller"
	<davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
	<kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Russell King
	<linux@...linux.org.uk>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann
	<daniel@...earbox.net>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John
 Fastabend <john.fastabend@...il.com>,
        Sumit Semwal <sumit.semwal@...aro.org>,
        Christian König <christian.koenig@....com>,
        Simon Horman
	<horms@...nel.org>, Andrew Lunn <andrew@...n.ch>,
        Ratheesh Kannoth
	<rkannoth@...vell.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
        "linux-media@...r.kernel.org"
	<linux-media@...r.kernel.org>,
        "dri-devel@...ts.freedesktop.org"
	<dri-devel@...ts.freedesktop.org>,
        "linaro-mm-sig@...ts.linaro.org"
	<linaro-mm-sig@...ts.linaro.org>
Subject: RE: [PATCH net-next v5 1/3] net: ethernet: ti: Add accessors for
 struct k3_cppi_desc_pool members


> -----Original Message-----
> From: Julien Panis <jpanis@...libre.com>
> Sent: Thursday, March 28, 2024 2:57 PM
> To: David S. Miller <davem@...emloft.net>; Eric Dumazet
> <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo Abeni
> <pabeni@...hat.com>; Russell King <linux@...linux.org.uk>; Alexei Starovoitov
> <ast@...nel.org>; Daniel Borkmann <daniel@...earbox.net>; Jesper Dangaard
> Brouer <hawk@...nel.org>; John Fastabend <john.fastabend@...il.com>;
> Sumit Semwal <sumit.semwal@...aro.org>; Christian König
> <christian.koenig@....com>; Simon Horman <horms@...nel.org>; Andrew
> Lunn <andrew@...n.ch>; Ratheesh Kannoth <rkannoth@...vell.com>
> Cc: netdev@...r.kernel.org; linux-kernel@...r.kernel.org; bpf@...r.kernel.org;
> linux-media@...r.kernel.org; dri-devel@...ts.freedesktop.org; linaro-mm-
> sig@...ts.linaro.org; Julien Panis <jpanis@...libre.com>
> Subject: [PATCH net-next v5 1/3] net: ethernet: ti: Add accessors
> for struct k3_cppi_desc_pool members
> 
> This patch adds accessors for desc_size and cpumem members. They may be
> used, for instance, to compute a descriptor index.
> 
> Signed-off-by: Julien Panis <jpanis@...libre.com>
> ---
>  drivers/net/ethernet/ti/k3-cppi-desc-pool.c | 12 ++++++++++++
> drivers/net/ethernet/ti/k3-cppi-desc-pool.h |  2 ++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c b/drivers/net/ethernet/ti/k3-
> cppi-desc-pool.c
> index 05cc7aab1ec8..fe8203c05731 100644
> --- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c
> +++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c
> @@ -132,5 +132,17 @@ size_t k3_cppi_desc_pool_avail(struct
> k3_cppi_desc_pool *pool)  }  EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_avail);
> 
> +size_t k3_cppi_desc_pool_desc_size(struct k3_cppi_desc_pool *pool) {
> +	return pool->desc_size;

Don't you need to add NULL check on pool ptr since this function is exported?

> +}
> +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_desc_size);
> +
> +void *k3_cppi_desc_pool_cpuaddr(struct k3_cppi_desc_pool *pool) {
> +	return pool->cpumem;

Same here.

> +}
> +EXPORT_SYMBOL_GPL(k3_cppi_desc_pool_cpuaddr);
> +
>  MODULE_LICENSE("GPL");
>  MODULE_DESCRIPTION("TI K3 CPPI5 descriptors pool API"); diff --git
> a/drivers/net/ethernet/ti/k3-cppi-desc-pool.h b/drivers/net/ethernet/ti/k3-cppi-desc-
> pool.h
> index a7e3fa5e7b62..149d5579a5e2 100644
> --- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.h
> +++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.h
> @@ -26,5 +26,7 @@ k3_cppi_desc_pool_dma2virt(struct k3_cppi_desc_pool
> *pool, dma_addr_t dma);  void *k3_cppi_desc_pool_alloc(struct
> k3_cppi_desc_pool *pool);  void k3_cppi_desc_pool_free(struct
> k3_cppi_desc_pool *pool, void *addr);  size_t k3_cppi_desc_pool_avail(struct
> k3_cppi_desc_pool *pool);
> +size_t k3_cppi_desc_pool_desc_size(struct k3_cppi_desc_pool *pool);
> +void *k3_cppi_desc_pool_cpuaddr(struct k3_cppi_desc_pool *pool);
> 
>  #endif /* K3_CPPI_DESC_POOL_H_ */
> 
> --
> 2.37.3
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ