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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0a0655c04c98c56eceb8ca6bfe4a74507978a4e4.camel@redhat.com>
Date: Tue, 13 Feb 2024 12:12:20 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Shannon Nelson <shannon.nelson@....com>, netdev@...r.kernel.org, 
	davem@...emloft.net, kuba@...nel.org, edumazet@...gle.com
Cc: brett.creeley@....com, drivers@...sando.io
Subject: Re: [PATCH v3 net-next 2/9] ionic: add helpers for accessing buffer
 info

On Fri, 2024-02-09 at 16:48 -0800, Shannon Nelson wrote:
> These helpers clean up some of the code around DMA mapping
> and other buffer references, and will be used in the next
> few patches for the XDP support.
> 
> Signed-off-by: Shannon Nelson <shannon.nelson@....com>
> Reviewed-by: Brett Creeley <brett.creeley@....com>
> ---
>  .../net/ethernet/pensando/ionic/ionic_txrx.c  | 37 ++++++++++++-------
>  1 file changed, 24 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
> index 54cd96b035d6..19a7a8a8e1b3 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
> @@ -88,6 +88,21 @@ static inline struct netdev_queue *q_to_ndq(struct ionic_queue *q)
>  	return netdev_get_tx_queue(q->lif->netdev, q->index);
>  }
>  
> +static inline void *ionic_rx_buf_va(struct ionic_buf_info *buf_info)
> +{
> +	return page_address(buf_info->page) + buf_info->page_offset;
> +}
> +
> +static inline dma_addr_t ionic_rx_buf_pa(struct ionic_buf_info *buf_info)
> +{
> +	return buf_info->dma_addr + buf_info->page_offset;
> +}
> +
> +static inline unsigned int ionic_rx_buf_size(struct ionic_buf_info *buf_info)
> +{
> +	return min_t(u32, IONIC_MAX_BUF_LEN, IONIC_PAGE_SIZE - buf_info->page_offset);
> +}
> +

Plase, no inline functions in c files. This are trivial helpers, you
can keep the inline keyword moving their definition to a local header.

Cheers,

Paolo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ