net: mana: concurrent HWC requests and dynamic queue depth
Subsystems (5)
v11 cover net: mana: concurrent HWC requests and dynamic queue depth
This is v11 of Long Li's four-patch HWC series. I am carrying the series forward with review fixes and integration work. Original authorship and sign-offs are retained.
The series supports concurrent requests over the MANA hardware channel and rebuilds its queues using the queue depth and message sizes required by the PF. It prepares ownership and teardown, gives each message its own completion, adds concurrent request tracking, and enables dynamic sizing.
Changes since v10:
- Rebase onto current net-next, including Erni Sri Satya Vennela's 6964ff21c5d8 ("net: mana: Allocate queue MSI-X vectors on demand"). Preserve the upstream allocation, affinity and shared-vector behavior.
- Distinguish a local HWC rejection from a command posted and then timed out. Propagate that distinction through GDMA, Ethernet and RDMA cleanup so a destroy that could not be sent does not release device-owned queue memory, RX pages or RDMA pins. Retain relevant EQ/MSI-X references.
- Cover failed creation unwinds, transferred queue ownership and partial multi-command DMA regions. Preserve verbs dependencies on rejection and avoid repeating acknowledged RSS WQ destroys during a partial retry. Keep previously retained CQ callback state until destruction succeeds.
- Wait on a full mixed pool while a healthy occupied slot can still make progress, rather than failing merely because another slot was abandoned. Keep quarantine, stop/cancellation wakeups and available-slot behavior.
- Preserve the specific private-bootstrap EQ-test failure diagnostic and initialize the context drain waitqueue once in PCI/CDX probe.
- Correct the stale WARN and teardown/RCU comments. Add original-driver Fixes lineage and dependency-complete backport guidance; do not mark the whole feature stack for automatic stable pickup.
- Document nonzero PF-report validation and EPROTO, including fallback, and the existing unchecked-doorbell fix. PF-directed geometry and directional-size contracts are unchanged.
Independent pre-existing RX, CQ-lifetime and broader lifecycle findings remain separate. The posted-command timeout/PF-error cleanup policy is also unchanged. Unacknowledged DMA, pins and references may be deliberately retained; this revision does not infer quiescence from a reset or delay, or promise automatic reclamation.
Validation on this exact revision:
- Ten GCC/Clang W=1 MANA Ethernet/RDMA target builds: unmodified base plus each of the four intermediate commits, with no compiler diagnostics.
- Thirteen inherited bounded actual-source regression suites and four throttle/CQ/EQ lifetime suites.
- Eight new GCC/Clang ASan/UBSan suites exercise cleanup rejection, callback/dependency retention, partial DMA creation, retries, healthy controls and the unchanged posted-error policy. There are 175 new cases and 25 negative controls per compiler.
- Source-cited local review following netdev/Sashiko criteria, including the fault-state caller interactions and failed construction unwinds.
- Strict 80-column checks have no source diagnostics. Checkpatch reports the retained Co-authored-by metadata warning once on each patch.
These are static/offline checks, not actual bot or hardware approval. No new full-kernel, runtime or performance qualification is claimed.
Previous revision:
https://lore.kernel.org/all/[email protected]/
Base: 6964ff21c5d8b75649211a52dbfd92753e605649
Long Li (4):
net: mana: prepare HWC ownership for safe reinitialization
net: mana: give each HWC message slot its own completion state
net: mana: support concurrent HWC requests
net: mana: add dynamic HWC queue depth with reinit path
drivers/infiniband/hw/mana/cq.c | 17 +- drivers/infiniband/hw/mana/main.c | 91 +- drivers/infiniband/hw/mana/mana_ib.h | 5 +- drivers/infiniband/hw/mana/mr.c | 28 +- drivers/infiniband/hw/mana/qp.c | 106 +- drivers/infiniband/hw/mana/wq.c | 4 +- .../net/ethernet/microsoft/mana/gdma_cdx.c | 6 +- .../net/ethernet/microsoft/mana/gdma_main.c | 207 +++- .../net/ethernet/microsoft/mana/gdma_pci.c | 20 +- .../net/ethernet/microsoft/mana/hw_channel.c | 1021 ++++++++++++++--- drivers/net/ethernet/microsoft/mana/mana_en.c | 49 +- .../net/ethernet/microsoft/mana/shm_channel.c | 58 +- include/net/mana/gdma.h | 26 +- include/net/mana/hw_channel.h | 70 +- include/net/mana/mana.h | 4 +- include/net/mana/shm_channel.h | 10 +- 16 files changed, 1404 insertions(+), 318 deletions(-)
base-commit: 6964ff21c5d8b75649211a52dbfd92753e605649
Signature · 1 line
2.43.0
PATCH v11 1/4 net: mana: prepare HWC ownership for safe reinitialization
From: Long Li <[email protected]>
Dynamic HWC queue sizing tears down the bootstrap queues and establishes a second channel before publishing it. Prepare the existing HWC ownership and teardown paths so that sequence cannot free or reuse state still reachable by either the PF or an EQ handler.
The shared-memory aperture carries one request at a time. Serialize the complete ESTABLISH_HWC and DESTROY_HWC transactions, including possession polling and response validation. Record setup_active immediately before the MMIO submission and clear it only after DESTROY_HWC is acknowledged.
Treat an unacknowledged destroy as retained PF ownership. Fence the HWC EQ and withdraw its CQ from dispatch, but keep all queue memory and wrappers for a later teardown retry. A new channel creation retries that retained context before assigning fresh queues to the PF.
When a PCI or CDX transport permanently discards its gdma_context, no such retry is possible. After IRQ and service-work teardown, release the software-only HWC state through a common final-disposal helper. Leave the coherent DMA allocations unreclaimed rather than exposing freed memory to a PF whose teardown was not acknowledged.
Snapshot the bootstrap CQ count and CQ ID after INIT_DONE. Publish the fixed bound with the allocated table so later init events cannot grow the bound past the allocation. Use a single acquire-loaded table snapshot in both normal and throttled EQE dispatch, with annotated CQ-slot reads. Out-of-range IDs and empty slots are deliberately quiet drops, including during teardown; remove the stale reference to their former WARN.
On acknowledged teardown, withdraw the CQ table and wait for all existing IRQ-side RCU readers before freeing the table and HWC queue bundle. This also covers a completion dispatched through a different EQ, without a per-event reference. Fence the dedicated EQ's remaining callbacks before releasing the CQ, completion buffer and work queues. Keep the parent EQ allocated until CQ destruction has detached its throttled-EQE child entry. Preserve the existing generic CQ detach and RCU handling.
The original driver could free HWC memory after unacknowledged teardown and trust a mutable PF-reported CQ bound. These lifetime and malformed-init fixes are prerequisites for rebuilding; a backport needs their complete dependencies, not an automatic backport of the feature stack.
Copilot-Session: 8c2361e6-c0f4-4b0c-bf01-b5e4cdacec50
--- .../net/ethernet/microsoft/mana/gdma_cdx.c | 4 +- .../net/ethernet/microsoft/mana/gdma_main.c | 41 +++- .../net/ethernet/microsoft/mana/gdma_pci.c | 4 +- .../net/ethernet/microsoft/mana/hw_channel.c | 187 +++++++++++++++--- drivers/net/ethernet/microsoft/mana/mana_en.c | 4 +- .../net/ethernet/microsoft/mana/shm_channel.c | 58 +++++- include/net/mana/gdma.h | 4 + include/net/mana/hw_channel.h | 5 + include/net/mana/shm_channel.h | 10 +- 9 files changed, 277 insertions(+), 40 deletions(-)
drivers/net/ethernet/microsoft/mana/gdma_cdx.c +2 -2
@@ -279,7 +279,7 @@ static int mana_cdx_gd_probe(struct cdx_device *cdx_dev)iounmap (bar0_va); free_gc:dev_set_drvdata (&cdx_dev->dev,NULL ); -vfree (gc); +mana_gd_free_context (gc); clear_master:cdx_clear_master (cdx_dev);return err;
@@ -298,7 +298,7 @@ static int mana_cdx_gd_remove(struct cdx_device *cdx_dev)iounmap (gc->bar0_va);dev_set_drvdata (&cdx_dev->dev,NULL ); -vfree (gc); +mana_gd_free_context (gc);return 0 ; }
drivers/net/ethernet/microsoft/mana/gdma_main.c +35 -6
103 lines not on this page · raw message
drivers/net/ethernet/microsoft/mana/gdma_pci.c +2 -2
@@ -633,7 +633,7 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)pci_iounmap (pdev, bar0_va); free_gc:pci_set_drvdata (pdev,NULL ); -vfree (gc); +mana_gd_free_context (gc); release_region:pci_release_regions (pdev); disable_dev:
@@ -686,7 +686,7 @@ static void mana_gd_remove(struct pci_dev *pdev)pci_iounmap (pdev, gc->bar0_va); -vfree (gc); +mana_gd_free_context (gc);pci_release_regions (pdev);pci_disable_device (pdev);
drivers/net/ethernet/microsoft/mana/hw_channel.c +165 -22
277 lines not on this page · raw message
drivers/net/ethernet/microsoft/mana/mana_en.c +2 -2
@@ -2736,8 +2736,8 @@ static void mana_destroy_txq(struct mana_port_context *apc)if (apc->tx_qp[i]->txq.napi_initialized) {/* Detach the CQ only after the WQ object is destroyed, * so a completion EQE that arrives before then still -* finds the CQ in cq_table[] rather than hitting the -* WARN in mana_gd_process_eqe(). One grace period then +* finds the CQ in cq_table[] rather than being dropped +* by mana_gd_process_eqe(). One grace period then * covers both mana_gd_intr() and NAPI users. */ mana_gd_detach_cq (gc, apc->tx_qp[i]->tx_cq.gdma_cq);
drivers/net/ethernet/microsoft/mana/shm_channel.c +54 -4
95 lines not on this page · raw message
include/net/mana/gdma.h +4 -0
@@ -600,6 +600,9 @@ int mana_gd_create_mana_wq_cq(struct gdma_dev *gd,void mana_gd_destroy_queue (struct gdma_context *gc,struct gdma_queue *queue); +/* Remove an EQ from interrupt dispatch without freeing its queue memory. */ +void mana_gd_fence_eq (struct gdma_context *gc,struct gdma_queue *queue); +int mana_gd_poll_cq (struct gdma_queue *cq,struct gdma_comp *comp,int num_cqe);void mana_gd_ring_cq (struct gdma_queue *cq,u8 arm_bit);
@@ -1150,6 +1153,7 @@ int mana_gd_verify_vf_version(struct gdma_context *gc);int mana_gd_query_max_resources (struct gdma_context *gc);int mana_gd_setup (struct gdma_context *gc);void mana_gd_cleanup (struct gdma_context *gc); +void mana_gd_free_context (struct gdma_context *gc);int mana_gd_detect_devices (struct gdma_context *gc);int mana_gd_init_registers (struct gdma_context *gc);irqreturn_t mana_gd_intr (int irq,void *arg);
include/net/mana/hw_channel.h +5 -0
@@ -185,6 +185,8 @@ struct hw_channel_context {u16 hwc_init_q_depth_max;u32 hwc_init_max_req_msg_size;u32 hwc_init_max_resp_msg_size; +u32 hwc_init_max_num_cqs; +u32 hwc_init_cq_id;struct completion hwc_init_eqe_comp;
@@ -199,11 +201,14 @@ struct hw_channel_context {u32 dest_vrcq_id;u32 hwc_timeout; +/* The PF may own the HWC queues while this is true. */ +bool setup_active;struct hwc_caller_ctx *caller_ctx; };int mana_hwc_create_channel (struct gdma_context *gc);void mana_hwc_destroy_channel (struct gdma_context *gc); +void mana_hwc_free_retained_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);
include/net/mana/shm_channel.h +8 -2
@@ -4,6 +4,8 @@#ifndef _SHM_CHANNEL_H#define _SHM_CHANNEL_H +#include <linux/mutex.h> +#define SMC_APERTURE_BITS 256#define SMC_BASIC_UNIT (sizeof(u32))#define SMC_APERTURE_DWORDS (SMC_APERTURE_BITS / (SMC_BASIC_UNIT * 8))
@@ -13,6 +15,9 @@struct shm_channel {struct device *dev;void __iomem *base; +/* Protects base and complete aperture request/response transactions. */ +struct mutex transaction_lock; +bool transaction_lock_initialized; }; void mana_smc_init(struct shm_channel *sc, struct device *dev,
@@ -20,8 +25,9 @@ void mana_smc_init(struct shm_channel *sc, struct device *dev,int mana_smc_setup_hwc (struct shm_channel *sc,bool reset_vf,u64 eq_addr,u64 cq_addr,u64 rq_addr,u64 sq_addr, -u32 eq_msix_index); +u32 eq_msix_index,bool *submitted); -int mana_smc_teardown_hwc (struct shm_channel *sc,bool reset_vf); +int mana_smc_teardown_hwc (struct shm_channel *sc,bool reset_vf, +bool *setup_active);#endif /* _SHM_CHANNEL_H */
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH net-next v11 1/4] net: mana: prepare HWC ownership for safe reinitialization
Sashiko has reviewed this patch and found no issues.
Quoted 15 lines
From: Long Li <[email protected]>
Dynamic HWC queue sizing tears down the bootstrap queues and establishes a second channel before publishing it. Prepare the existing HWC ownership and teardown paths so that sequence cannot free or reuse state still reachable by either the PF or an EQ handler.
The shared-memory aperture carries one request at a time. Serialize the complete
ESTABLISH_HWCandDESTROY_HWCtransactions, including possession polling and response validation. Recordsetup_activeimmediately before the MMIO submission and clear it only afterDESTROY_HWCis acknowledged.Treat an unacknowledged destroy as retained PF ownership. Fence the HWC EQ and withdraw its CQ from dispatch, but keep all queue memory and wrappers for a later teardown retry. A new channel creation retries that retained
Quoted 6 lines
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v11 2/4 net: mana: give each HWC message slot its own completion state
In reply to Wei HuFrom: Long Li <[email protected]>
Concurrent requests require the response handler and the waiting sender to agree on the lifetime and result state of each message slot.
Protect the caller's output buffer, Linux error and device status with a per-slot lock. Publish the output buffer only while the sender is waiting and withdraw it before every return. This fixes the original driver's late response copy through caller storage whose lifetime has ended.
Reinitialize completion and result state under both the allocation and per-slot locks when acquiring the slot. This also fixes stale completion state surviving a timed-out request. A response handler can still hold the per-slot lock after the previous sender has returned its admission permit, so an unpublished bitmap bit alone is not sufficient protection. If the response records its result while the timed wait expires, return that result instead of reporting a false timeout.
Keep the baseline's post-timeout admission behavior at this step rather than introducing a temporary channel-wide latch that suppresses subsequent teardown commands. This patch alone does not solve late-response correlation or TX-buffer reuse after a timeout. The next patch adds response ownership, per-slot quarantine and the associated admission and cleanup rules together; backporting the fixes needs that dependency.
Split response-status handling and request cleanup into helpers so the send path has structured returns rather than phase-jumping gotos.
Copilot-Session: 8c2361e6-c0f4-4b0c-bf01-b5e4cdacec50
--- .../net/ethernet/microsoft/mana/hw_channel.c | 125 +++++++++++++----- include/net/mana/hw_channel.h | 4 +- 2 files changed, 95 insertions(+), 34 deletions(-)
drivers/net/ethernet/microsoft/mana/hw_channel.c +92 -33
@@ -9,6 +9,7 @@static int mana_hwc_get_msg_index (struct hw_channel_context *hwc,u16 *msg_id) {struct gdma_resource *r = &hwc->inflight_msg_res; +struct hwc_caller_ctx *ctx;unsigned long flags;u32 index;
@@ -19,8 +20,17 @@ static int mana_hwc_get_msg_index(struct hw_channel_context *hwc, u16 *msg_id) index =find_first_zero_bit (hwc->inflight_msg_res.map, hwc->inflight_msg_res.size); + ctx = &hwc->caller_ctx[index]; +spin_lock (&ctx->lock); +reinit_completion (&ctx->comp_event); + ctx->output_buf =NULL ; + ctx->output_buflen =0 ; + ctx->error = -EINPROGRESS ; + ctx->status_code =0 ; +bitmap_set (hwc->inflight_msg_res.map, index,1 ); +spin_unlock (&ctx->lock);spin_unlock_irqrestore (&r->lock, flags); *msg_id = index;
@@ -90,14 +100,21 @@ static void mana_hwc_handle_resp(struct hw_channel_context *hwc, u32 resp_len, } ctx = hwc->caller_ctx + msg_id; - err =mana_hwc_verify_resp_msg (ctx, resp_msg, resp_len); -if (err) - goto out; - ctx->status_code = resp_msg->status; +spin_lock (&ctx->lock); +if (!ctx->output_buf) { +spin_unlock (&ctx->lock); +mana_hwc_post_rx_wqe (hwc->rxq, rx_req); +return ; + } -memcpy (ctx->output_buf, resp_msg, resp_len); -out: + err =mana_hwc_verify_resp_msg (ctx, resp_msg, resp_len); +if (!err) { + ctx->status_code = resp_msg->status; +memcpy (ctx->output_buf, resp_msg, resp_len); + } + + ctx->output_buf =NULL ; ctx->error = err;/* Must post rx wqe before complete(), otherwise the next rx may
@@ -106,6 +123,7 @@ static void mana_hwc_handle_resp(struct hw_channel_context *hwc, u32 resp_len,mana_hwc_post_rx_wqe (hwc->rxq, rx_req);complete (&ctx->comp_event); +spin_unlock (&ctx->lock); } static void mana_hwc_init_event_handler(void *ctx, struct gdma_queue *q_self,
@@ -696,8 +714,10 @@ static int mana_hwc_test_channel(struct hw_channel_context *hwc, u16 q_depth,if (!ctx)return -ENOMEM ; -for (i =0 ; i < q_depth; ++i) +for (i =0 ; i < q_depth; ++i) {init_completion (&ctx[i].comp_event); +spin_lock_init (&ctx[i].lock); + } hwc->caller_ctx = ctx;
@@ -1000,6 +1020,37 @@ void mana_hwc_free_retained_channel(struct gdma_context *gc) gc->hwc.gdma_context =NULL ; } +static int mana_hwc_response_status (struct hw_channel_context *hwc, +u32 command,int error,u32 status) +{ +if (error) +return error; + +if (!status || status ==GDMA_STATUS_MORE_ENTRIES ) +return 0 ; + +if (status ==GDMA_STATUS_CMD_UNSUPPORTED ) +return -EOPNOTSUPP ; + +if (command !=MANA_QUERY_PHY_STAT ) +dev_err (hwc->dev,"Command 0x%x failed with status: 0x%x\n" , + command, status); + +return -EPROTO ; +} + +static void mana_hwc_finish_request (struct hw_channel_context *hwc, +struct hwc_caller_ctx *ctx,u16 msg_id) +{ +unsigned long flags; + +spin_lock_irqsave (&ctx->lock, flags); + ctx->output_buf =NULL ; +spin_unlock_irqrestore (&ctx->lock, flags); + +mana_hwc_put_msg_index (hwc, msg_id); +} +int mana_hwc_send_request (struct hw_channel_context *hwc,u32 req_len,const void *req,u32 resp_len,void *resp) {
@@ -1007,26 +1058,32 @@ int mana_hwc_send_request(struct hw_channel_context *hwc, u32 req_len,struct hwc_wq *txq = hwc->txq;struct gdma_req_hdr *req_msg;struct hwc_caller_ctx *ctx; +unsigned long flags;u32 dest_vrcq;u32 dest_vrq;u32 command; +u32 status;u16 msg_id;int err; -mana_hwc_get_msg_index (hwc, &msg_id); + err =mana_hwc_get_msg_index (hwc, &msg_id); +if (err) +return err; tx_wr = &txq->msg_buf->reqs[msg_id]; + ctx = hwc->caller_ctx + msg_id;if (req_len > tx_wr->buf_len) {dev_err (hwc->dev,"HWC: req msg size: %d > %d\n" , req_len, tx_wr->buf_len); - err = -EINVAL ; - goto out; +mana_hwc_finish_request (hwc, ctx, msg_id); +return -EINVAL ; } - ctx = hwc->caller_ctx + msg_id; +spin_lock_irqsave (&ctx->lock, flags); ctx->output_buf = resp; ctx->output_buflen = resp_len; +spin_unlock_irqrestore (&ctx->lock, flags); req_msg = (struct gdma_req_hdr *)tx_wr->buf_va;if (req)
@@ -1048,11 +1105,24 @@ int mana_hwc_send_request(struct hw_channel_context *hwc, u32 req_len, err =mana_hwc_post_tx_wqe (txq, tx_wr, dest_vrq, dest_vrcq, false);if (err) {dev_err (hwc->dev,"HWC: Failed to post send WQE: %d\n" , err); - goto out; +mana_hwc_finish_request (hwc, ctx, msg_id); +return err; }if (!wait_for_completion_timeout (&ctx->comp_event, - (msecs_to_jiffies (hwc->hwc_timeout)))) { +msecs_to_jiffies (hwc->hwc_timeout))) { +spin_lock_irqsave (&ctx->lock, flags); + ctx->output_buf =NULL ; + err = ctx->error; + status = ctx->status_code; +spin_unlock_irqrestore (&ctx->lock, flags); + +if (err != -EINPROGRESS ) { +mana_hwc_finish_request (hwc, ctx, msg_id); +return mana_hwc_response_status (hwc, command, err, + status); + } +if (hwc->hwc_timeout !=0 )dev_err (hwc->dev,"Command 0x%x timed out: %u ms\n" , command, hwc->hwc_timeout);
@@ -1061,27 +1131,16 @@ int mana_hwc_send_request(struct hw_channel_context *hwc, u32 req_len,if (hwc->hwc_timeout >1 ) hwc->hwc_timeout =1 ; - err = -ETIMEDOUT ; - goto out; +mana_hwc_finish_request (hwc, ctx, msg_id); +return -ETIMEDOUT ; } -if (ctx->error) { - err = ctx->error; - goto out; - } +spin_lock_irqsave (&ctx->lock, flags); + ctx->output_buf =NULL ; + err = ctx->error; + status = ctx->status_code; +spin_unlock_irqrestore (&ctx->lock, flags); -if (ctx->status_code && ctx->status_code !=GDMA_STATUS_MORE_ENTRIES ) { -if (ctx->status_code ==GDMA_STATUS_CMD_UNSUPPORTED ) { - err = -EOPNOTSUPP ; - goto out; - } -if (command !=MANA_QUERY_PHY_STAT ) -dev_err (hwc->dev,"Command 0x%x failed with status: 0x%x\n" , - command, ctx->status_code); - err = -EPROTO ; - goto out; - } -out: -mana_hwc_put_msg_index (hwc, msg_id); -return err; +mana_hwc_finish_request (hwc, ctx, msg_id); +return mana_hwc_response_status (hwc, command, err, status); }
include/net/mana/hw_channel.h +3 -1
@@ -168,10 +168,12 @@ struct hwc_wq {struct hwc_caller_ctx {struct completion comp_event; +/* Protects initialization, output storage and response state. */ +spinlock_t lock;void *output_buf;u32 output_buflen; -u32 error;/* Linux error code */ +int error;/* Linux error code */ u32 status_code; };
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH net-next v11 2/4] net: mana: give each HWC message slot its own completion state
Sashiko has reviewed this patch and found no issues.
Quoted 15 lines
From: Long Li <[email protected]>
Concurrent requests require the response handler and the waiting sender to agree on the lifetime and result state of each message slot.
Protect the caller's output buffer, Linux error and device status with a per-slot lock. Publish the output buffer only while the sender is waiting and withdraw it before every return. This fixes the original driver's late response copy through caller storage whose lifetime has ended.
Reinitialize completion and result state under both the allocation and per-slot locks when acquiring the slot. This also fixes stale completion state surviving a timed-out request. A response handler can still hold the per-slot lock after the previous sender has returned its admission permit, so an unpublished bitmap bit alone is not sufficient protection. If the
Quoted 6 lines
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
PATCH v11 3/4 net: mana: support concurrent HWC requests
In reply to Wei HuFrom: Long Li <[email protected]>
Give HWC message slots separate sender and response ownership. Initialize each slot under the inflight resource and per-slot locks, publish its bitmap bit last, and release the slot only after both references are released. The per-slot lock also excludes an older duplicate callback from resetting or consuming the next caller's state.
Serialize SQ posting so concurrent senders cannot corrupt the producer state. A posted request which times out keeps its response reference, ID and TX buffer until its late response arrives or teardown cancels it. This also fixes the original wrong-command response bug: releasing an ID at timeout could deliver its late response to the next command using that ID. The preceding per-slot state fix and this quarantine are both needed for a dependency-complete backport. The bootstrap channel remains depth one here; the next patch selects and allocates larger queues.
Wait for a free slot while any non-abandoned occupied slot can still make progress. Partial abandonment alone does not end this wait. Wake waiters on slot release, abandonment, cancellation and channel stop. Return -ENOTCONN when the full pool is quarantined or cancelled with no free slot, distinguishing local rejection from an admitted command's bounded response timeout. A stopped channel returns -ENODEV. Retire each abandoned response count with its response reference exactly once.
Local rejection must not make existing destructive callers free DMA that the device still owns. Propagate it through queue disable, DMA-region and WQ-object destruction. Withdraw software CQ/IRQ callbacks, but retain the affected Ethernet queue memory and RX pages when their destroy was rejected. Keep an EQ's MSI-X reference if its disable was not delivered. Handle the same ownership transfer in failed EQ construction.
For RDMA, leave live verbs objects and their dependencies intact on local rejection. Retain queue mappings on failed creation unwinds, including regions already transferred to a QP/CQ handle and partial multi-command DMA-region creation. Do not unpin their memory merely because a cleanup request could not acquire an HWC slot. This may deliberately retain resources on a failed cleanup; it is not proof of device quiescence.
Keep available slots usable for best-effort commands after cancellation. Preserve the baseline cleanup policy for commands that were actually posted and then timed out or received PF errors; this patch does not repair that independent data-DMA failure policy. Keep timeout recovery and expected logging consistent with the new local-rejection result.
Synchronize hwc_timeout updates with atomic access helpers. Cancellation is terminal for a channel instance; firmware and query updates may replace only a live timeout, and fail-fast may only lower a live value to one millisecond.
Keep setup private until queues, admission state, caller contexts and the direct EQ test are ready. Preserve the private test's specific failure diagnostic without publishing the HWC early. Runtime teardown unpublishes the channel, rejects new admissions, wakes waiters and drains active senders before releasing or retaining PF-owned mappings. Initialize the per-context drain waitqueue once in PCI/CDX probe, beside hwc_lock, not on every channel creation. Apply the same unpublication and sender-drain rules to final disposal of retained software state.
Split admission, submission, waiting, response status and unwind into helpers so mana_hwc_send_request() uses structured returns.
Copilot-Session: 8c2361e6-c0f4-4b0c-bf01-b5e4cdacec50
--- drivers/infiniband/hw/mana/cq.c | 17 +- drivers/infiniband/hw/mana/main.c | 72 ++- drivers/infiniband/hw/mana/mana_ib.h | 5 +- drivers/infiniband/hw/mana/mr.c | 28 +- drivers/infiniband/hw/mana/qp.c | 106 +++- drivers/infiniband/hw/mana/wq.c | 4 +- .../net/ethernet/microsoft/mana/gdma_cdx.c | 2 + .../net/ethernet/microsoft/mana/gdma_main.c | 150 ++++- .../net/ethernet/microsoft/mana/gdma_pci.c | 16 +- .../net/ethernet/microsoft/mana/hw_channel.c | 599 +++++++++++++----- drivers/net/ethernet/microsoft/mana/mana_en.c | 49 +- include/net/mana/gdma.h | 20 +- include/net/mana/hw_channel.h | 46 +- include/net/mana/mana.h | 4 +- 14 files changed, 827 insertions(+), 291 deletions(-)
drivers/infiniband/hw/mana/cq.c +8 -9
@@ -149,7 +149,8 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, err_remove_cq_cb:mana_ib_remove_cq_cb (mdev, cq); err_destroy_rnic_cq: -mana_ib_gd_destroy_cq (mdev, cq); +if (mana_gd_is_request_rejected (mana_ib_gd_destroy_cq (mdev, cq))) +WRITE_ONCE (cq->queue.retain_dma, true); err_destroy_queue:mana_ib_destroy_queue (mdev, &cq->queue);
@@ -169,16 +170,14 @@ int mana_ib_destroy_cq(struct ib_cq *ibcq, struct ib_udata *udata) mdev = container_of(ibdev, struct mana_ib_dev, ib_dev); -mana_ib_remove_cq_cb (mdev, cq); - -/* Ignore return code as there is not much we can do about it. -* The error message is printed inside. -*/ -mana_ib_gd_destroy_cq (mdev, cq); + err =mana_ib_gd_destroy_cq (mdev, cq); +if (mana_gd_is_request_rejected (err) || +READ_ONCE (cq->queue.retain_dma)) +return err ? err : -ENOTCONN ; -mana_ib_destroy_queue (mdev, &cq->queue); +mana_ib_remove_cq_cb (mdev, cq); -return 0 ; +return mana_ib_destroy_queue (mdev, &cq->queue); }static void mana_ib_cq_handler (void *ctx,struct gdma_queue *gdma_cq)
drivers/infiniband/hw/mana/main.c +52 -20
152 lines not on this page · raw message
drivers/infiniband/hw/mana/mana_ib.h +4 -1
@@ -76,6 +76,8 @@ struct mana_ib_queue {struct gdma_queue *kmem;u64 gdma_region;u64 id; +/* A locally rejected parent destroy left this mapping PF-owned. */ +bool retain_dma; };struct mana_ib_dev {
@@ -823,7 +825,8 @@ int mana_ib_create_kernel_queue(struct mana_ib_dev *mdev, u32 size, enum gdma_qu struct mana_ib_queue *queue);int mana_ib_create_queue (struct mana_ib_dev *mdev,u64 addr,u32 size,struct mana_ib_queue *queue,bool is_cq); -void mana_ib_destroy_queue (struct mana_ib_dev *mdev,struct mana_ib_queue *queue); +int mana_ib_destroy_queue (struct mana_ib_dev *mdev, +struct mana_ib_queue *queue); struct ib_wq *mana_ib_create_wq(struct ib_pd *pd, struct ib_wq_init_attr *init_attr,
drivers/infiniband/hw/mana/mr.c +20 -8
@@ -107,8 +107,8 @@ struct ib_mr *mana_ib_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 length,struct ib_device *ibdev = ibpd->device;struct mana_ib_dev *dev;struct mana_ib_mr *mr; -u64 dma_region_handle; -int err; +u64 dma_region_handle =GDMA_INVALID_DMA_REGION ; +int err, destroy_err;if (dmah)return ERR_PTR (-EOPNOTSUPP );
@@ -178,10 +178,16 @@ struct ib_mr *mana_ib_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 length,return &mr->ibmr; err_dma_region: -mana_gd_destroy_dma_region (mdev_to_gc (dev), dma_region_handle); + destroy_err =mana_gd_destroy_dma_region (mdev_to_gc (dev), + dma_region_handle); +if (mana_gd_is_request_rejected (destroy_err)) + goto err_free; + dma_region_handle =GDMA_INVALID_DMA_REGION ; err_umem: -ib_umem_release (mr->umem); +if (!mana_gd_is_request_rejected (err) || + dma_region_handle ==GDMA_INVALID_DMA_REGION ) +ib_umem_release (mr->umem); err_free:kfree (mr);
@@ -199,8 +205,8 @@ struct ib_mr *mana_ib_reg_user_mr_dmabuf(struct ib_pd *ibpd, u64 start, u64 lengstruct ib_umem_dmabuf *umem_dmabuf;struct mana_ib_dev *dev;struct mana_ib_mr *mr; -u64 dma_region_handle; -int err; +u64 dma_region_handle =GDMA_INVALID_DMA_REGION ; +int err, destroy_err;if (dmah)return ERR_PTR (-EOPNOTSUPP );
@@ -252,10 +258,16 @@ struct ib_mr *mana_ib_reg_user_mr_dmabuf(struct ib_pd *ibpd, u64 start, u64 lengreturn &mr->ibmr; err_dma_region: -mana_gd_destroy_dma_region (mdev_to_gc (dev), dma_region_handle); + destroy_err =mana_gd_destroy_dma_region (mdev_to_gc (dev), + dma_region_handle); +if (mana_gd_is_request_rejected (destroy_err)) + goto err_free; + dma_region_handle =GDMA_INVALID_DMA_REGION ; err_umem: -ib_umem_release (mr->umem); +if (!mana_gd_is_request_rejected (err) || + dma_region_handle ==GDMA_INVALID_DMA_REGION ) +ib_umem_release (mr->umem); err_free:kfree (mr);
drivers/infiniband/hw/mana/qp.c +84 -22
187 lines not on this page · raw message
drivers/infiniband/hw/mana/wq.c +3 -1
@@ -64,7 +64,9 @@ int mana_ib_destroy_wq(struct ib_wq *ibwq, struct ib_udata *udata) mdev = container_of(ib_dev, struct mana_ib_dev, ib_dev); -mana_ib_destroy_queue (mdev, &wq->queue); + err =mana_ib_destroy_queue (mdev, &wq->queue); +if (mana_gd_is_request_rejected (err)) +return err;kfree (wq);
drivers/net/ethernet/microsoft/mana/gdma_cdx.c +2 -0
@@ -221,6 +221,8 @@ static int mana_cdx_gd_probe(struct cdx_device *cdx_dev)mutex_init (&gc->eq_test_event_mutex);mutex_init (&gc->gic_mutex); +spin_lock_init (&gc->hwc_lock); +init_waitqueue_head (&gc->hwc_drain_waitq);dev_set_drvdata (&cdx_dev->dev, gc); gc->bar0_pa =cdx_resource_start (cdx_dev,0 ); gc->bar0_size =cdx_resource_len (cdx_dev,0 );
drivers/net/ethernet/microsoft/mana/gdma_main.c +116 -34
283 lines not on this page · raw message
drivers/net/ethernet/microsoft/mana/gdma_pci.c +7 -9
@@ -14,7 +14,6 @@#include <linux/xarray.h> #include <net/mana/mana.h> -#include <net/mana/hw_channel.h> struct mana_dev_recovery {struct list_head list;
@@ -85,7 +84,6 @@ static void mana_serv_fpga(struct pci_dev *pdev)static void mana_serv_reset (struct pci_dev *pdev) {struct gdma_context *gc =pci_get_drvdata (pdev); -struct hw_channel_context *hwc;int ret;if (!gc) {
@@ -95,15 +93,13 @@ static void mana_serv_reset(struct pci_dev *pdev)return ; } - hwc = gc->hwc.driver_data; -if (!hwc) { +/* HWC is not responding in this case, so don't wait */ + ret =mana_gd_cancel_hwc_timeout (gc); +if (ret) {dev_err (&pdev->dev,"MANA service: no HWC\n" ); goto out; } -/* HWC is not responding in this case, so don't wait */ - hwc->hwc_timeout =0 ; -dev_info (&pdev->dev,"MANA reset cycle start\n" );mana_gd_suspend (pdev,PMSG_SUSPEND );
@@ -111,7 +107,7 @@ static void mana_serv_reset(struct pci_dev *pdev)msleep (MANA_SERVICE_PERIOD *1000 ); ret =mana_gd_resume (pdev); -if (ret == -ETIMEDOUT || ret == -EPROTO ) { +if (ret == -ETIMEDOUT || ret == -ENOTCONN || ret == -EPROTO ) {/* Perform PCI rescan on device if we failed on HWC */ dev_err (&pdev->dev,"MANA service: resume failed, rescanning\n" );mana_serv_rescan (pdev);
@@ -582,6 +578,8 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)mutex_init (&gc->eq_test_event_mutex);mutex_init (&gc->gic_mutex); +spin_lock_init (&gc->hwc_lock); +init_waitqueue_head (&gc->hwc_drain_waitq);pci_set_drvdata (pdev, gc); gc->bar0_pa =pci_resource_start (pdev,0 ); gc->bar0_size =pci_resource_len (pdev,0 );
@@ -647,7 +645,7 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)* perform the device recovery procedure after MANA_SERVICE_PERIOD * seconds. */ -if (err == -ETIMEDOUT || err == -EPROTO ) { +if (err == -ETIMEDOUT || err == -ENOTCONN || err == -EPROTO ) {struct mana_dev_recovery *dev;unsigned long flags;
drivers/net/ethernet/microsoft/mana/hw_channel.c +435 -164
830 lines not on this page · raw message
drivers/net/ethernet/microsoft/mana/mana_en.c +33 -16
124 lines not on this page · raw message
include/net/mana/gdma.h +19 -1
@@ -5,6 +5,7 @@#define _GDMA_H#include <linux/dma-mapping.h> +#include <linux/errno.h> #include <linux/netdevice.h> #include <rdma/ib_verbs.h>
@@ -548,6 +549,15 @@ struct gdma_context {/* Hardware communication channel (HWC) */ struct gdma_dev hwc; +/* Sender drain; the final wakeup runs under hwc_lock. */ +wait_queue_head_t hwc_drain_waitq; + +/* Protects runtime HWC publication and active sender references. +* Setup owns an unpublished HWC directly; timeout updates use atomic +* access helpers and do not require this lock. +*/ +spinlock_t hwc_lock; +/* Azure network adapter */ struct gdma_dev mana;
@@ -598,7 +608,13 @@ int mana_gd_create_mana_wq_cq(struct gdma_dev *gd,const struct gdma_queue_spec *spec, struct gdma_queue **queue_ptr); -void mana_gd_destroy_queue (struct gdma_context *gc,struct gdma_queue *queue); +int mana_gd_destroy_queue (struct gdma_context *gc,struct gdma_queue *queue); + +/* Local HWC rejection does not revoke the device's DMA ownership. */ +static inline bool mana_gd_is_request_rejected (int err) +{ +return err == -ENOTCONN || err == -ENODEV || err == -EMSGSIZE ; +}/* Remove an EQ from interrupt dispatch without freeing its queue memory. */ void mana_gd_fence_eq (struct gdma_context *gc,struct gdma_queue *queue);
@@ -1196,6 +1212,8 @@ void mana_gd_free_memory(struct gdma_mem_info *gmi);int mana_gd_send_request (struct gdma_context *gc,u32 req_len,const void *req,u32 resp_len,void *resp); +int mana_gd_cancel_hwc_timeout (struct gdma_context *gc); +int mana_gd_destroy_dma_region (struct gdma_context *gc,u64 dma_region_handle);void mana_register_debugfs (void );void mana_unregister_debugfs (void );
include/net/mana/hw_channel.h +42 -4
85 lines not on this page · raw message
include/net/mana/mana.h +2 -2
@@ -1162,8 +1162,8 @@ int mana_create_wq_obj(struct mana_port_context *apc,struct mana_obj_spec *cq_spec, mana_handle_t *wq_obj); -void mana_destroy_wq_obj (struct mana_port_context *apc,u32 wq_type, -mana_handle_t wq_obj); +int mana_destroy_wq_obj (struct mana_port_context *apc,u32 wq_type, +mana_handle_t wq_obj);int mana_cfg_vport (struct mana_port_context *apc,u32 protection_dom_id,u32 doorbell_pg_id,bool check_channel_changing);
Signature · 1 line
2.43.0
Re: [PATCH net-next v11 3/4] net: mana: support concurrent HWC requests
Quoted 1 line · Wei Hu
From: Long Li <[email protected]>
<...>
Quoted 6 lines
For RDMA, leave live verbs objects and their dependencies intact on local rejection. Retain queue mappings on failed creation unwinds, including regions already transferred to a QP/CQ handle and partial multi-command DMA-region creation. Do not unpin their memory merely because a cleanup request could not acquire an HWC slot. This may deliberately retain resources on a failed cleanup; it is not proof of device quiescence.
This sounds wrong at first glance. Unfortunately, the entire series was written using AI tools, making it difficult to provide meaningful feedback based on the commit messages. However, in RDMA, object destruction should not fail and we shouldn't leave pinned memory for the user space process which already exited.
Thanks
[email protected]
AI reviewRe: [PATCH net-next v11 3/4] net: mana: support concurrent HWC requests
In reply to Wei HuThank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [High] net: mana: skipped mana_gd_put_gic() on EQ teardown breaks remove_irqs() - [High] RDMA/mana_ib…
Thank you for your contribution! Sashiko AI review found 4 potential issues to consider:
- [High] net: mana: skipped mana_gd_put_gic() on EQ teardown breaks remove_irqs()
- [High] RDMA/mana_ib: returning errors in mana_ib_destroy_qp() breaks teardown
- [High] RDMA/mana_ib: mana_ib_destroy_cq() leaves dangling callback on rejection
- [Medium] net: mana: leaked GIC ref when mana_gd_create_mana_eq() is rejected
--
commit 2f3af75d69a80c300f076a62ab2f24d6ea93aab2
Author: Long Li <[email protected]>
net: mana: support concurrent HWC requests
This commit adds reference-counted HWC caller slots, serializes SQ posting, quarantines timed-out HWC slots, and propagates local HWC request rejections across MANA Ethernet and RDMA teardown paths.
Quoted 15 lines
drivers/infiniband/hw/mana/cq.c +1
-6@@ -169,16 +170,14 @@ int mana_ib_destroy_cq(struct ib_cq *ibcq, struct ib_udata *udata) mdev = container_of(ibdev, struct mana_ib_dev, ib_dev); -mana_ib_remove_cq_cb (mdev, cq); - -/* Ignore return code as there is not much we can do about it. -* The error message is printed inside. -*/ -mana_ib_gd_destroy_cq (mdev, cq); + err =mana_ib_gd_destroy_cq (mdev, cq);
drivers/infiniband/hw/mana/cq.c int mana_ib_destroy_cq(struct ib_cq *ibcq, struct ib_udata *udata) · line 181
Quoted 10 lines
drivers/infiniband/hw/mana/cq.c +5
-2+if (mana_gd_is_request_rejected (err) || +READ_ONCE (cq->queue.retain_dma)) +return err ? err : -ENOTCONN ; -mana_ib_destroy_queue (mdev, &cq->queue); +mana_ib_remove_cq_cb (mdev, cq); -return 0 ; +return mana_ib_destroy_queue (mdev, &cq->queue); }
[Severity: High]
Does returning early here leave a dangling CQ callback in gc->cq_table[cq->queue.id]?
For kernel CQs, ib_free_cq() and the error path of __ib_alloc_cq() free the ib_cq even when destroy_cq() returns an error; for user CQs, uverbs_destroy_ufile_hw() falls back to RDMA_REMOVE_DRIVER_FAILURE and frees cq->ibcq.uobject. Because mana_ib_remove_cq_cb() and mana_gd_detach_cq() (called via mana_ib_destroy_queue() -> mana_gd_destroy_queue() for kernel CQs) are both skipped when mana_ib_gd_destroy_cq() is rejected or retain_dma is set, a subsequent completion EQE will invoke mana_ib_cq_handler() on the freed CQ or uobject.
Quoted 4 lines
drivers/infiniband/hw/mana/qp.c +0
-0
[ ... ]
Quoted 43 lines
drivers/infiniband/hw/mana/qp.c +12
-9@@ -1030,12 +1093,11 @@ static int mana_ib_destroy_rc_qp(struct mana_ib_qp *qp, struct ib_udata *udata)if (err)return err; -mana_table_remove_qp (mdev, qp); + err =mana_ib_gd_destroy_rnic_qp (mdev, qp); +if (mana_gd_is_request_rejected (err)) +return err; -/* Ignore return code as there is not much we can do about it. -* The error message is printed inside. -*/ -mana_ib_gd_destroy_rnic_qp (mdev, qp); +mana_table_remove_qp (mdev, qp);for (i =0 ; i <MANA_RC_QUEUE_TYPE_MAX ; ++i)mana_ib_destroy_queue (mdev, &qp->rc_qp.queues[i]);@@ -1052,11 +1114,11 @@ static int mana_ib_destroy_uc_qp(struct mana_ib_qp *qp, struct ib_udata *udata)if (err)return err; + err =mana_ib_gd_destroy_rnic_qp (mdev, qp); +if (mana_gd_is_request_rejected (err)) +return err; +mana_table_remove_qp (mdev, qp); -/* Ignore return code as there is not much we can do about it. -* The error message is printed inside. -*/ -mana_ib_gd_destroy_rnic_qp (mdev, qp);for (i =0 ; i <MANA_UC_QUEUE_TYPE_MAX ; ++i)mana_ib_destroy_queue (mdev, &qp->uc_qp.queues[i]);@@ -1073,16 +1135,16 @@ static int mana_ib_destroy_ud_qp(struct mana_ib_qp *qp, struct ib_udata *udata)if (err)return err; + err =mana_ib_gd_destroy_ud_qp (mdev, qp); +if (mana_gd_is_request_rejected (err)) +return err; +mana_table_remove_qp (mdev, qp);mana_remove_qp_from_cqs (qp, false);
drivers/infiniband/hw/mana/qp.c static int mana_ib_destroy_ud_qp(struct mana_ib_qp *qp, struct ib_udata *udata) · line 1149
Quoted 10 lines
drivers/infiniband/hw/mana/qp.c +0
-4destroy_shadow_queue (&qp->shadow_rq);destroy_shadow_queue (&qp->shadow_sq); -/* Ignore return code as there is not much we can do about it. -* The error message is printed inside. -*/ -mana_ib_gd_destroy_ud_qp (mdev, qp);for (i =0 ; i <MANA_UD_QUEUE_TYPE_MAX ; ++i)mana_ib_destroy_queue (mdev, &qp->ud_qp.queues[i]);
[Severity: High]
Can returning an error from mana_ib_destroy_{rc,uc,ud}_qp() before mana_table_remove_qp() and mana_remove_qp_from_cqs() cause a use-after-free during device removal or HWC reset recovery?
During mana_serv_reset() -> mana_gd_suspend() -> mana_rdma_remove() -> mana_ib_remove(), mana_drain_gsi_sqs() adds the kernel GSI QP to the MAD CQ's send_err_qp_list and schedules cq->work. When ib_unregister_device() then closes the MAD port, mana_ib_destroy_ud_qp() returns -ENOTCONN, which causes ib_destroy_qp_user() to abort without dropping port_priv->cq->usecnt or removing the QP from send_err_qp_list and mdev->qp_table_wq. ib_free_cq() then hits WARN_ON_ONCE(atomic_read(&cq->usecnt)) and skips cancelling cq->work before ib_dealloc_device() frees mdev, leaving ib_cq_poll_work() and EQE handlers to dereference freed memory.
In addition, create_qp()'s err_security unwind in drivers/infiniband/core/verbs.c ignores the return value of destroy_qp() and frees qp, and uverbs_destroy_ufile_hw() frees qp->uobject on RDMA_REMOVE_DRIVER_FAILURE, both leaving a freed QP in mdev->qp_table_wq.
Quoted 4 lines
drivers/net/ethernet/microsoft/mana/gdma_main.c +0
-0
[ ... ]
Quoted 10 lines
drivers/net/ethernet/microsoft/mana/gdma_main.c +2
-1@@ -1117,7 +1181,8 @@ static int mana_gd_create_eq(struct gdma_dev *gd,return 0 ; out:dev_err (dev,"Failed to create EQ: %d\n" , err); -mana_gd_destroy_eq (gc, false, queue); +if (mana_gd_is_request_rejected (mana_gd_destroy_eq (gc, false, queue))) + err = -ENOTCONN ; queue->eq.msix_index =INVALID_PCI_MSIX_INDEX ;return err; }
[ ... ]
drivers/net/ethernet/microsoft/mana/gdma_main.c int mana_gd_create_mana_eq(struct gdma_dev *gd, · line 1460
Quoted 12 lines
drivers/net/ethernet/microsoft/mana/gdma_main.c +4
-1@@ -1385,7 +1451,10 @@ int mana_gd_create_mana_eq(struct gdma_dev *gd, out:dev_err (gc->dev,"Failed to create queue type %d of size: %u, err: %d\n" , spec->type, spec->queue_size, err); -mana_gd_free_memory (gmi); +if (!mana_gd_is_request_rejected (err) || + (gmi->dma_region_handle ==GDMA_INVALID_DMA_REGION && + !queue->eq.disable_needed)) +mana_gd_free_memory (gmi); free_q:kfree (queue);return err;
[Severity: Medium]
Does mana_gd_create_mana_eq() cause its callers (mana_create_eq() and mana_ib_create_eqs()) to leak the GIC reference and MSI-X bitmap entry when an HWC request is rejected before the hardware EQ exists, or when mana_gd_destroy_eq() succeeds after mana_gd_test_eq() is rejected?
In both cases queue->eq.disable_needed is false and queue is freed, yet mana_gd_create_mana_eq() still returns a rejected error code (-ENOTCONN or -ENODEV), so the callers skip mana_gd_put_gic(). Also, if mana_gd_create_dma_region() succeeded and mana_gd_create_eq() then fails before mana_gd_create_hw_eq() consumes gmi->dma_region_handle, the unwind path never calls mana_gd_destroy_dma_region().
Quoted 4 lines
drivers/net/ethernet/microsoft/mana/mana_en.c +0
-0
[ ... ]
drivers/net/ethernet/microsoft/mana/mana_en.c void mana_destroy_eq(struct mana_port_context *apc) · line 1800
Quoted 11 lines
drivers/net/ethernet/microsoft/mana/mana_en.c +2
-2@@ -1791,8 +1793,8 @@ void mana_destroy_eq(struct mana_port_context *apc)continue ; msi = eq->eq.msix_index; -mana_gd_destroy_queue (gc, eq); -mana_gd_put_gic (gc, !gc->msi_sharing, msi); +if (!mana_gd_is_request_rejected (mana_gd_destroy_queue (gc, eq))) +mana_gd_put_gic (gc, !gc->msi_sharing, msi); }kfree (apc->eqs);
[Severity: High]
Does skipping mana_gd_put_gic() here and in mana_ib_destroy_eqs() break mana_gd_remove_irqs() and mana_cdx_remove_irqs() during device reset or removal?
When HWC requests are rejected (for example after mana_serv_reset() calls mana_gd_cancel_hwc_timeout()), mana_gd_destroy_queue() returns -ENOTCONN after deregistering the EQ from gic->eq_list, and the callers free apc->eqs and mdev->eqs without dropping their gic->refcount references. When mana_gd_cleanup() then runs mana_gd_remove_irqs() or mana_cdx_remove_irqs(), it calls mana_gd_put_gic() only once per vector:
drivers/net/ethernet/microsoft/mana/gdma_pci.c:mana_gd_remove_irqs() {
...
xa_for_each(&gc->irq_contexts, msi, gic)
mana_gd_put_gic(gc, false, msi);
WARN_ON(!xa_empty(&gc->irq_contexts));
pci_free_irq_vectors(pdev);
}For any vector whose refcount was elevated by both setup_hwc_irqs and an EQ (such as MSI 0 used by fatal_err_eq, shared MSI vectors, or all vectors on CDX and non-dynamic MSI-X), refcount_dec_and_test(&gic->refcount) does not reach zero, so free_irq() and xa_erase() are skipped before WARN_ON(!xa_empty(&gc->irq_contexts)) and pci_free_irq_vectors() / msi_domain_free_irqs_all(), leaving the IRQ handlers registered when gc is freed or resumed.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
PATCH v11 4/4 net: mana: add dynamic HWC queue depth with reinit path
In reply to Wei HuFrom: Long Li <[email protected]>
The HWC starts with depth-one bootstrap queues. Treat the PF-reported depth as a maximum and rebuild the channel exactly for reports from 2 through
128. Keep the untouched bootstrap queues for depth one and reports above 128, and require a rebuilt channel to repeat the selected depth.
Treat the reported request and response sizes as directional maxima. Rebuild only when both reports equal the 4096-byte bootstrap allocation. Keep allocation strides separate from these limits, and share the effective host-to-PF request budget with the GDMA and RDMA request builders. Bound RDMA CREATE and ADD_PAGES batches by that budget, checking that the headers and at least one page address fit before subtracting their sizes.
Require nonzero depth, request-size and response-size reports before deciding whether to keep the bootstrap queues. Apply the same validation to a restored bootstrap channel. A missing or zero required report fails with -EPROTO, even at depth one; do not silently substitute guessed limits.
Reject oversized messages before acquiring a slot or publishing caller storage. A retained, stopped channel still returns -ENODEV rather than reporting a size error against uninitialized negotiated limits.
Keep each candidate private through queue creation, establishment and the direct EQ test. Publish only the final tested channel. If a rebuild fails, including its functional test, tear it down and restore fresh, tested bootstrap queues. Stop if teardown is not acknowledged; never reuse PF-owned mappings. Restore the previous live timeout budget before the fallback so a failed test's fail-fast reduction does not poison the retry, without reviving terminal cancellation.
Invalidate the previous HWC doorbell before every ESTABLISH_HWC. Validate the BAR0 page geometry and reported index before accepting a new doorbell, and suppress MMIO while it is invalid. The original driver accepted an unchecked device-supplied index in its MMIO address calculation; this also fixes that existing out-of-bounds MMIO path. Backports need the complete ownership and validation dependencies, not the entire feature stack by default. A malformed doorbell completes initialization with -EPROTO without relying on later INIT_DONE events that might require re-arming through that doorbell.
Use the initial PF report to select the queue geometry. The PF directs this choice; the absence of VF size fields in ESTABLISH_HWC does not require keeping the bootstrap geometry. Driver-version advertisement occurs after HWC establishment and cannot negotiate behavior needed during creation.
Copilot-Session: 8c2361e6-c0f4-4b0c-bf01-b5e4cdacec50
--- drivers/infiniband/hw/mana/main.c | 19 +- .../net/ethernet/microsoft/mana/gdma_main.c | 26 +- .../net/ethernet/microsoft/mana/hw_channel.c | 316 +++++++++++++++--- include/net/mana/gdma.h | 2 + include/net/mana/hw_channel.h | 19 +- 5 files changed, 317 insertions(+), 65 deletions(-)
drivers/infiniband/hw/mana/main.c +13 -6
@@ -427,28 +427,38 @@ static int mana_ib_gd_create_dma_region(struct mana_ib_dev *dev, struct ib_umemunsigned int create_req_msg_size;struct hw_channel_context *hwc;struct ib_block_iter biter; -size_t max_pgs_add_cmd =0 ; +size_t max_pgs_add_cmd;size_t max_pgs_create_cmd;struct gdma_context *gc;size_t num_pages_total;unsigned int tail =0 ; +u32 req_limit;u64 *page_addr_list;void *request_buf;int err =0 ; gc =mdev_to_gc (dev); hwc = gc->hwc.driver_data; + req_limit =mana_hwc_get_max_req_size (hwc); +if (req_limit <struct_size (create_req, page_addr_list,1 ) || + req_limit <struct_size (add_req, page_addr_list,1 )) { +ibdev_dbg (&dev->ib_dev, +"HWC request budget %u is too small for DMA region commands\n" , + req_limit); +return -EMSGSIZE ; + } num_pages_total =ib_umem_num_dma_blocks (umem, page_sz); max_pgs_create_cmd = - (hwc->max_req_msg_size -sizeof (*create_req)) /sizeof (u64); + (req_limit -sizeof (*create_req)) /sizeof (u64); + max_pgs_add_cmd = (req_limit -sizeof (*add_req)) /sizeof (u64); num_pages_to_handle =min_t (size_t, num_pages_total, max_pgs_create_cmd); create_req_msg_size =struct_size (create_req, page_addr_list, num_pages_to_handle); - request_buf =kzalloc (hwc->max_req_msg_size,GFP_KERNEL ); + request_buf =kzalloc (req_limit,GFP_KERNEL );if (!request_buf)return -ENOMEM ;
@@ -491,9 +501,6 @@ static int mana_ib_gd_create_dma_region(struct mana_ib_dev *dev, struct ib_umemif (err) goto out; - max_pgs_add_cmd = (hwc->max_req_msg_size - -sizeof (*add_req)) /sizeof (u64); - add_req = request_buf; add_req->dma_region_handle = *gdma_region; add_req->reserved3 =0 ;
drivers/net/ethernet/microsoft/mana/gdma_main.c +17 -9
@@ -589,12 +589,26 @@ static int mana_gd_disable_queue(struct gdma_queue *queue)#define DOORBELL_OFFSET_EQ 0xFF8#define DOORBELL_OFFSET_DIM 0x820 +bool mana_gd_is_valid_doorbell (struct gdma_context *gc,u32 db_id) +{ +if (!gc->db_page_size || gc->db_page_off >= gc->bar0_size) +return false; + +return gc->db_page_off + + gc->db_page_size * ((u64 )db_id +1 ) <= gc->bar0_size; +} +static void mana_gd_ring_doorbell (struct gdma_context *gc,u32 db_index,enum gdma_queue_type q_type,u32 qid,u32 tail_ptr,u8 num_req,u8 client_offset) { -void __iomem *addr = gc->db_page_base + gc->db_page_size * db_index;union gdma_doorbell_entry e = {}; +void __iomem *addr; + +if (unlikely (db_index ==INVALID_DOORBELL )) +return ; + + addr = gc->db_page_base + gc->db_page_size * db_index; addr += client_offset;
@@ -1348,7 +1362,7 @@ static int mana_gd_create_dma_region(struct gdma_dev *gd,/* The caller must keep the HWC alive throughout queue creation. */ hwc = gc->hwc.driver_data; req_msg_size =struct_size (req, page_addr_list, num_page); -if (req_msg_size > hwc->max_req_msg_size) +if (req_msg_size >mana_hwc_get_max_req_size (hwc))return -EINVAL ; req =kzalloc (req_msg_size,GFP_KERNEL );
@@ -1637,13 +1651,7 @@ int mana_gd_register_device(struct gdma_dev *gd)return err ? err : -EPROTO ; } -/* Validate that doorbell page for db_id is within the BAR0 region. -* In mana_gd_ring_doorbell(), the address is calculated as: -* addr = db_page_base + db_page_size * db_id -* = (bar0_va + db_page_off) + (db_page_size * db_id) -* So we need: db_page_off + db_page_size * (db_id + 1) <= bar0_size -*/ -if (gc->db_page_off + gc->db_page_size * ((u64 )resp.db_id +1 ) > gc->bar0_size) { +if (!mana_gd_is_valid_doorbell (gc, resp.db_id)) {dev_err (gc->dev,"Doorbell ID %u out of range\n" , resp.db_id);return -EPROTO ; }
drivers/net/ethernet/microsoft/mana/hw_channel.c +267 -49
438 lines not on this page · raw message
include/net/mana/gdma.h +2 -0
@@ -621,6 +621,8 @@ void mana_gd_fence_eq(struct gdma_context *gc, struct gdma_queue *queue);int mana_gd_poll_cq (struct gdma_queue *cq,struct gdma_comp *comp,int num_cqe); +bool mana_gd_is_valid_doorbell (struct gdma_context *gc,u32 db_id); +void mana_gd_ring_cq (struct gdma_queue *cq,u8 arm_bit); ssize_t mana_gd_read_ring(struct gdma_queue *q, char __user *buf,
include/net/mana/hw_channel.h +18 -1
@@ -5,6 +5,7 @@#define _HW_CHANNEL_H#include <linux/atomic.h> +#include <linux/minmax.h> #define DEFAULT_LOG2_THROTTLING_FOR_ERROR_EQ 4
@@ -13,6 +14,9 @@#define HW_CHANNEL_VF_BOOTSTRAP_QUEUE_DEPTH 1 +/* Largest supported rebuild depth; larger reports retain bootstrap queues. */ +#define HW_CHANNEL_MAX_QUEUE_DEPTH 128 +#define HWC_INIT_DATA_CQID 1#define HWC_INIT_DATA_RQID 2#define HWC_INIT_DATA_SQID 3
@@ -200,12 +204,18 @@ struct hw_channel_context {u16 num_inflight_msg;u32 max_req_msg_size; +u32 max_resp_msg_size; +/* Immutable reported maxima for the final RQ and SQ directions. */ +u32 rx_msg_size_limit; +u32 tx_msg_size_limit; -u16 hwc_init_q_depth_max; +u32 hwc_init_q_depth_max;u32 hwc_init_max_req_msg_size;u32 hwc_init_max_resp_msg_size;u32 hwc_init_max_num_cqs;u32 hwc_init_cq_id; +bool hwc_init_doorbell; +int hwc_init_error;struct completion hwc_init_eqe_comp;
@@ -240,6 +250,13 @@ struct hw_channel_context {struct hwc_caller_ctx *caller_ctx; }; +/* Host-to-PF requests are bounded by the negotiated TX limit and SQ stride. */ +static inline u32 +mana_hwc_get_max_req_size (const struct hw_channel_context *hwc) +{ +return min (hwc->tx_msg_size_limit, hwc->max_resp_msg_size); +} +int mana_hwc_create_channel (struct gdma_context *gc);void mana_hwc_destroy_channel (struct gdma_context *gc);void mana_hwc_free_retained_channel (struct gdma_context *gc);
Signature · 1 line
2.43.0
Re: [PATCH net-next v11 4/4] net: mana: add dynamic HWC queue depth with reinit path
Quoted 81 lines · Wei Hu
From: Long Li <[email protected]>
The HWC starts with depth-one bootstrap queues. Treat the PF-reported depth as a maximum and rebuild the channel exactly for reports from 2 through
128. Keep the untouched bootstrap queues for depth one and reports above 128, and require a rebuilt channel to repeat the selected depth.Treat the reported request and response sizes as directional maxima. Rebuild only when both reports equal the 4096-byte bootstrap allocation. Keep allocation strides separate from these limits, and share the effective host-to-PF request budget with the GDMA and RDMA request builders. Bound RDMA CREATE and
ADD_PAGESbatches by that budget, checking that the headers and at least one page address fit before subtracting their sizes.Require nonzero depth, request-size and response-size reports before deciding whether to keep the bootstrap queues. Apply the same validation to a restored bootstrap channel. A missing or zero required report fails with
-EPROTO, even at depth one; do not silently substitute guessed limits.Reject oversized messages before acquiring a slot or publishing caller storage. A retained, stopped channel still returns
-ENODEVrather than reporting a size error against uninitialized negotiated limits.Keep each candidate private through queue creation, establishment and the direct EQ test. Publish only the final tested channel. If a rebuild fails, including its functional test, tear it down and restore fresh, tested bootstrap queues. Stop if teardown is not acknowledged; never reuse PF-owned mappings. Restore the previous live timeout budget before the fallback so a failed test's fail-fast reduction does not poison the retry, without reviving terminal cancellation.
Invalidate the previous HWC doorbell before every
ESTABLISH_HWC. Validate the BAR0 page geometry and reported index before accepting a new doorbell, and suppress MMIO while it is invalid. The original driver accepted an unchecked device-supplied index in its MMIO address calculation; this also fixes that existing out-of-bounds MMIO path. Backports need the complete ownership and validation dependencies, not the entire feature stack by default. A malformed doorbell completes initialization with-EPROTOwithout relying on laterINIT_DONEevents that might require re-arming through that doorbell.Use the initial PF report to select the queue geometry. The PF directs this choice; the absence of VF size fields in
ESTABLISH_HWCdoes not require keeping the bootstrap geometry. Driver-version advertisement occurs after HWC establishment and cannot negotiate behavior needed during creation.Fixes ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")Signed-off-by Long Li <[email protected]>Signed-off-by Wei Hu <[email protected]>Co-authored-by Copilot <[email protected]>Copilot-Session: 8c2361e6-c0f4-4b0c-bf01-b5e4cdacec50
--- drivers/infiniband/hw/mana/main.c | 19 +- .../net/ethernet/microsoft/mana/gdma_main.c | 26 +- .../net/ethernet/microsoft/mana/hw_channel.c | 316 +++++++++++++++--- include/net/mana/gdma.h | 2 + include/net/mana/hw_channel.h | 19 +- 5 files changed, 317 insertions(+), 65 deletions(-)drivers/infiniband/hw/mana/main.c +2
-1@@ -427,28 +427,38 @@ static int mana_ib_gd_create_dma_region(struct mana_ib_dev *dev, struct ib_umemunsigned int create_req_msg_size;struct hw_channel_context *hwc;struct ib_block_iter biter; -size_t max_pgs_add_cmd =0 ; +size_t max_pgs_add_cmd;size_t max_pgs_create_cmd;struct gdma_context *gc;size_t num_pages_total;unsigned int tail =0 ; +u32 req_limit;u64 *page_addr_list;void *request_buf;int err =0 ;
drivers/infiniband/hw/mana/main.c static int mana_ib_gd_create_dma_region(struct mana_ib_dev *dev, struct ib_umem · line 449
Quoted 10 lines
drivers/infiniband/hw/mana/main.c +8
-0gc =mdev_to_gc (dev); hwc = gc->hwc.driver_data; + req_limit =mana_hwc_get_max_req_size (hwc); +if (req_limit <struct_size (create_req, page_addr_list,1 ) || + req_limit <struct_size (add_req, page_addr_list,1 )) { +ibdev_dbg (&dev->ib_dev, +"HWC request budget %u is too small for DMA region commands\n" , + req_limit); +return -EMSGSIZE ; + }
No. Make sure you also call mana_ib_gd_create_dma_region() with valid parameters.
Thanks
[email protected]
AI reviewRe: [PATCH net-next v11 4/4] net: mana: add dynamic HWC queue depth with reinit path
In reply to Wei HuThank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] net: mana: swapped HWC request/response limits in mana_hwc_finish_channel() - [Medium] net: mana…
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [Medium] net: mana: swapped HWC request/response limits in mana_hwc_finish_channel()
- [Medium] net: mana: duplicate mana_hwc_teardown_queues() on HWC rebuild failure
--
commit 3fabf9cbfe8a174f5953b462e57e3b1f0fcf54f1
Author: Long Li <[email protected]>
net: mana: add dynamic HWC queue depth with reinit path
This commit adds support for dynamically rebuilding the MANA hardware channel queues to the PF-reported queue depth (up to 128), validating reported message size limits and doorbells, and falling back to bootstrap queues if rebuilding fails.
Quoted 4 lines
drivers/net/ethernet/microsoft/mana/hw_channel.c +0
-0
[ ... ]
Quoted 38 lines
drivers/net/ethernet/microsoft/mana/hw_channel.c +33
-1@@ -1175,32 +1256,169 @@ void mana_hwc_free_retained_channel(struct gdma_context *gc) gc->hwc.gdma_context =NULL ; } -static int mana_hwc_create_bootstrap_channel (struct hw_channel_context *hwc) +static int +mana_hwc_validate_report (struct hw_channel_context *hwc, +const struct mana_hwc_init_report *report, +u32 expected_depth,bool check_depth, +bool require_exact_msg_sizes) +{ +if (!report->queue_depth || !report->max_req_msg_size || + !report->max_resp_msg_size) { +dev_err (hwc->dev, +"HWC: invalid maxima depth=%u req=%u resp=%u\n" , + report->queue_depth, report->max_req_msg_size, + report->max_resp_msg_size); +return -EPROTO ; + } + +if (require_exact_msg_sizes && + (report->max_req_msg_size !=HW_CHANNEL_MAX_REQUEST_SIZE || + report->max_resp_msg_size !=HW_CHANNEL_MAX_RESPONSE_SIZE )) { +dev_err (hwc->dev, +"HWC: rebuilt message maxima req=%u resp=%u, expected %u/%u\n" , + report->max_req_msg_size, report->max_resp_msg_size, +HW_CHANNEL_MAX_REQUEST_SIZE , +HW_CHANNEL_MAX_RESPONSE_SIZE ); +return -EPROTO ; + } + +if (check_depth && report->queue_depth != expected_depth) { +dev_err (hwc->dev,"HWC: rebuilt depth %u, expected %u\n" , + report->queue_depth, expected_depth); +return -EPROTO ; + } + +return 0 ;
drivers/net/ethernet/microsoft/mana/hw_channel.c void mana_hwc_free_retained_channel(struct gdma_context *gc) · line 1301
Quoted 10 lines
drivers/net/ethernet/microsoft/mana/hw_channel.c +10
-0+} + +static int mana_hwc_finish_channel (struct hw_channel_context *hwc, +const struct mana_hwc_init_report *report) +{ +int err; + +/* MAX_REQUEST sizes the RQ; MAX_RESPONSE sizes the SQ. */ + hwc->rx_msg_size_limit = report->max_req_msg_size; + hwc->tx_msg_size_limit = report->max_resp_msg_size;
[Severity: Medium]
Are rx_msg_size_limit and tx_msg_size_limit swapped here?
On the HWC, the host sends requests over hwc->txq (GDMA_SQ) in mana_hwc_send_request() and receives responses over hwc->rxq (GDMA_RQ) in mana_hwc_rx_event_handler(). Because tx_msg_size_limit is populated from report->max_resp_msg_size and rx_msg_size_limit from report->max_req_msg_size, mana_hwc_get_max_req_size() and mana_hwc_get_msg_index() check outgoing req_len against the PF-reported response limit and incoming resp_len against the request limit.
When the PF reports asymmetric HWC_INIT_DATA_MAX_REQUEST and HWC_INIT_DATA_MAX_RESPONSE values (where mana_hwc_prepare_channel() keeps the bootstrap queues), a smaller MAX_RESPONSE will cause outgoing requests such as mana_gd_create_dma_region() and mana_ib_gd_create_dma_region() to be capped or rejected with -EMSGSIZE or -EINVAL against the response limit.
Quoted 7 lines
drivers/net/ethernet/microsoft/mana/hw_channel.c +7
-0+ + err =mana_hwc_test_channel (hwc); +if (err) +dev_err (hwc->dev,"Failed to test HWC: %d\n" , err); + +return err; +}
[ ... ]
Quoted 28 lines
drivers/net/ethernet/microsoft/mana/hw_channel.c +28
-0+static int mana_hwc_rebuild_channel (struct hw_channel_context *hwc, +u16 q_depth, +struct mana_hwc_init_report *report) +{ +u32 timeout_ms =mana_hwc_timeout_read (hwc); +int cleanup_err; +int err; + + err =mana_hwc_teardown_queues (hwc); +if (err) +return err; + + err =mana_hwc_build_channel (hwc, q_depth, report); +if (!err) + err =mana_hwc_validate_report (hwc, report, q_depth, + true, true); +if (!err) + err =mana_hwc_finish_channel (hwc, report); +if (!err) +return 0 ; + +dev_warn (hwc->dev, +"HWC depth %u rebuild failed, restoring bootstrap: %d\n" , + q_depth, err); + + cleanup_err =mana_hwc_teardown_queues (hwc); +if (cleanup_err) +return cleanup_err;
[ ... ]
drivers/net/ethernet/microsoft/mana/hw_channel.c int mana_hwc_create_channel(struct gdma_context *gc) · line 1457
Quoted 9 lines
drivers/net/ethernet/microsoft/mana/hw_channel.c +1
-1@@ -1233,7 +1451,7 @@ int mana_hwc_create_channel(struct gdma_context *gc) gd->pdid =INVALID_PDID ; gd->doorbell =INVALID_DOORBELL ; - err =mana_hwc_create_bootstrap_channel (hwc); + err =mana_hwc_prepare_channel (hwc);if (err) {mana_hwc_release_channel (hwc);return err;
[Severity: Medium]
Does failing inside mana_hwc_teardown_queues() during mana_hwc_rebuild_channel() cause mana_hwc_release_channel() to run mana_hwc_teardown_queues() a second time on the same active channel?
When mana_smc_teardown_hwc() fails in mana_hwc_teardown_queues(), hwc->setup_active remains true and the channel is fenced, and that error is returned through mana_hwc_prepare_channel() to mana_hwc_create_channel(). mana_hwc_release_channel() then calls mana_hwc_teardown_queues() again while hwc->setup_active is still true, issuing a second SMC teardown transaction that can stall in mana_smc_poll_register() for another 20 to 40 seconds or send a duplicate SMC_MSG_TYPE_DESTROY_HWC if the PF completed the first teardown right after it timed out.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
[email protected]
AI reviewThis is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:
Hi!
This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical (e.g. found by LLM and not proven at runtime). If it was triggered please include the symptoms, like the stack trace or kernel messages.
- What hardware the change was tested on. For driver fixes please mention the device (and if relevant firmware version) used for testing, or say that the change was not tested on real hardware.
Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account.
*IMPORTANT*: If you do repost (for other reasons) - please include the relevant info in the cover letter or commit messages.
Signature · 2 lines
The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.