From nobody Wed Nov 13 22:56:36 2024 X-Original-To: dev-commits-src-main@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 4Xpdv90WZJz5ch2N; Wed, 13 Nov 2024 22:56:37 +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 4Xpdv875Kdz4cPq; Wed, 13 Nov 2024 22:56:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731538597; 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=rgHpSffa/eCcysXrhcWCaFl16uD2AkDXISK2aJzUcIs=; b=I/uJtDdPpfJUWNIWWClpQUW/dz0crL1YvDzbN//44MaqGEauvjGbyesdiCDvPsevuxIiYl vmQz0ynl4EVX6jrF5AIMTsncTR58IecIwIhnKB+7oW77dMkBHM64mVDDTh4pqdPMmH8xpg dlDPfTiXw9Zdp1UQQcNC8nugY/ADOclW+VL+i5SvDFSR5C5xig8Q3gCOa5w/suRh4PzJlR 3idnNlaYPX5gb8MoBAW0bTn+fA95/6ktR24iv06mHh16W8hxZa4xaibQAK90/WSyM8RJIM S+aci53kk9yA3boNCW85EyKBRdEcGJYf6tWqSvgObCA4/yxV9kUunAD+cAcN/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731538597; 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=rgHpSffa/eCcysXrhcWCaFl16uD2AkDXISK2aJzUcIs=; b=kDJ/83Iha9q3wLUfhUnak3QqHR8xxmS2bjO5LNL5eW1XpEMHqE3XMDAg9R9dnNB3an91Xr 9X2NjssdN0nm73wv/8VLlyuQnfS7xzhqWAfbnHxme98oF+vqjh9yy6UOcad3wYcMB/O5bv gnBMRQRxiAft28h3U0PsjcTh0nuu5q9zf7yXWpt0/hg5+BkhDQKfUt1moMoL31mVQlhhbl zFTwcEWEhfMdnYZnAKPT8Xh+8aD445V3aNuQ3O0hhznqnV4m3YKgOTrhDBeizTbW+QT17s PzV+Nn67R7z0L0sdX84j/ZoA5ASqmk/iiSeldPOJClXUVSLw5a9MZhGaniw9mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731538597; a=rsa-sha256; cv=none; b=QK/oRBSe/BL4tGEClxsF1vyx5tAqlxvog1QFlXPSPVN8aNZvtqoGg/T2t2RJ0I8EHtAkXh mLOW/Io3ecC2L6aLjS+TUwBhkIuVRxlyodkLAWDqu02ats5X6gljdm7Y07TBiaV9ylE6AY 5m3paqAjiQK+lalYhSRcQ8g0Httmsa4eKWfwIu2vVb6VAd/KLPYQmgCWMipuNNdSJx/TBz iCVDYzk7tv01jte1+sXwEzBDXiVoxLIVtEbYYEIZwkUPzKF0wixZ42i7nwisimK4nJc92p 7oG4sMAUpnZda+HX1MS1ybAc68opRLrZgaKHEGGo4Myidw8TeRFJ5oTCGQ+G8w== 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 4Xpdv86dPrz1ChH; Wed, 13 Nov 2024 22:56:36 +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 4ADMuamF021663; Wed, 13 Nov 2024 22:56:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ADMualH021661; Wed, 13 Nov 2024 22:56:36 GMT (envelope-from git) Date: Wed, 13 Nov 2024 22:56:36 GMT Message-Id: <202411132256.4ADMualH021661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: de7a92756f0a - main - mlx5en: improve reporting of kernel TLS, IPSEC offload, and ratelimit caps List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de7a92756f0ab50e5e243ce9ac680e27f5c41370 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=de7a92756f0ab50e5e243ce9ac680e27f5c41370 commit de7a92756f0ab50e5e243ce9ac680e27f5c41370 Author: Konstantin Belousov AuthorDate: 2024-10-15 22:34:58 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-13 22:56:11 +0000 mlx5en: improve reporting of kernel TLS, IPSEC offload, and ratelimit caps Only ever set the capabilities bits if kernel options are enabled. Check for hardware capabilities before setting software bits. Sponsored by: NVidia networking MFC after: 1 week --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 5081c1a0b782..ec35d87af962 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -4535,17 +4535,29 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) if_setcapabilitiesbit(ifp, IFCAP_TSO | IFCAP_VLAN_HWTSO, 0); if_setcapabilitiesbit(ifp, IFCAP_HWSTATS | IFCAP_HWRXTSTMP, 0); if_setcapabilitiesbit(ifp, IFCAP_MEXTPG, 0); - if_setcapabilitiesbit(ifp, IFCAP_TXTLS4 | IFCAP_TXTLS6, 0); +#ifdef KERN_TLS + if (MLX5_CAP_GEN(mdev, tls_tx) != 0 && + MLX5_CAP_GEN(mdev, log_max_dek) != 0) + if_setcapabilitiesbit(ifp, IFCAP_TXTLS4 | IFCAP_TXTLS6, 0); + if (MLX5_CAP_GEN(mdev, tls_rx) != 0 && + MLX5_CAP_GEN(mdev, log_max_dek) != 0 && + MLX5_CAP_FLOWTABLE_NIC_RX(mdev, + ft_field_support.outer_ip_version) != 0) + if_setcapabilities2bit(ifp, IFCAP2_BIT(IFCAP2_RXTLS4) | + IFCAP2_BIT(IFCAP2_RXTLS6), 0); +#endif #ifdef RATELIMIT - if_setcapabilitiesbit(ifp, IFCAP_TXRTLMT | IFCAP_TXTLS_RTLMT, 0); + if (MLX5_CAP_GEN(mdev, qos) && + MLX5_CAP_QOS(mdev, packet_pacing)) + if_setcapabilitiesbit(ifp, IFCAP_TXRTLMT | IFCAP_TXTLS_RTLMT, + 0); #endif if_setcapabilitiesbit(ifp, IFCAP_VXLAN_HWCSUM | IFCAP_VXLAN_HWTSO, 0); - if_setcapabilities2bit(ifp, IFCAP2_BIT(IFCAP2_RXTLS4) | - IFCAP2_BIT(IFCAP2_RXTLS6), 0); - +#ifdef IPSEC_OFFLOAD if (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_PACKET_OFFLOAD) if_setcapabilities2bit(ifp, IFCAP2_BIT(IFCAP2_IPSEC_OFFLOAD), 0); +#endif if_setsndtagallocfn(ifp, mlx5e_snd_tag_alloc); #ifdef RATELIMIT