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: 1395111 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=pm.me header.i=@pm.me header.a=rsa-sha256 header.s=protonmail header.b=Jwb1FMO4; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CRpnt28mdz9sRK for ; Fri, 6 Nov 2020 03:27:14 +1100 (AEDT) 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 X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: netdev@vger.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();