Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3512039pxf; Mon, 15 Mar 2021 11:10:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjjeIhKZvAjtoHkp3qEssEB9XHZYN/zp6wRsdfzaRld50WuMt563N62hCYf7pjcgISkaC7 X-Received: by 2002:a17:906:3f88:: with SMTP id b8mr14720680ejj.36.1615831828217; Mon, 15 Mar 2021 11:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615831828; cv=none; d=google.com; s=arc-20160816; b=Aw++0GrkbX074I+ALjW0DB8NdQ2zEvGoXiaTuDpH4p6IGHwcsRpcwmz9bDPCttx+4m VyT3EAb2uVNoRw2ybl2c637UzzAvXGpDAxTMQmqlifqHbzrVvlKTOWpRAugjXyXC9FuK ke8a9FVZdlqVsjDv5fq/XoCcJCkXq6ZBFbvRwX73LCfAa9RzXNhOEBl1NaphiyhWr0vn A17MEd/CLYI5ZHSqoy2lPkTMWB/Y8eUrbPk8FIQCX+Rfp0pkgIRKhYnxw++g670tg+QF HjKZIi08XSXyQnH8LAjc0dnMQq13MqgLn7jWQD/Pn9MvtpeYeOylY5hnAdFKGABn8ya0 3OMA== 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=eez/5dqbnqPq6L21bXyi45qFPKeYwHgMAS36llllfkljC3FOiQUadOXdPRBPGSOBSm U3Tsd/hXBTA39dK+/hnA0Z0Z1HE6N5ffnpCb3FQQjdu80eq07bv6Pe3szDXc4xo2HjWC nHjr+SFLRJUoTqQ3yNNW9Yrwh5abc/W3KEwwg/GlzETQhwrI3lkVQUDeiN1tx6oMvZ4D Eum960F7WQ6hlNeS9gQcFDLwTJDb6O2TEMuh5GO8QPS2HNG8uRx29bpmVBRZaMM3CNPf GnSA+u9vvQV1Cc56K/PziXzy/VNs2qsVK9OHOkCPOXsCyXoFo+dMtNvbp5rR/HS5sBr2 OHaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iEJVfHxT; 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 hp15si11634332ejc.548.2021.03.15.11.10.01; Mon, 15 Mar 2021 11:10:28 -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=iEJVfHxT; 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 S235731AbhCOOKf (ORCPT + 99 others); Mon, 15 Mar 2021 10:10:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:34900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232296AbhCON6W (ORCPT ); Mon, 15 Mar 2021 09:58:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 211E664F2F; Mon, 15 Mar 2021 13:58:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816699; bh=zpNUKK/aPKyGPqxpwHHm0Ond1XIcDiwIFmzE1PWTR9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iEJVfHxTAM/6CUjOP2A8Hmw1U4tSS6zWD/utZNl8EaAp7Jy/Zxu7f6Z8EjbArnqwD oAyCoESIKlkPzJtVB8Az2je9wXL/wgfZleDvLzkQ5YOXIr6vrJhjrTzqO9eQ4Hq3uz AIKVO/WYbXoW4BWZ0aFGqQceFu44xupb6OB9pdwk= 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.10 063/290] ixgbe: fail to create xfrm offload of IPsec tunnel mode SA Date: Mon, 15 Mar 2021 14:52:36 +0100 Message-Id: <20210315135544.048787405@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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;