git: 740fb85ba285 - stable/14 - ena: Add configuration notifications interface support
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 31 Oct 2024 16:01:23 UTC
The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=740fb85ba28512a7ea7b5408691b5a8e697435a7 commit 740fb85ba28512a7ea7b5408691b5a8e697435a7 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:54:10 +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 6c1cbb6701de..3f2b9c1fb138 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2911,7 +2911,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); @@ -4041,11 +4042,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 };