Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp683618ybt; Fri, 19 Jun 2020 11:01:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKctOaAKXM/Ap3Fkq+HuAfsmSfnp7yTqbSpHVCJDWj63+d/dsgi+ZbTimQH16LYJY4nIvX X-Received: by 2002:a17:907:11c2:: with SMTP id va2mr4877069ejb.98.1592589718337; Fri, 19 Jun 2020 11:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592589718; cv=none; d=google.com; s=arc-20160816; b=zMaUJ7cpq6d38iatVqYQP6Yfv170LEEOZMJnY1r/qSpMKTT9kVxeiPxL2Pi7N8Dci3 JJr2uw8hg9DIdW/gF6IJuDBw2to5chw701snRcYA3nrAs7bq0Zzmg/UQnEm2avmxmrJC 3XJBWlN99qWurCEXIDjoxlNHzv4nutk6nqqDFJUKt2NmGWZt2oy9T5Vreqc5YXqkEf6e MruB00Nq26i74t2fHc1EpWBOXqzRL5vCUmXswxEgOi5Ks50CEGjtH06ZxWDxrHFjNW+s 6vUP7Yea7kmBcP7WPZmkeAzBxp5QJwCVOa9d7DHNcv2mvKIACb1MRlfEIuJkMRXChfe2 fz5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=jY8FDmUXtOuEmRWEl+8sZh7Yhfoekmg5zQ2i70hnoeU=; b=EMARG1Wj63Zg3FiUn/tURP67FVoPgU+1vZvWqFOHMGJePgEybyygf5VBgfHk40QLl1 pPphAfZIljqN8T3jOnZh2AjPCtmubzpK6u31PtJ9BceDIJ/Lt/cl61bzdpwrZWEBozrs k49biQaG6A+F718+c/5QQSksG6/917ufvtcyBB333D4vRoo1PQFHI6wok5mfKdZqf2Ju oZfNtzPmkivr1G/mq6nubiiE3nIt+kjPGsgImjhYzweAMutdI+eL7l1lQhJHBfgwXEKS tFAcFqIeosFjmhzgTJvslgkVYk83Fn2CHSRDTqrR5vs+zVSO2OVf/5P2p7lmjsGFPS4W 66jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UJwLfl9D; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o1si4337942edr.267.2020.06.19.11.01.35; Fri, 19 Jun 2020 11:01:58 -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=@redhat.com header.s=mimecast20190719 header.b=UJwLfl9D; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733207AbgFSOcV (ORCPT + 99 others); Fri, 19 Jun 2020 10:32:21 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:55748 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726065AbgFSOcV (ORCPT ); Fri, 19 Jun 2020 10:32:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592577139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=jY8FDmUXtOuEmRWEl+8sZh7Yhfoekmg5zQ2i70hnoeU=; b=UJwLfl9DzFbpyP0bE3c4G5GQ9oHi0/xn3rPT0/cHLMsuP0bWa5tVOdnX1u34nFfvtGLf/w Ha/0Pt7oAwKPKMsOgbqgWaobVvqNjQJDtSS1krAyCB7DXyzsUktDcwFaFJP2JFlRHBjvEj HEXT25u5PixWqLxCjd5PuLVSkYXAt5Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-344-EJ_yQEmhMCmp4ZJJ1HbATQ-1; Fri, 19 Jun 2020 10:32:14 -0400 X-MC-Unique: EJ_yQEmhMCmp4ZJJ1HbATQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 826031005513; Fri, 19 Jun 2020 14:32:12 +0000 (UTC) Received: from hp-dl360pgen8-07.khw2.lab.eng.bos.redhat.com (hp-dl360pgen8-07.khw2.lab.eng.bos.redhat.com [10.16.210.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 616157C21F; Fri, 19 Jun 2020 14:32:05 +0000 (UTC) From: Jarod Wilson To: linux-kernel@vger.kernel.org Cc: Jarod Wilson , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , Jeff Kirsher , Jakub Kicinski , Steffen Klassert , Herbert Xu , netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org Subject: [PATCH net-next v3 0/4] bonding: initial support for hardware crypto offload Date: Fri, 19 Jun 2020 10:31:51 -0400 Message-Id: <20200619143155.20726-1-jarod@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an initial functional implementation for doing pass-through of hardware encryption from bonding device to capable slaves, in active-backup bond setups. This was developed and tested using ixgbe-driven Intel x520 interfaces with libreswan and a transport mode connection, primarily using netperf, with assorted connection failures forced during transmission. The failover works quite well in my testing, and overall performance is right on par with offload when running on a bare interface, no bond involved. Caveats: this is ONLY enabled for active-backup, because I'm not sure how one would manage multiple offload handles for different devices all running at the same time in the same xfrm, and it relies on some minor changes to both the xfrm code and slave device driver code to get things to behave, and I don't have immediate access to any other hardware that could function similarly, but the NIC driver changes are minimal and straight-forward enough that I've included what I think ought to be enough for mlx5 devices too. v2: reordered patches, switched (back) to using CONFIG_XFRM_OFFLOAD to wrap the code additions and wrapped overlooked additions. v3: rebase w/net-next open, add proper cc list to cover letter Jarod Wilson (4): xfrm: bail early on slave pass over skb ixgbe_ipsec: become aware of when running as a bonding slave mlx5: become aware of when running as a bonding slave bonding: support hardware encryption offload to slaves CC: Jay Vosburgh CC: Veaceslav Falico CC: Andy Gospodarek CC: "David S. Miller" CC: Jeff Kirsher CC: Jakub Kicinski CC: Steffen Klassert CC: Herbert Xu CC: netdev@vger.kernel.org CC: intel-wired-lan@lists.osuosl.org Signed-off-by: Jarod Wilson Jarod Wilson (4): xfrm: bail early on slave pass over skb ixgbe_ipsec: become aware of when running as a bonding slave mlx5: become aware of when running as a bonding slave bonding: support hardware encryption offload to slaves drivers/net/bonding/bond_main.c | 127 +++++++++++++++++- .../net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 39 ++++-- .../mellanox/mlx5/core/en_accel/ipsec.c | 6 + include/net/bonding.h | 3 + include/net/xfrm.h | 1 + net/xfrm/xfrm_device.c | 34 ++--- 6 files changed, 183 insertions(+), 27 deletions(-) -- 2.20.1