Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp773662ybg; Wed, 10 Jun 2020 13:21:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw65t9ecsEPsLrsJB7O2ev0dKprr33wd9nZUTKgi++fUpdf8mECVSOLAnMX7okz/UtwKVjd X-Received: by 2002:a17:906:5210:: with SMTP id g16mr5214061ejm.197.1591820503236; Wed, 10 Jun 2020 13:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591820503; cv=none; d=google.com; s=arc-20160816; b=ky3G+vbn3sBcQQ7lvm1o0rqlcfmYY6sbnhSzjJrDJClJ771upmbENO19AlJFjJyHPn HR46VeFQ/0dohCWAiBXGvOXEXTvYLPPpdC9G8q9kEkbPNuw8fFS0HDBiEliS92ANcPh8 rKglshxg+i+qG7PRwhZzMkr8vUl5ftuIDCDlEBCaKQbeHM1a3T6YqPUwVDj7amXpz1si SmQVGGXmJFyMH6dwxFa9HL5LTo6UPsadvaxAkaSH11iEQTjoBxfMulSNxG/naV+U+044 fO/SX3QXv/9AY4dtxNAIUIiM05wiNFTrVbStY15jFHLJqWoeSjJbxFs9c7CdXTnUj1F+ Xhvw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=o1EkliDOGSB9xkuTdbcr6iLnaXcM0xDsqDQCVWf55kg=; b=Qsg0JwNObPNoPNCplfQ3D9jrNVRXcCW0RjsX7IT3Y6h2u2+DRsNQY9201vc/mI4IAL WrO2alw3Id1w7zg/xlEX+ZGMxI81qhjMQs4DhR3X+ZsE+GDlRKfMfc6Ux9nZYk1GbxvH Vv6DEbgtjs0H7io9J9ylF8RzyjY9E1Ti1IpIB8m7CXKU3sgAcABeU8b8RU08IMPComl4 UuJ9ojoGJfPERJ98PQ2Wkq2KOQost9SGp1cFxvrie/sq8qR743ofNekvC1M4DgZfb8iW lrUAkIgTbovF60wKLESst+tWKtSyXlau1DH9YKWxKQgey3mw7RBH/Q9pB12WfqK6n7GR EG1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TkJ0zWWw; 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 me26si658696ejb.444.2020.06.10.13.21.18; Wed, 10 Jun 2020 13:21:43 -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=TkJ0zWWw; 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 S1727783AbgFJS7d (ORCPT + 99 others); Wed, 10 Jun 2020 14:59:33 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:53932 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726260AbgFJS7d (ORCPT ); Wed, 10 Jun 2020 14:59:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591815571; 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: in-reply-to:in-reply-to:references:references; bh=o1EkliDOGSB9xkuTdbcr6iLnaXcM0xDsqDQCVWf55kg=; b=TkJ0zWWwYHkJuE+kuPaz7nNQICD9d3Q88SZTWraJFHXpmQYEqQA82gZ6Zd6AmRKECI785P aTSv/IcmB/myKBGmrwxgvCH39MgsDdVKh08SLBooAFOqToNJOypITEn27oXVM+P5869bSc r+ofPphnFXWucRgTN5XCZVGcaf45u4g= 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-113-XfK0uIAwOrSePaGIpgrXVA-1; Wed, 10 Jun 2020 14:59:29 -0400 X-MC-Unique: XfK0uIAwOrSePaGIpgrXVA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 02DF7107ACCA for ; Wed, 10 Jun 2020 18:59:29 +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 CF54510013D0; Wed, 10 Jun 2020 18:59:25 +0000 (UTC) From: Jarod Wilson To: linux-kernel@vger.kernel.org Cc: Jarod Wilson Subject: [PATCH net-next v2 0/4] bonding: initial support for hardware crypto offload Date: Wed, 10 Jun 2020 14:59:06 -0400 Message-Id: <20200610185910.48668-1-jarod@redhat.com> In-Reply-To: <20200608210058.37352-1-jarod@redhat.com> References: <20200608210058.37352-1-jarod@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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. 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