From nobody Tue Nov 26 12:34:52 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 4XyMTm54Cfz5fPZ5; Tue, 26 Nov 2024 12:34:52 +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 4XyMTm2xtvz47Tl; Tue, 26 Nov 2024 12:34:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732624492; 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=qTn4laZfUpwPXiJAK35MS0gZr4kvRkzhL+CsdA3bzoc=; b=oEAL5uflRTIoy63He7rpKhmAA0tnDArLVsTu9KPdz4jr9pszEoxckGnESuMKKITshAdBOC wFCQ2zmD2VZKvZibkk2rfYygSonPZrlaUZDep4ZwBznrbNQVQ+rRS3U+uLJ3l3x2OEfKMw K+fNw/Pipowe/mLeabtNA/27qjsqJL9JyRmI1lXPBxV2fOipycdWv+zLnllkz9rChM6Pfs ysmFlh97K/WWXg4F1fZmK2M1bVgnymue6EiCC82YZXe3nPE+FMjXgnBTOQQDzAbBeI4wHN hkCh11tXw6VZumQm3dJ7DMfHSinuyg272CpPfk7+6jediqVNfVE2lwhCox+hLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732624492; 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=qTn4laZfUpwPXiJAK35MS0gZr4kvRkzhL+CsdA3bzoc=; b=g7ebA29NS8NeJcbS3x/KPyDMy/AN0kdsZWV9kKDcTNOTqvJ4wnHmmUkNJR0gLFVmXR8qQR pVqIxkQli/+Vh6z2O5p9LMlSreGCIl+Bt/Xwzc76O30FXklUxUVJYlEgRAycBwNX+D7vlS cnbX4PY9o225bA56o+IfhLqU6l/xGKe4GutjiI4QBbSDtjf+ToU+SjuQc/beldn4oOtVjy BaYh0UWypXixSsZQZAtjedqSAnPqDg6Seti2ml1xZmwQbafTMagbSAybUCvRlBp1ZlUJH3 7MNc0VidhjFiFZ5UuFHsfoSVoM8Sz0D5ExXb8Pi1XEpNfCvEJEEw2PJ+gMoZcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732624492; a=rsa-sha256; cv=none; b=oL1ORQVZETl0IWrZ0wJXRKx5IqCqMUCbjolHSi6vhycSDyEi/VO19KKshJxdOob14eZW+c J1mjhfTAGaPStZnKFs74aGwVrENinCYnL4rRPF9XUivgF2+nncn7QPEUA40wacCWbfa7wU Zg2YG5Mrt4DhA45CrEbuQI0Y/wsVG6+a5EA4wRDJf85WpPyg+BMDJCOSRycIaSmz1dYNaO agHR+fRjxkWFCL2eDXoCgRDPODkcED8+LpS76zjCetKwlMiy0GqxLmt1qz1WViAv0XzDMJ wlt/HQ22wvSSaftvMw7UmkG7hjMECfh2R30LXZfURughoCtrr92Ky+w6bBL55Q== 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 4XyMTm2YGvzPQx; Tue, 26 Nov 2024 12:34:52 +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 4AQCYqQV038973; Tue, 26 Nov 2024 12:34:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AQCYq31038970; Tue, 26 Nov 2024 12:34:52 GMT (envelope-from git) Date: Tue, 26 Nov 2024 12:34:52 GMT Message-Id: <202411261234.4AQCYq31038970@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: 4cc5d081d8c2 - main - mlx5en: only enable to toggle offload caps if they are supported 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: 4cc5d081d8c23020130c5f30ed31f79fa105de74 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4cc5d081d8c23020130c5f30ed31f79fa105de74 commit 4cc5d081d8c23020130c5f30ed31f79fa105de74 Author: Konstantin Belousov AuthorDate: 2024-11-21 06:06:01 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-26 12:34:34 +0000 mlx5en: only enable to toggle offload caps if they are supported Reviewed by: Ariel Ehrenberg Sponsored by: NVidia networking MFC after: 1 week --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index e3c075d4dd80..3e7df834d080 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -3552,6 +3552,24 @@ mlx5e_ioctl(if_t ifp, u_long command, caddr_t data) drv_ioctl_data = (struct siocsifcapnv_driver_data *)data; PRIV_LOCK(priv); siocsifcap_driver: + if (!mlx5e_is_tlstx_capable(priv->mdev)) { + drv_ioctl_data->reqcap &= ~(IFCAP_TXTLS4 | + IFCAP_TXTLS6); + } + if (!mlx5e_is_tlsrx_capable(priv->mdev)) { + drv_ioctl_data->reqcap &= ~( + IFCAP2_BIT(IFCAP2_RXTLS4) | + IFCAP2_BIT(IFCAP2_RXTLS6)); + } + if (!mlx5e_is_ipsec_capable(priv->mdev)) { + drv_ioctl_data->reqcap &= + ~IFCAP2_BIT(IFCAP2_IPSEC_OFFLOAD); + } + if (!mlx5e_is_ratelimit_capable(priv->mdev)) { + drv_ioctl_data->reqcap &= ~(IFCAP_TXTLS_RTLMT | + IFCAP_TXRTLMT); + } + mask = drv_ioctl_data->reqcap ^ if_getcapenable(ifp); if (mask & IFCAP_TXCSUM) {