summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSahil Chandna <sahilchandna@linux.microsoft.com>2026-10-28 03:40:17 -0500
committerPaolo Abeni <pabeni@redhat.com>2026-11-03 09:47:33 +0100
commit684603842b78f75835d21fdf5c19ae717ed8eb1a (patch)
tree8ba35fb48b559d39cd9ff5c9813e9274ca615ed9 /include
parentc3e67bd82b9b9b1a5118f09a429ccefe2aab0741 (diff)
net: mana: Add support to process throttled EQEs
When an event queue nears full, the hardware coalesces the per-CQ GDMA_EQE_COMPLETION notifications into a single throttle EQE (type 4) that carries no cq_id. The driver does not handle this event type, so it falls through to the default case and is dropped. Any CQ whose completion notification was replaced by the throttle EQE can remain unserviced, causing its queue to stall. This was observed internally as a TX stall: ens1: NETDEV WATCHDOG: CPU: 45: transmit queue 1 timed out 15133 ms mana 7870:00:00.0: HWC: Request timed out: 60000 ms mana 7870:00:00.0: Gf stats wk handler: gf stats query timed out. ens1: NETDEV WATCHDOG: CPU: 20: transmit queue 0 timed out 15859 ms ens1: NETDEV WATCHDOG: CPU: 15: transmit queue 0 timed out 31731 ms ens1: NETDEV WATCHDOG: CPU: 21: transmit queue 0 timed out 47603 ms ens1: NETDEV WATCHDOG: CPU: 42: transmit queue 0 timed out 62451 ms Handle the throttle EQE: - Record up to two child CQs per EQ when a CQ is created with a parent EQ. A mana_en EQ serves one TX CQ and one RX CQ, and the HWC EQ serves the HWC CQ. - On a throttle EQE, call the callback of each child CQ that is still in cq_table[]. - Before a child CQ is freed, unlink it from its parent EQ and from cq_table[] in mana_gd_detach_cq(), then wait for an RCU grace period, because mana_gd_intr() reads both under rcu_read_lock(). mana_destroy_txq() and mana_destroy_rxq() detach the CQ before deleting its NAPI, so the synchronize_net() that NAPI deletion already needs also covers the CQ. mana_hwc_destroy_channel() detaches the HWC CQ and waits for a grace period before freeing the HWC queues. - Advertise the capability bit for throttled EQE. - Add a throttle eqe counter per queue. Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)") Cc: stable@vger.kernel.org Signed-off-by: Sahil Chandna <sahilchandna@linux.microsoft.com> Link: https://patch.msgid.link/20261028084020.2051254-1-sahilchandna@linux.microsoft.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/mana/gdma.h19
-rw-r--r--include/net/mana/mana.h1
2 files changed, 19 insertions, 1 deletions
diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h
index 0b52582118e8..29d152e18596 100644
--- a/include/net/mana/gdma.h
+++ b/include/net/mana/gdma.h
@@ -60,6 +60,7 @@ enum gdma_work_request_flags {
enum gdma_eqe_type {
GDMA_EQE_COMPLETION = 3,
+ GDMA_EQE_THROTTLE = 4,
GDMA_EQE_TEST_EVENT = 64,
GDMA_EQE_HWC_INIT_EQ_ID_DB = 129,
GDMA_EQE_HWC_INIT_DATA = 130,
@@ -291,6 +292,7 @@ struct gdma_dev {
#define GDMA_EQE_SIZE 16
#define GDMA_MAX_SQE_SIZE 512
#define GDMA_MAX_RQE_SIZE 256
+#define GDMA_EQ_MAX_CHILD_CQ 2
#define GDMA_COMP_DATA_SIZE 0x3C
@@ -318,6 +320,11 @@ struct gdma_event {
struct gdma_queue;
+struct gdma_eq_stats {
+ u64_stats_t throttle_count;
+ struct u64_stats_sync syncp;
+};
+
struct mana_eq {
struct gdma_queue *eq;
struct dentry *mana_eq_debugfs;
@@ -371,6 +378,10 @@ struct gdma_queue {
unsigned int irq;
u32 log2_throttle_limit;
+
+ struct gdma_eq_stats stats;
+
+ struct gdma_queue __rcu *child_cq[GDMA_EQ_MAX_CHILD_CQ];
} eq;
struct {
@@ -601,6 +612,8 @@ void mana_gd_free_service_wq(struct gdma_context *gc);
void mana_gd_ring_dim(struct gdma_queue *cq, u32 mod_usec, bool mod_usec_vld,
u32 mod_comps, bool mod_comps_vld);
+bool mana_gd_detach_cq(struct gdma_context *gc, struct gdma_queue *queue);
+
struct gdma_wqe {
u32 reserved :24;
u32 last_vbytes :8;
@@ -760,6 +773,9 @@ enum {
/* Driver supports non-contiguous queue buffers */
#define GDMA_DRV_CAP_FLAG_1_NON_CONTIGUOUS_BUFFERS BIT(30)
+/* Driver supports handling throttled EQEs */
+#define GDMA_DRV_CAP_FLAG_1_THROTTLED_EVENT_QUEUE BIT_ULL(32)
+
/* Capabilities in the PCI-only group below rely on dynamic MSI-X allocation
* and on the servicing and reset paths reached through
* mana_schedule_serv_work(). Transports that provide neither leave
@@ -784,7 +800,8 @@ enum {
GDMA_DRV_CAP_FLAG_1_HANDLE_STALL_SQ_RECOVERY | \
GDMA_DRV_CAP_FLAG_1_EQ_MSI_UNSHARE_MULTI_VPORT | \
GDMA_DRV_CAP_FLAG_1_DYN_INTERRUPT_MODERATION | \
- GDMA_DRV_CAP_FLAG_1_NON_CONTIGUOUS_BUFFERS)
+ GDMA_DRV_CAP_FLAG_1_NON_CONTIGUOUS_BUFFERS | \
+ GDMA_DRV_CAP_FLAG_1_THROTTLED_EVENT_QUEUE)
#define GDMA_DRV_CAP_FLAGS2 0
diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
index 71d726b1f784..09725e3256fa 100644
--- a/include/net/mana/mana.h
+++ b/include/net/mana/mana.h
@@ -90,6 +90,7 @@ enum mana_priv_flag_bits {
/* Update this count whenever the respective structures are changed */
#define MANA_STATS_RX_COUNT (6 + MANA_CQE_COAL_PKTS_8 - 1)
#define MANA_STATS_TX_COUNT 11
+#define MANA_STATS_EQ_COUNT 1
#define MANA_RX_FRAG_ALIGNMENT 64