Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1001976ybt; Wed, 1 Jul 2020 15:54:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9kV4W59jiMwGYGbPM98IZi4t6ORS/f6fLVdLKH7op8LO5tqWc6UcDGpN0oZgys8+W6oyJ X-Received: by 2002:a05:6402:543:: with SMTP id i3mr12229825edx.182.1593644071974; Wed, 01 Jul 2020 15:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593644071; cv=none; d=google.com; s=arc-20160816; b=WrLkB08ZClLxxhOwuAE5ARfyAitotoG7A2nLBJXPdNSyL/RrnAtQOdXDoSDnYgxVYn 5/GWwgigZk7bj9/TzTsTBbBzPLyFah2LteeY85gaUGwhcvP39NgvBKd/LDXSY6Ce4ug7 Iahaashi9nO/nJanZfavaJadAldeQZwwvbzOIe4Px6lv8kkU3yqZjRQbrZgVgYMvDmbS KC0WCzOxdGldfBl5fyL+LGMln/cfpsWb+l39ehCHDaS3fCAIXJYWBrIqGiB1UyYR2wAg i8D0pueZ4MxBYCSnAQZsHzEsB6fvPb0UA2xcenBL2HtlgTnSlE+B57f8+vH8JZVitH7N L9wA== 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:from:subject:cc:to:message-id:date; bh=Y9LfgIrC0XbNBvSB+hDEQAKBIQKNQIPEaJ7sQ8oSUzY=; b=SR7h1/b+VzKi0NhjEhgbcXkRisU0YjPigjqGrRgryBdoP7fDCdfu5uzhxp+RnByrYR wlIQnYfYYkplzflpTB1kT5NYxtERawR9q/aWIagL9qKbLsz8YnkTYerqI74d6QBMzHL2 zjcS4ezr6SdB8zhOQFFRtdFsbOuXv7REEf3CZp+bgaOkc0w1RlXGSfk956yTwzqOupUA r3xhy0nCwkwJJCWqC8GxghZz4bW1/yvNsEUEfTkTX7WfMplW0PxUoD6HQD1KvPfxTF7g Dlb+aSSFfllL5ZAepSzaiDOUqrk6oY2ISiNOy8XoYgrGq9QBr4+EM4rWiCOLO69x3nLa ShJA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si4565838edy.595.2020.07.01.15.54.02; Wed, 01 Jul 2020 15:54:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726643AbgGAWxv (ORCPT + 99 others); Wed, 1 Jul 2020 18:53:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbgGAWxv (ORCPT ); Wed, 1 Jul 2020 18:53:51 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E12DC08C5C1; Wed, 1 Jul 2020 15:53:51 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id A501314A8D68C; Wed, 1 Jul 2020 15:53:49 -0700 (PDT) Date: Wed, 01 Jul 2020 15:53:48 -0700 (PDT) Message-Id: <20200701.155348.853858023908987046.davem@davemloft.net> To: jarod@redhat.com Cc: linux-kernel@vger.kernel.org, huyn@mellanox.com, saeedm@mellanox.com, j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net, jeffrey.t.kirsher@intel.com, kuba@kernel.org, steffen.klassert@secunet.com, herbert@gondor.apana.org.au, netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org Subject: Re: [PATCH net-next] bonding: allow xfrm offload setup post-module-load From: David Miller In-Reply-To: <20200630184941.65165-1-jarod@redhat.com> References: <20200630184941.65165-1-jarod@redhat.com> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 01 Jul 2020 15:53:50 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jarod Wilson Date: Tue, 30 Jun 2020 14:49:41 -0400 > At the moment, bonding xfrm crypto offload can only be set up if the bonding > module is loaded with active-backup mode already set. We need to be able to > make this work with bonds set to AB after the bonding driver has already > been loaded. > > So what's done here is: > > 1) move #define BOND_XFRM_FEATURES to net/bonding.h so it can be used > by both bond_main.c and bond_options.c > 2) set BOND_XFRM_FEATURES in bond_dev->hw_features universally, rather than > only when loading in AB mode > 3) wire up xfrmdev_ops universally too > 4) disable BOND_XFRM_FEATURES in bond_dev->features if not AB > 5) exit early (non-AB case) from bond_ipsec_offload_ok, to prevent a > performance hit from traversing into the underlying drivers > 5) toggle BOND_XFRM_FEATURES in bond_dev->wanted_features and call > netdev_change_features() from bond_option_mode_set() > > In my local testing, I can change bonding modes back and forth on the fly, > have hardware offload work when I'm in AB, and see no performance penalty > to non-AB software encryption, despite having xfrm bits all wired up for > all modes now. > > Fixes: 18cb261afd7b ("bonding: support hardware encryption offload to slaves") > Reported-by: Huy Nguyen > Signed-off-by: Jarod Wilson Applied, thanks.