From nobody Tue Oct 15 17:43:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XShJl48YLz5YlYC; Tue, 15 Oct 2024 17:43:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XShJl2BFpz4Z6V; Tue, 15 Oct 2024 17:43:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729014183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=47OJSYhNiNWPfkiR9sJWv2NUerhlLjLRownBqbCaaf8=; b=x/2KSd/4VtjS3yEgv/Q3EgJ+0UqrRU2YSeQR2i+hZ7nCejYHtI7/3HzB/7L4BYIp7EvhMP 9qACDFOsoPhgvmaR31RugY06cb0WPD5VOrEgShixhUihlt31RJHLas4QKVGV/d+0SfsaPx l9zPeFyYVInFQmoapLr3OFfPu/MXtJ6m10GV88eG5aWkWUDwxXl3c31W7iUFYDBI4Sr8ao NrUaIZmqC0nBPWQh/dueizMu4zLshgugQ+vvqWgAIUdcvuegNLJjQJziRNVf0PP9Ixdu2Z bx3a5dC7ODEBelOZdhfa11jbtCTKt9kTE1kl3j/MiUEpCUDReDeq09s8js6j8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729014183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=47OJSYhNiNWPfkiR9sJWv2NUerhlLjLRownBqbCaaf8=; b=EyOuF3RxWR9r5FM0cuhKc/ZSmZe/jtLmG13MZzKNoPY4jKYR4+HyoxCUghwUfFdG6l4XsX WZIUczncq/Rn0CHdBzYmbBlEHQN0/fbIUlIstFqBFSk7LHFsllxhnfl50s694hazl2pSVo lCSaocpafuxMOoVSuhQzBYTvHEP9mIvepZsiVuzlhMLyKCwcPGquNfH2OdaF+ykeLzxULk kJJFig0aCt6XOvbV1LvpmBkrPBYpljARXNhT8JE+5OIBToqpxAMIJywnp4RVmqK35tdI+6 Ti3o84nONeymPiv3uC0v59UgP627EW8JNqKxqTSW7Rh0IKZcUizGIZ4ZzI+fSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729014183; a=rsa-sha256; cv=none; b=HGn2zTrrJi5tBMyNgGfqJFVlC+BIEaRn4+fvWO0B4ZHc7oWOcKcUE9LdP7l8wTTk6zjeCM 3DWyfPqNDAky9QpgCOogRbkq2ROoAlEfIjHxYyVcHZucriXfLZSTRkAJr0Fvx2ivxMMv6Q 2zjo5SiDHEWLhCLLWGIAORBjrumG1hV3/PiKFdf8NP/z9dEu7GZQI+N1J8Z/o3zDsyqw82 0FqdiGlcK2DCwqnXY9w/HT9VuYD9ZkKqJsvDbMjS7vbJhFqCj4qgNQ24MkvyMVq068lZB6 JrLVeWnbfcDHpqZFyXHjJwexoTiOvuA6zNm1RRfwScCY8+xBTupUb0f4RL4VTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XShJl0HwfzX9R; Tue, 15 Oct 2024 17:43:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49FHh2u4061940; Tue, 15 Oct 2024 17:43:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49FHh2uq061937; Tue, 15 Oct 2024 17:43:02 GMT (envelope-from git) Date: Tue, 15 Oct 2024 17:43:02 GMT Message-Id: <202410151743.49FHh2uq061937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Osama Abboud Subject: git: 8cd86b51be4a - main - ena: Add configuration notifications interface support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8cd86b51be4ab0fe70bad4830e608d56db5c850f Auto-Submitted: auto-generated The branch main has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=8cd86b51be4ab0fe70bad4830e608d56db5c850f commit 8cd86b51be4ab0fe70bad4830e608d56db5c850f Author: Osama Abboud AuthorDate: 2024-08-07 06:24:18 +0000 Commit: Osama Abboud CommitDate: 2024-10-15 17:38:31 +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) MFC after: 2 weeks Sponsored by: Amazon, Inc. --- 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 };