Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3323893pxf; Mon, 15 Mar 2021 07:09:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYo/ggHHKDg6RMAD8F6Wr+r/BriUr+nIsvypOh7x5YqLBeBZVUj0/nu9OuBWVwKbDsioqk X-Received: by 2002:a17:906:ae96:: with SMTP id md22mr22992070ejb.409.1615817340957; Mon, 15 Mar 2021 07:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817340; cv=none; d=google.com; s=arc-20160816; b=EEC18dcT3ke0ioHhqKVEpBCnbh63sX4vb3tEJYbXpfXblut5CIYwEoDnNIPUNmfpno P2XQCdGvZsOJTesVYBXCeBGoeLAWvTAvFtpsCQv6lLWrWCXJ16kgfasWOCXc4lWGjTUE jiHOOh0wJmWd4u33IE939EbrV+FtAP3RCetiJjO4VrE0UJqUus4QVsYP12Ql1gDm1YR0 7tXaU+rrdpr98eQ7SzD5ItHHrkx7WZ70bM1ZQZtkC4QjYXEbQUaKby88zexZeTk52qpg TIu4uFIAd9KMcBlXI2XSwH+8a2WAhp5ZR7HJC8kYDml0T+vfmPcfDm+KJyBYNrf54MnE G0kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OeoP+ACT74nLztPT1++rz54r2ebIf/PJbPkxFDsPf/w=; b=kZioBZGhqHKcsrFeLGqXzt0S9bhgj28+6b9W2IQaj5Ql3bKTxHuRgVKt5KfS4z0o2M CNoBFcYiFcDFz5Y7GJuPsLJmYNHyy8WqwjWXJfP2yCjcuknX+zB4MB3xZuzpF1ViItHI oRRHFtWpflyFYG/cBqgVOrgKdGBFHpWJLuLW1dNBHEjVLxTNecKfMOdJ8lnZovR2OQ1X nTPnreh7I+lpmCx5fDzHipuAm2wxA/cuDuXER01YXbN3GoYGSgRlGkXeUmAi+nKVP91Y vBB1GSaGX9s3ZYD79kxjill05VaL+iyGXivTTIfwzFaOq4PeCYc3c2DNKyZWFX+q2GDU PIgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AAGBxRZ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si11177372edv.308.2021.03.15.07.08.37; Mon, 15 Mar 2021 07:09:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AAGBxRZ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234995AbhCOOGx (ORCPT + 99 others); Mon, 15 Mar 2021 10:06:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:35038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232157AbhCON5w (ORCPT ); Mon, 15 Mar 2021 09:57:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C725964EF0; Mon, 15 Mar 2021 13:57:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816672; bh=zpNUKK/aPKyGPqxpwHHm0Ond1XIcDiwIFmzE1PWTR9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AAGBxRZ44E3Itw7wHJso4aUK7whqR1XFKdPzegdLiliBSM50E9hihai9RX7PZbxV/ JYQLP/L5wx+OVs/MEvfMLUg/9v7tDWlQ8025/8p7N7LMl/STg6HJv8EJi2a4tqjY0k AbMP1hB3I8rmB8/cVE2a1252N+f0JTIKX+VSIEbA= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Antony Antony , Shannon Nelson , Tony Brelinski , Tony Nguyen Subject: [PATCH 5.4 038/168] ixgbe: fail to create xfrm offload of IPsec tunnel mode SA Date: Mon, 15 Mar 2021 14:54:30 +0100 Message-Id: <20210315135551.598600129@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Antony Antony commit d785e1fec60179f534fbe8d006c890e5ad186e51 upstream. Based on talks and indirect references ixgbe IPsec offlod do not support IPsec tunnel mode offload. It can only support IPsec transport mode offload. Now explicitly fail when creating non transport mode SA with offload to avoid false performance expectations. Fixes: 63a67fe229ea ("ixgbe: add ipsec offload add and remove SA") Signed-off-by: Antony Antony Acked-by: Shannon Nelson Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 5 +++++ drivers/net/ethernet/intel/ixgbevf/ipsec.c | 5 +++++ 2 files changed, 10 insertions(+) --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c @@ -575,6 +575,11 @@ static int ixgbe_ipsec_add_sa(struct xfr return -EINVAL; } + if (xs->props.mode != XFRM_MODE_TRANSPORT) { + netdev_err(dev, "Unsupported mode for ipsec offload\n"); + return -EINVAL; + } + if (ixgbe_ipsec_check_mgmt_ip(xs)) { netdev_err(dev, "IPsec IP addr clash with mgmt filters\n"); return -EINVAL; --- a/drivers/net/ethernet/intel/ixgbevf/ipsec.c +++ b/drivers/net/ethernet/intel/ixgbevf/ipsec.c @@ -272,6 +272,11 @@ static int ixgbevf_ipsec_add_sa(struct x return -EINVAL; } + if (xs->props.mode != XFRM_MODE_TRANSPORT) { + netdev_err(dev, "Unsupported mode for ipsec offload\n"); + return -EINVAL; + } + if (xs->xso.flags & XFRM_OFFLOAD_INBOUND) { struct rx_sa rsa;