From patchwork Thu Nov 5 16:26:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 11884709 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4445FC55179 for ; Thu, 5 Nov 2020 16:27:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 814DD22227 for ; Thu, 5 Nov 2020 16:27:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="Jwb1FMO4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731561AbgKEQ1I (ORCPT ); Thu, 5 Nov 2020 11:27:08 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:42163 "EHLO mail-40134.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725998AbgKEQ1H (ORCPT ); Thu, 5 Nov 2020 11:27:07 -0500 Date: Thu, 05 Nov 2020 16:26:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1604593625; bh=wWkNAI1Z1OaM+ZJ+K4dO4VThjwMCnYu1qVLQHIn0wWs=; h=Date:To:From:Cc:Reply-To:Subject:From; b=Jwb1FMO45jI45B5GrPFDa6vMScyppgwnPJuMnMEqeMYkgjZRzsZSb5cpP9R/uOJmJ HsYcwAnoToosWY1mxiouNhegBJPsjxAeAsxN5a/T50Zg/H3a5Ozk7xiTLVgVx2n4cg fPMfu4lwX5faxcSQ14c287tyxxdERNZ/zG8C/CK898ktA+ePzamVJTVllTO401Hqxc SM75mEAEU8DwLFLw2XsNTEi8sTTsVRC72+AAl6vGoQ5kfpW3Vd2pUkelimmryWfZ1+ ba0cozxn6I9O8/UrAx6LFBl1gIh9czUeHqMg1CAM0iHe/yzsFUOPmqpp5wR6RhZKho Ddh62QLj8EsfQ== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: Michal Kubecek , Maxim Mikityanskiy , Alexander Lobakin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH net] ethtool: netlink: add missing netdev_features_change() call Message-ID: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org After updating userspace Ethtool from 5.7 to 5.9, I noticed that NETDEV_FEAT_CHANGE is no more raised when changing netdev features through Ethtool. That's because the old Ethtool ioctl interface always calls netdev_features_change() at the end of user request processing to inform the kernel that our netdevice has some features changed, but the new Netlink interface does not. Instead, it just notifies itself with ETHTOOL_MSG_FEATURES_NTF. Replace this ethtool_notify() call with netdev_features_change(), so the kernel will be aware of any features changes, just like in case with the ioctl interface. This does not omit Ethtool notifications, as Ethtool itself listens to NETDEV_FEAT_CHANGE and drops ETHTOOL_MSG_FEATURES_NTF on it (net/ethtool/netlink.c:ethnl_netdev_event()). Fixes: 0980bfcd6954 ("ethtool: set netdev features with FEATURES_SET request") Signed-off-by: Alexander Lobakin --- net/ethtool/features.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ethtool/features.c b/net/ethtool/features.c index 8ee4cdbd6b82..38f526f2125d 100644 --- a/net/ethtool/features.c +++ b/net/ethtool/features.c @@ -279,8 +279,9 @@ int ethnl_set_features(struct sk_buff *skb, struct genl_info *info) wanted_diff_mask, new_active, active_diff_mask, compact); } + if (mod) - ethtool_notify(dev, ETHTOOL_MSG_FEATURES_NTF, NULL); + netdev_features_change(dev); out_rtnl: rtnl_unlock();