Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3609480pxu; Tue, 8 Dec 2020 17:13:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMfKyJZrXRoh4OPTaZffsGny+ELmz1X9kFq8qfPmhPPDrsgLI5aqGVkOt6JpX+ZXVXeVYV X-Received: by 2002:a17:907:6e9:: with SMTP id yh9mr55989ejb.131.1607476403644; Tue, 08 Dec 2020 17:13:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607476403; cv=none; d=google.com; s=arc-20160816; b=LJZii5I/EO3a0mVAsCYpya+gdgXOFY/FLedf93kJkJf2f9RCYwFKRtI2rDehPj9P6/ OsEYY200Wy45oymbldeYB3+E4eQEDCrSfr7bFoY5RjvtyjG18x6RqVpdRWrT/8v15Hw/ lgoCc+wPD6wAiZRH5G83wHZIRyYbdMk8ETd0kk3OrT60/b+IaWhkMkqrGTrVA4quvtX3 XL5S0DoVIvQLkvPMH7ZbG5yxmYNyu1Rpx1c8E3Mp18Yo/C4iFi2oBywkMx60fztG70dw NPOUo5DIj6s9dsxrbb01IQTaLyw16qF3x1vGNgTvfs0302MD3K3LcOP9NbCrH3X9K4rg fixQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:dkim-signature :date; bh=JWENwWMZNya6npKA3Y8PudT/L8/61XjjqdNB1d1c8LQ=; b=iXrfo2Vux+EkL2cg+poYhDtdoGZS9ErN4VgEvJb5/Kq530XMM6IKydqZdn19rWM7Tz A3WA8lvu40b+AANpCU+mZAxZ0tbog8DxBfCnhqBmD84sCDpo6JEnepju/VYxmBkmZpMo v01XpCXqkzdnombl5qLTN0dfE1FT3Tez9iGYxi0akXDVbXlwJ/FbxhHrrKNYchDRdk0m C0XOgAss5Wrfw8Zl5voswoJsSHEqlMqKMCGeu2NaTc0Lp/6hr9ttAn60wDcTKOLiBets oKE3Ow1ovKEMXywUQWQVAbUSUy+7k7oENUa4wmEPNHB+OWO2dC6ucR1RFv3Qtkb3YbMu iUXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lXGX2pgT; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si141540edq.317.2020.12.08.17.13.01; Tue, 08 Dec 2020 17:13:23 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=lXGX2pgT; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729678AbgLHUo1 (ORCPT + 99 others); Tue, 8 Dec 2020 15:44:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:46828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728604AbgLHUo1 (ORCPT ); Tue, 8 Dec 2020 15:44:27 -0500 Date: Tue, 8 Dec 2020 11:27:30 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607455658; bh=pTp+T8fZ8pK7wJnQ8kEkNnOOcQdvT2U2tw2Hnanw8rg=; h=From:To:Cc:Subject:In-Reply-To:References:From; b=lXGX2pgTvm39+vsLHG/YR8INs23R/Eb0IYWq757yo7bVQeKuZBpgKT8hY5+em5p+7 UOqtuyIGKvJc+RDPFuuH90BrPMeDp2J5o1Nl7RN1xnNRiakrLpLuvg20rgUO9XVfER WTjMKx84R+Fu5dNINJCXK0isgLYC2BrmqKdQ5iA0n3w7xHtc+YT87mYGpcaNgQQaIE 0aVON0FFDLXTjUeVHMyBPjMMM8JU2kjZxPe3yK3kjQuGrmbMYeyChxi7IAcEUlWVXl aRdNBn4Vp6hac8wD2HAvG1UYQEJJIxUWVhAM+13egZz0nSApMEAoopomZwmpHXFmAf piRZ1KDA4DEOg== From: Jakub Kicinski To: Jarod Wilson Cc: linux-kernel@vger.kernel.org, Ivan Vecera , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , Thomas Davis , netdev@vger.kernel.org Subject: Re: [PATCH net v4] bonding: fix feature flag setting at init time Message-ID: <20201208112730.05d13f3d@kicinski-fedora-pc1c0hjn.DHCP.thefacebook.com> In-Reply-To: <20201205172229.576587-1-jarod@redhat.com> References: <20201203004357.3125-1-jarod@redhat.com> <20201205172229.576587-1-jarod@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 5 Dec 2020 12:22:29 -0500 Jarod Wilson wrote: > Don't try to adjust XFRM support flags if the bond device isn't yet > registered. Bad things can currently happen when netdev_change_features() > is called without having wanted_features fully filled in yet. This code > runs both on post-module-load mode changes, as well as at module init > time, and when run at module init time, it is before register_netdevice() > has been called and filled in wanted_features. The empty wanted_features > led to features also getting emptied out, which was definitely not the > intended behavior, so prevent that from happening. > > Originally, I'd hoped to stop adjusting wanted_features at all in the > bonding driver, as it's documented as being something only the network > core should touch, but we actually do need to do this to properly update > both the features and wanted_features fields when changing the bond type, > or we get to a situation where ethtool sees: > > esp-hw-offload: off [requested on] > > I do think we should be using netdev_update_features instead of > netdev_change_features here though, so we only send notifiers when the > features actually changed. > > Fixes: a3b658cfb664 ("bonding: allow xfrm offload setup post-module-load") > Reported-by: Ivan Vecera > Suggested-by: Ivan Vecera Applied, thanks!