git: 8e9b6049b093 - stable/13 - ena: Add configuration notifications interface support
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 31 Oct 2024 15:59:57 UTC
The branch stable/13 has been updated by osamaabb:
URL: https://cgit.FreeBSD.org/src/commit/?id=8e9b6049b09321cb8c4d488050310f34dfd4f3a7
commit 8e9b6049b09321cb8c4d488050310f34dfd4f3a7
Author: Osama Abboud <osamaabb@amazon.com>
AuthorDate: 2024-08-07 06:24:18 +0000
Commit: Osama Abboud <osamaabb@FreeBSD.org>
CommitDate: 2024-10-31 14:55:19 +0000
ena: Add configuration notifications interface support
This commit is part of the effort of notifying the user of non-optimal
or performance impacting practices.
A new interface is serving as a communication channel
between the device and the driver. One of the goals of this channel is
to create a new mechanism of notifying the driver and user in case of
sub-optimal configuration using a bitmap.
Approved by: cperciva (mentor)
Sponsored by: Amazon, Inc.
(cherry picked from commit 8cd86b51be4ab0fe70bad4830e608d56db5c850f)
---
sys/dev/ena/ena.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c
index 719dd4b58bae..c268c40d460c 100644
--- a/sys/dev/ena/ena.c
+++ b/sys/dev/ena/ena.c
@@ -2912,7 +2912,8 @@ ena_device_init(struct ena_adapter *adapter, device_t pdev,
BIT(ENA_ADMIN_FATAL_ERROR) |
BIT(ENA_ADMIN_WARNING) |
BIT(ENA_ADMIN_NOTIFICATION) |
- BIT(ENA_ADMIN_KEEP_ALIVE);
+ BIT(ENA_ADMIN_KEEP_ALIVE) |
+ BIT(ENA_ADMIN_CONF_NOTIFICATIONS);
aenq_groups &= get_feat_ctx->aenq.supported_groups;
rc = ena_com_set_aenq_config(ena_dev, aenq_groups);
@@ -4042,11 +4043,38 @@ unimplemented_aenq_handler(void *adapter_data,
"Unknown event was received or event with unimplemented handler\n");
}
+static void ena_conf_notification(void *adapter_data,
+ struct ena_admin_aenq_entry *aenq_e)
+{
+ struct ena_adapter *adapter = (struct ena_adapter *)adapter_data;
+ struct ena_admin_aenq_conf_notifications_desc *desc;
+ u64 bitmap, bit;
+
+ desc = (struct ena_admin_aenq_conf_notifications_desc *)aenq_e;
+ bitmap = desc->notifications_bitmap;
+
+ if (bitmap == 0) {
+ ena_log(adapter->pdev, INFO,
+ "Empty configuration notification bitmap\n");
+ return;
+ }
+
+ for (bit = ffsll(bitmap); bit != 0; bit = ffsll(bitmap)) {
+ bit--;
+ ena_log(adapter->pdev, INFO,
+ "Sub-optimal configuration notification code: %" PRIu64 " Refer to AWS ENA documentation for additional details and mitigation options.\n",
+ bit + 1);
+ // Clear the processed bit
+ bitmap &= ~(1UL << bit);
+ }
+}
+
static struct ena_aenq_handlers aenq_handlers = {
.handlers = {
[ENA_ADMIN_LINK_CHANGE] = ena_update_on_link_change,
[ENA_ADMIN_NOTIFICATION] = ena_notification,
[ENA_ADMIN_KEEP_ALIVE] = ena_keep_alive_wd,
+ [ENA_ADMIN_CONF_NOTIFICATIONS] = ena_conf_notification,
},
.unimplemented_handler = unimplemented_aenq_handler
};