From nobody Thu Oct 31 15:59:57 2024 X-Original-To: dev-commits-src-branches@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 4XfTGQ0Dz5z5bwWd; Thu, 31 Oct 2024 15:59:58 +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 4XfTGP6jLcz4Nv6; Thu, 31 Oct 2024 15:59:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390397; 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=FppXkuuDRvyCUt3FbFfZ63NmKPybKBZt2SOkXyv4dq0=; b=NXK1WtS6e7vlaIf9OjwbmTOVTnEx+Nzh4dT9V6U6WQungUqJdCej9D3a9FXBuM+14YugBO DUhOQwcdDw9jSML83IGKxcAqWVsRuLqWpcby+jFFZorpwubCm/kgGEYwY2TlSZbWzICqSI GngeWWKGeYUQk7Vn4yRj+l9db2/2GREOGGc6ztZizEDAKRYlccrNiZ1Vem8GSxmMZ8sx+S GNug+e80zeAB6HF8W/FCPI6lsAxjJbhAVkPcMELP8g4MEDK807byF+0Tpp7rCCTEFR1VrP xdoZ30JYWNjBd4ezzySQA2g1M2GaXZZQsSrycFTeOpoUIxn1CpKhkXtjuTPo2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390397; 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=FppXkuuDRvyCUt3FbFfZ63NmKPybKBZt2SOkXyv4dq0=; b=PGVq41eUNMAggZbQXXBs9AOj/JhflH58nUl06qL7Qz4hAcKU+KmWvolJL9QUM5phnI9vhV c95u+0+PbW9jAf/gruqDca417g8opmheKxrOHXvEbtxfwAUrY5iSc0+xGCTDnnNQgyKq36 oIld5nvPNsHuW3Co4myZk1IgcsdGEI0B6zpq5PcvZFRf7X5srwLthxJNc3bACvJEzxIGvV ZKu4Sl5uaMf0oMPNKkY9AJmUniNos4j3a6kM7yf/tyD88iFWDzaxQM0yE4I3Gfy4T6iBP2 95oIM9y4/MpXnIvOXb/eGt0UEpTTsAI5gFYCP2h6GtGVKlTAQOp1C6luv9oTbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390397; a=rsa-sha256; cv=none; b=EFBvdt0gAdPLQUgNrAwtoHJkIuj+wP4qE59ICmTzvaQhVZU0cp1UaYnqdMuDeBvNydNnfr Wwq6hDbLCVQMnXS2k1Oq277cUfoY0xrkmSVbp6PKEWJNT4BkY/MlsHJ3vsHDCMgVb0Nztu dw6U7LP9/jXCmBifckpA3Lk73UOEGAvvL0fks41c9zdtWvXild0HZycLdU0nm/9KVXLSU1 gFrAE0gF80EA8OhSsD0UtST3BuJh6UmXj4rQaeCeVy49wyeaPX47XnDdGytoR/70ORZdnc DK3KGftigMbarBcx8usg8BeVd/jJ+cM+DcjcQOWY0UrstUN1iF8ZPk1qQq1vAw== 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 4XfTGP5vckzj59; Thu, 31 Oct 2024 15:59:57 +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 49VFxv7s056556; Thu, 31 Oct 2024 15:59:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VFxvLF056553; Thu, 31 Oct 2024 15:59:57 GMT (envelope-from git) Date: Thu, 31 Oct 2024 15:59:57 GMT Message-Id: <202410311559.49VFxvLF056553@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: 8e9b6049b093 - stable/13 - ena: Add configuration notifications interface support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: 8e9b6049b09321cb8c4d488050310f34dfd4f3a7 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=8e9b6049b09321cb8c4d488050310f34dfd4f3a7 commit 8e9b6049b09321cb8c4d488050310f34dfd4f3a7 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:18 +0000 Commit: Osama Abboud 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 };