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: <20250704145142.GA41770@horms.kernel.org>
Date: Fri, 4 Jul 2025 15:51:42 +0100
From: Simon Horman <horms@...nel.org>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	linux-arm-kernel@...ts.infradead.org,
	linux-mediatek@...ts.infradead.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/6] net: airoha: npu: Add more wlan NPU
 callbacks

On Wed, Jul 02, 2025 at 12:23:31AM +0200, Lorenzo Bianconi wrote:
> Introduce more NPU wlan callbacks used by wlan driver (MT76) to initialize
> NPU module register for offloading wireless-wired offloading.
> This is a preliminary patch to enable wlan flowtable offload for EN7581
> SoC with MT76 driver.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>

...

> diff --git a/drivers/net/ethernet/airoha/airoha_npu.h b/drivers/net/ethernet/airoha/airoha_npu.h
> index 242f0d15b2f7c262daaf7bb78ee386ccc8a0433d..9fdec469e7b0e7caa5d988dfd78578d860a0e66d 100644
> --- a/drivers/net/ethernet/airoha/airoha_npu.h
> +++ b/drivers/net/ethernet/airoha/airoha_npu.h
> @@ -30,6 +30,27 @@ struct airoha_npu {
>  					    u32 entry_size, u32 hash,
>  					    bool ppe2);
>  		int (*wlan_init_reserved_memory)(struct airoha_npu *npu);
> +		int (*wlan_set_txrx_reg_addr)(struct airoha_npu *npu,
> +					      int ifindex, u32 dir,
> +					      u32 in_counter_addr,
> +					      u32 out_status_addr,
> +					      u32 out_counter_addr);
> +		int (*wlan_set_pcie_port_type)(struct airoha_npu *npu,
> +					       int ifindex, u32 port_type);
> +		int (*wlan_set_pcie_addr)(struct airoha_npu *npu, int ifindex,
> +					  u32 addr);
> +		int (*wlan_set_desc)(struct airoha_npu *npu, int ifindex,
> +				     u32 desc);
> +		int (*wlan_set_tx_ring_pcie_addr)(struct airoha_npu *npu,
> +						  int ifindex, u32 addr);
> +		int (*wlan_get_rx_desc_base)(struct airoha_npu *npu,
> +					     int ifindex, u32 *data);
> +		int (*wlan_set_tx_buf_space_base)(struct airoha_npu *npu,
> +						  int ifindex, u32 addr);
> +		int (*wlan_set_rx_ring_for_txdone)(struct airoha_npu *npu,
> +						   int ifindex, u32 addr);
> +		u32 (*wlan_get_queue_addr)(struct airoha_npu *npu, int qid,
> +					   bool xmit);

Hi Lorenzo,

It seems that the implementation in this patch of
most (all?) of the callbacks are trivial wrapper around
airoha_npu_wlan_send_msg(). Which provide a named callback to callers.

It seems to me that a different approach would be to provide a
wlan_send_msg() callback (name could be different, of course),
and have callers pass the _wlan_send_msg(). Which for one thing,
seems far less verbose in this driver.

Could you comment on these different approaches?

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ