Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3523541pxf; Mon, 15 Mar 2021 11:27:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx97gj2Cj5CHtTN+GYhycULwvI26xyfpVhTLHfEzNImbc3Bfv8J34OgRdoN9OPxEO0Pe1k X-Received: by 2002:a17:906:35cf:: with SMTP id p15mr25060219ejb.379.1615832855128; Mon, 15 Mar 2021 11:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832855; cv=none; d=google.com; s=arc-20160816; b=F3gZZNsGdVH5bzlpg9bk45v87qAbPwwP1tvWlDPBG9uryGoWwsLUXgLbP7sAs9OKYM 6EHh0yy8A/Nliqt9fmoDIjFPlIPErbPTvxD9flDG12OIjxgp9SeGjQVRW8qa8X/W9is3 i5GyyievfaWtsIBBmImKTeWrlUC+9UUBIe+Zt+J7mdvE0CiQBAhEwIETAgGBs0RSe/3T 53GG3eOI06ICYzweQn5fuwXoh5O3Mgg/5CCDeTFRCJwcSSjcMAET9hkIpCqz4EMg/sx4 5IJl7/PKIip6gAXVtF93v1WyqZwdtTgqifybSwxX3hvucRL++JHYjnzHdJrmUAptf2Xh WgnQ== 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=h4fFMLjdqwUqYxNqdGYvDA2l0J6mNLUBiFujiripXrDcMP8LBmGpn1pOxiS0WztSzn ZWhv08fHdWj9KU2/y9+OUgiI3vv82SSwvuVCtLYWpGf195jQ98DH+x5hsL01Vlzsj4eB 8hQ8/RtbmNS7Pz0L8Y7zCWsdu5J7fnhjEh2CfOHFqx2SsGW81Pdd9CbaRz1N5OrU5qkk 5wOr3/x9xLw6XHDt9iQEWkv15a1SZ97JXjde7Fj2EZdJSNjiVHC0ZRDkWPH/3goES9uI e08LUlPlgFHvqoIlXd+CyTwKWYFz5ZM3msoEnU2lG12PAcXFZWrUIPzPbKttR95R7LPM uo3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=u6TALwkK; 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 g10si12011793edq.430.2021.03.15.11.27.06; Mon, 15 Mar 2021 11:27:35 -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=u6TALwkK; 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 S235223AbhCOO3u (ORCPT + 99 others); Mon, 15 Mar 2021 10:29:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:37820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232399AbhCON6u (ORCPT ); Mon, 15 Mar 2021 09:58:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 784D764F1A; Mon, 15 Mar 2021 13:58:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816708; bh=zpNUKK/aPKyGPqxpwHHm0Ond1XIcDiwIFmzE1PWTR9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u6TALwkKxTxTbMBVOPUQD0dsGnWKo7uJ/h3Ry4Y0pAqy102+1EO222zIQCJ9IhkHq Tz3+y2uUinCDzM4kaptEH1eW4dyj0ruLuEjXnG55E9TpM5ClDSmbANsKCqR8sV66tM QqVFYMETzyf+HynAvQlqjwPQGhUR7U8YGelRxOhk= 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.11 077/306] ixgbe: fail to create xfrm offload of IPsec tunnel mode SA Date: Mon, 15 Mar 2021 14:52:20 +0100 Message-Id: <20210315135510.244205815@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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;