From nobody Thu Oct 31 16:01:23 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 4XfTJ35n37z5bwmM; Thu, 31 Oct 2024 16:01:23 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTJ34dCfz4Svk; Thu, 31 Oct 2024 16:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390483; 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=I5cEaYHjykoU7+DW09my1SFEq3YiraRFtNx+6vucDtk=; b=vwSoX1lGqRGBxRKyEc/jJSIN8nLLANkgfFCyRHalbCv7m4Atd2/j914oDyRkzpP7t7m9k3 xaS6871G223935sVNSo+CInNUk8eFzTyVfB8r4WyhoDrTYMkh1e+ujQ2vh3J+dIXXPGx99 jNziSqWZEV0GWTE9jXSm5GmHppN0sIelXHYlpd04Q/eQqERfqlIjL9uPfd/Y7xbCmM6NR7 NmnR/LbpT9Ur5A+brlttpPwa4r3CbHODyuWy7AwQuY5Wm0ymK2SDAVfJ+19Tbq31N6+gus kDjuweoGUkc3tRThtKjZXS7XjEytm2WEGy0JxuyppDFQiCyx83GRBKA83DDkBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390483; 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=I5cEaYHjykoU7+DW09my1SFEq3YiraRFtNx+6vucDtk=; b=YCk6l155X/4wnD0zO1bY33U0WjT7ETim2hmjXwrsjH2VsE6+2yPOlSjJW2VUEOfRPQAZx5 o39l+7tYPdAGL5DCWS1H96eBgepS+Zm8qQSgQa3wXREl14JrH8jvq36LpOckES6G0+7dR6 wPAPuSqgucud9bBqJwPHXSiK+u4VosF3og4SL5lHzId7mNGaglpxcP8KriMRZH8xwGUO+H AhUoVyrWPvp1yZeSumgbE6aves1OCxnf9jy907nVJlfziD3SJOvJ58QJ5Sd6IQaUwrpTuK eJ0+6+fv3z1HAUEARj04Eawoj3JY/Hendv8HXRFCv2urR2mIss+xfPdnJcVXAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390483; a=rsa-sha256; cv=none; b=OLNtN+S+wjRRZ5lxxrtPPvjS9+YRDAAUrYhjv7rq7U4TkHSIKRL7SlniAEKlUqKmi+sc6z q0pxbFVZ3oSzRU3/Z1QrUOsecWtidOqygyVMLJiSplkJbov2Bad5Z3vzk5y+YXdxzAGCgT wRz478SUZqaAZs1V+hHiYdL5jkS9bhRsYsfig+hmsLUgejQPs6OZd76cZaJtJthjhs6c03 uNuB/nPSBuwxVDepkpMNHYcv6pLxEQJXiT+oeEdeI8PoA1nWhTTPH8ib/V0+3NFYZW6DO/ fITc8HkXW9z7T7OvmOU7oTQeBgdsq91MjXZ5is7YuI7JKNQoXY3HADaa5rbT7g== 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 4XfTJ33js5zhs9; Thu, 31 Oct 2024 16:01:23 +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 49VG1NO9069956; Thu, 31 Oct 2024 16:01:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1NV8069953; Thu, 31 Oct 2024 16:01:23 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:23 GMT Message-Id: <202410311601.49VG1NV8069953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 740fb85ba285 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 740fb85ba28512a7ea7b5408691b5a8e697435a7 Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=740fb85ba28512a7ea7b5408691b5a8e697435a7 commit 740fb85ba28512a7ea7b5408691b5a8e697435a7 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:18 +0000 Commit: Osama Abboud 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 };