From patchwork Wed Aug 21 21:03:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 1975103 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=pLy6kPy2; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=OB7OOJ9E; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WpzNg2mkcz1ybW for ; Thu, 22 Aug 2024 07:04:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Ip4yso+TD7zhb9kfIj8BH77Q+PL7rlK3hYwOXDBcbbI=; b=pLy6kPy2kUEoPS q+w7tV3fn+oCFW2oLmHBs7AJcyaqd6ROb4CN9tJ2z/ATeC1zyruR7eJ1ck7GjN9nIU36fEuVnjg8r JK+OKKxpSMNB7JSWnmP9BCs2ZoPoUnFO4kYeSaAbJPFegoHV+b7HAved20CCPMVMk3yyiLxoXJB60 dWjd3OP7LLTRuZQK0Qn8yPLBBjtihUv5diBNyQJSMD5WvUINKXnagCtYwd3CxXE9baxNGU7LU1bWy VZhM+I3C5cWAdRtzr/msmk162wMCrI83rTU0Vk5/d6inOdMNpfHu94YkSgqtgiOxwh5axx9CFYUZo 9opuLQXnGzyLPBWcx5rQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgsUr-0000000AMK8-11wR; Wed, 21 Aug 2024 21:04:01 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgsUn-0000000AMJH-3qAJ for hostap@lists.infradead.org; Wed, 21 Aug 2024 21:03:59 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-533496017f8so187905e87.0 for ; Wed, 21 Aug 2024 14:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724274234; x=1724879034; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GK+qJ0rHLQ5CG2ibGX400LlHMDdRVeW1QemOaWBaItg=; b=OB7OOJ9EhQcB2nikFNxpp5DL4Dgav+f9R7+jbRh1I8kp+lZ+cucHlgINKby57RTs8c AEAcDUU+c4vUQo8RUOPdgkaNvZs5F5X3xf5jAFzR9XqcIfbmfgldMFrnU7CqSBSkTeSV 7VprpoIa/K7WXvoZMNtzaFTAoJiaoIo8ToV7MyMxRS0xZnaGBtK41jKIaKcxiGCg0QfP mHsKSW+0XfvhrxybAWOf7EsZUKWfUgwShIuefRXSRGa4JbcHeSo0wZFPRAct5hoFCKqu Jabq05iWakakT04rAiKsVOQMXOExs4AWxbKENCJBsYm4NuN5aUp0qPsuve5Y/JLUW1UQ xZFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724274234; x=1724879034; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GK+qJ0rHLQ5CG2ibGX400LlHMDdRVeW1QemOaWBaItg=; b=f3K07vrv5hJ2sZyooOopfRuO+Vw3occ6qrZ8MZzqHOY32etX2poFf05nCNXniHbwi/ pqy8V39r63QsaG7gqWQdURFQCC4LztUJ1yVpVxsuxV5GnRkXmhK3BMK/kwRP7pJPtOct R9ReU2LCyMGtiC+IO2wRupOQpS6QuYQrf5s9Z0EG6iGa7vz69ditEu2J7aiQHNHFFz9C nO7gxso+cH7hBPOru7cMPO04oPY/JvZkBWrvwGBD31vJ1XRl1+Epu57FgpYFY6RQ05XU GPO2D/F4eWCqkiFEEfAOqY7TYcuFyCXJA1+i47uYSUpu20hNhujO4fFm8dutw/+s182A nNsA== X-Gm-Message-State: AOJu0YwS9P0sDz8tsceHu4RmodBm8lNN/slwFDdDjvZfiYLzEkVMe5Xi lOiNf1cfZDqJaxaC1lIzCPO+YeQfh9SOIFcuUXr4sl3dbfZWzDxke5Zl5qj9 X-Google-Smtp-Source: AGHT+IGSUv8A8StynUjAiUFFCn0q4cEk2Th7WddF+E7rWy86+JfXVlyl1YBkTHINTx8+ZiXpLLfnQw== X-Received: by 2002:a05:6512:3b22:b0:52c:caa6:13b4 with SMTP id 2adb3069b0e04-53348553362mr2246047e87.3.1724274233925; Wed, 21 Aug 2024 14:03:53 -0700 (PDT) Received: from localhost.localdomain ([5.188.167.245]) by smtp.googlemail.com with ESMTPSA id 2adb3069b0e04-5334ea89979sm6315e87.271.2024.08.21.14.03.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 14:03:52 -0700 (PDT) From: Sergey Matyukevich To: hostap@lists.infradead.org Cc: Emeel Hakim , Sergey Matyukevich Subject: [PATCH] macsec_linux: hardware offload requires Linux headers >= v5.7 Date: Thu, 22 Aug 2024 00:03:41 +0300 Message-ID: <20240821210348.1665468-1-geomatsi@gmail.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_140357_976594_991D2556 X-CRM114-Status: GOOD ( 13.54 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hardware offload in Linux macsec driver is enabled in compile time if libnl version is >= v3.6. This is not sufficient for successful build since enum 'macsec_offload' has been added to Linux header i [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [geomatsi(at)gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:132 listed in] [list.dnswl.org] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hardware offload in Linux macsec driver is enabled in compile time if libnl version is >= v3.6. This is not sufficient for successful build since enum 'macsec_offload' has been added to Linux header if_link.h in kernels v5.6 and v5.7, see commits: - https://github.com/torvalds/linux/commit/21114b7feec29e4425a3ac48a037569c016a46c8 - https://github.com/torvalds/linux/commit/76564261a7db80c5f5c624e0122a28787f266bdf New libnl with older Linux headers is a valid combination. This is how hostapd build failure has been detected by Buildroot autobuilder, see: - http://autobuild.buildroot.net/results/b59d5bc5bd17683a3a1e3577c40c802e81911f84/ Extend compile time condition for the enablement of the macsec hardware offload adding Linux headers version check. Fixes: 40c139664439 ("macsec_linux: Add support for MACsec hardware offload") Signed-off-by: Sergey Matyukevich --- src/drivers/driver_macsec_linux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_macsec_linux.c b/src/drivers/driver_macsec_linux.c index c86715498..9ad24183e 100644 --- a/src/drivers/driver_macsec_linux.c +++ b/src/drivers/driver_macsec_linux.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "utils/common.h" @@ -32,7 +33,7 @@ #define UNUSED_SCI 0xffffffffffffffff -#if LIBNL_VER_NUM >= LIBNL_VER(3, 6) +#if (LIBNL_VER_NUM >= LIBNL_VER(3, 6) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) #define LIBNL_HAS_OFFLOAD #endif