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] [day] [month] [year] [list]
Message-ID: <5b42afd1-1af2-453c-8260-c40f6abacf94@amd.com>
Date: Tue, 13 Feb 2024 14:04:42 -0800
From: "Nelson, Shannon" <shannon.nelson@....com>
To: Paolo Abeni <pabeni@...hat.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 2/13/2024 3:12 AM, Paolo Abeni wrote:
> 
> 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.

Since these are only ever used in this .c file, perhaps it would be 
better to simply remove the "inline" tag?

sln

> 
> Cheers,
> 
> Paolo
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ