netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/6] net: airoha: npu: Add more wlan NPU callbacks
Date: Fri, 4 Jul 2025 15:51:42 +0100	[thread overview]
Message-ID: <20250704145142.GA41770@horms.kernel.org> (raw)
In-Reply-To: <20250702-airoha-en7581-wlan-offlaod-v1-2-803009700b38@kernel.org>

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@kernel.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?

...

  reply	other threads:[~2025-07-04 14:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-01 22:23 [PATCH net-next 0/6] net: airoha: Introduce NPU callbacks for wlan offloading Lorenzo Bianconi
2025-07-01 22:23 ` [PATCH net-next 1/6] net: airoha: npu: Add NPU wlan memory initialization commands Lorenzo Bianconi
2025-07-04 14:47   ` Simon Horman
2025-07-01 22:23 ` [PATCH net-next 2/6] net: airoha: npu: Add more wlan NPU callbacks Lorenzo Bianconi
2025-07-04 14:51   ` Simon Horman [this message]
2025-07-01 22:23 ` [PATCH net-next 3/6] net: airoha: npu: Add wlan irq management callbacks Lorenzo Bianconi
2025-07-04 14:52   ` Simon Horman
2025-07-01 22:23 ` [PATCH net-next 4/6] net: airoha: npu: Read NPU interrupt lines from the DTS Lorenzo Bianconi
2025-07-04 14:56   ` Simon Horman
2025-07-05  7:39     ` Lorenzo Bianconi
2025-07-01 22:23 ` [PATCH net-next 5/6] net: airoha: npu: Enable core 3 for WiFi offloading Lorenzo Bianconi
2025-07-04 14:52   ` Simon Horman
2025-07-01 22:23 ` [PATCH net-next 6/6] net: airoha: Add airoha_offload.h header Lorenzo Bianconi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250704145142.GA41770@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lorenzo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).