mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] net: mana: Use the HWC destination queues reported by the hardware
@ 2026-09-03 18:41 Manish Awasthi
  2026-09-03 18:48 ` Long Li
  2026-09-03 19:09 ` Haiyang Zhang
  0 siblings, 2 replies; 3+ messages in thread
From: Manish Awasthi @ 2026-09-03 18:41 UTC (permalink / raw)
  To: kys, haiyangz, wei.liu, decui, longli, andrew+netdev, davem,
	edumazet, kuba, pabeni
  Cc: linux-hyperv, netdev, linux-kernel, horms, gargaditya, ernis,
	kees, paulros

mana_hwc_send_request() gates the HWC destination queue IDs on
gc->is_pf, which the PCI probe derives from the device ID.

The gate is not needed. hwc->pf_dest_vrq_id and hwc->pf_dest_vrcq_id
are only ever assigned from the HWC_INIT_DATA_PF_DEST_RQ_ID and
HWC_INIT_DATA_PF_DEST_CQ_ID init events, and the hardware always
reports values that are valid for the function it sends them to.

Signed-off-by: Manish Awasthi <mawasthi@linux.microsoft.com>
---
 drivers/net/ethernet/microsoft/mana/hw_channel.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/microsoft/mana/hw_channel.c b/drivers/net/ethernet/microsoft/mana/hw_channel.c
index 263e7c4e2934..5d75c2478a8a 100644
--- a/drivers/net/ethernet/microsoft/mana/hw_channel.c
+++ b/drivers/net/ethernet/microsoft/mana/hw_channel.c
@@ -855,13 +855,12 @@ void mana_hwc_destroy_channel(struct gdma_context *gc)
 int mana_hwc_send_request(struct hw_channel_context *hwc, u32 req_len,
 			  const void *req, u32 resp_len, void *resp)
 {
-	struct gdma_context *gc = hwc->gdma_dev->gdma_context;
 	struct hwc_work_request *tx_wr;
 	struct hwc_wq *txq = hwc->txq;
 	struct gdma_req_hdr *req_msg;
 	struct hwc_caller_ctx *ctx;
-	u32 dest_vrcq = 0;
-	u32 dest_vrq = 0;
+	u32 dest_vrcq;
+	u32 dest_vrq;
 	u32 command;
 	u16 msg_id;
 	int err;
@@ -890,10 +889,13 @@ int mana_hwc_send_request(struct hw_channel_context *hwc, u32 req_len,
 	tx_wr->msg_size = req_len;
 	command = req_msg->req.msg_type;
 
-	if (gc->is_pf) {
-		dest_vrq = hwc->pf_dest_vrq_id;
-		dest_vrcq = hwc->pf_dest_vrcq_id;
-	}
+	/* The hardware reports the HWC destination queues through
+	 * HWC_INIT_DATA_PF_DEST_RQ_ID and HWC_INIT_DATA_PF_DEST_CQ_ID, and
+	 * always supplies values that are valid for this function, so no
+	 * PF-specific handling is needed here.
+	 */
+	dest_vrq = hwc->pf_dest_vrq_id;
+	dest_vrcq = hwc->pf_dest_vrcq_id;
 
 	err = mana_hwc_post_tx_wqe(txq, tx_wr, dest_vrq, dest_vrcq, false);
 	if (err) {

base-commit: 1b78070aaef63512688aebfbc82365ef9d6660f1
-- 
2.54.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH net-next] net: mana: Use the HWC destination queues reported by the hardware
  2026-09-03 18:41 [PATCH net-next] net: mana: Use the HWC destination queues reported by the hardware Manish Awasthi
@ 2026-09-03 18:48 ` Long Li
  2026-09-03 19:09 ` Haiyang Zhang
  1 sibling, 0 replies; 3+ messages in thread
From: Long Li @ 2026-09-03 18:48 UTC (permalink / raw)
  To: Manish Awasthi, KY Srinivasan, Haiyang Zhang, wei.liu,
	Dexuan Cui, andrew+netdev, davem, edumazet, kuba, pabeni
  Cc: linux-hyperv, netdev, linux-kernel, horms, gargaditya, ernis,
	kees, Paul Rosswurm


> mana_hwc_send_request() gates the HWC destination queue IDs on
> gc->is_pf, which the PCI probe derives from the device ID.
> 
> The gate is not needed. hwc->pf_dest_vrq_id and hwc->pf_dest_vrcq_id are
> only ever assigned from the HWC_INIT_DATA_PF_DEST_RQ_ID and
> HWC_INIT_DATA_PF_DEST_CQ_ID init events, and the hardware always
> reports values that are valid for the function it sends them to.
> 
> Signed-off-by: Manish Awasthi <mawasthi@linux.microsoft.com>

Reviewed-by: Long Li <longli@microsoft.com>



> ---
>  drivers/net/ethernet/microsoft/mana/hw_channel.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microsoft/mana/hw_channel.c
> b/drivers/net/ethernet/microsoft/mana/hw_channel.c
> index 263e7c4e2934..5d75c2478a8a 100644
> --- a/drivers/net/ethernet/microsoft/mana/hw_channel.c
> +++ b/drivers/net/ethernet/microsoft/mana/hw_channel.c
> @@ -855,13 +855,12 @@ void mana_hwc_destroy_channel(struct
> gdma_context *gc)  int mana_hwc_send_request(struct hw_channel_context
> *hwc, u32 req_len,
>  			  const void *req, u32 resp_len, void *resp)  {
> -	struct gdma_context *gc = hwc->gdma_dev->gdma_context;
>  	struct hwc_work_request *tx_wr;
>  	struct hwc_wq *txq = hwc->txq;
>  	struct gdma_req_hdr *req_msg;
>  	struct hwc_caller_ctx *ctx;
> -	u32 dest_vrcq = 0;
> -	u32 dest_vrq = 0;
> +	u32 dest_vrcq;
> +	u32 dest_vrq;
>  	u32 command;
>  	u16 msg_id;
>  	int err;
> @@ -890,10 +889,13 @@ int mana_hwc_send_request(struct
> hw_channel_context *hwc, u32 req_len,
>  	tx_wr->msg_size = req_len;
>  	command = req_msg->req.msg_type;
> 
> -	if (gc->is_pf) {
> -		dest_vrq = hwc->pf_dest_vrq_id;
> -		dest_vrcq = hwc->pf_dest_vrcq_id;
> -	}
> +	/* The hardware reports the HWC destination queues through
> +	 * HWC_INIT_DATA_PF_DEST_RQ_ID and
> HWC_INIT_DATA_PF_DEST_CQ_ID, and
> +	 * always supplies values that are valid for this function, so no
> +	 * PF-specific handling is needed here.
> +	 */
> +	dest_vrq = hwc->pf_dest_vrq_id;
> +	dest_vrcq = hwc->pf_dest_vrcq_id;
> 
>  	err = mana_hwc_post_tx_wqe(txq, tx_wr, dest_vrq, dest_vrcq, false);
>  	if (err) {
> 
> base-commit: 1b78070aaef63512688aebfbc82365ef9d6660f1
> --
> 2.54.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH net-next] net: mana: Use the HWC destination queues reported by the hardware
  2026-09-03 18:41 [PATCH net-next] net: mana: Use the HWC destination queues reported by the hardware Manish Awasthi
  2026-09-03 18:48 ` Long Li
@ 2026-09-03 19:09 ` Haiyang Zhang
  1 sibling, 0 replies; 3+ messages in thread
From: Haiyang Zhang @ 2026-09-03 19:09 UTC (permalink / raw)
  To: Manish Awasthi, KY Srinivasan, wei.liu, Dexuan Cui, Long Li,
	andrew+netdev, davem, edumazet, kuba, pabeni
  Cc: linux-hyperv, netdev, linux-kernel, horms, gargaditya, ernis,
	kees, Paul Rosswurm



> -----Original Message-----
> From: Manish Awasthi <mawasthi@linux.microsoft.com>
> Sent: Thursday, September 3, 2026 2:41 PM
> To: KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; wei.liu@kernel.org; Dexuan Cui
> <DECUI@microsoft.com>; Long Li <longli@microsoft.com>;
> andrew+netdev@lunn.ch; davem@davemloft.net; edumazet@google.com;
> kuba@kernel.org; pabeni@redhat.com
> Cc: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; horms@kernel.org; gargaditya@linux.microsoft.com;
> ernis@linux.microsoft.com; kees@kernel.org; Paul Rosswurm
> <paulros@microsoft.com>
> Subject: [PATCH net-next] net: mana: Use the HWC destination queues
> reported by the hardware
> 
> mana_hwc_send_request() gates the HWC destination queue IDs on
> gc->is_pf, which the PCI probe derives from the device ID.
> 
> The gate is not needed. hwc->pf_dest_vrq_id and hwc->pf_dest_vrcq_id
> are only ever assigned from the HWC_INIT_DATA_PF_DEST_RQ_ID and
> HWC_INIT_DATA_PF_DEST_CQ_ID init events, and the hardware always
> reports values that are valid for the function it sends them to.
> 
> Signed-off-by: Manish Awasthi <mawasthi@linux.microsoft.com>

Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-03 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-03 18:41 [PATCH net-next] net: mana: Use the HWC destination queues reported by the hardware Manish Awasthi
2026-09-03 18:48 ` Long Li
2026-09-03 19:09 ` Haiyang Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®