Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp309419img; Wed, 27 Mar 2019 23:42:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqytgU4sF4aEG2iFOGaHxUKUtdUS6RyBHYed3fl2tGfriEe3vyg5Qu5g4O25ibQvdsUSnoXl X-Received: by 2002:a62:3244:: with SMTP id y65mr8090687pfy.255.1553755377189; Wed, 27 Mar 2019 23:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553755377; cv=none; d=google.com; s=arc-20160816; b=aFZVfyxxM9sCy5q48Oo02xCoMJ7OiiBcj6rykK50yxlAJnYZk7sIKNqrOkxsyqGOZ5 bJSa7e9aZ0G9i/fqXwHe+xTOuzUP1iH5GYF/q/K+qj+BMqEwBjigojN0jG+mfryBcf55 73uVy0YacBnGteEx4iNx/B3KvyMRxAeDBRvee7+03XUBWikR1Kfvuot94DEoKlaPQ3sm +8C6h1Gix1BHuQaW4QhrfDJvXGOhwHKz2hcv9vauWPlCFzhMAx88JCpK6WElkGyOBQpU WbBWC8sXL+Rzp1BCf+hWcPKT2pSvRzXGcm/s4bg1PwWySyLVyyggXYYEAZEKBz3HMQCm pjsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ZAoFRa3/VQz9mlg4KUAXFOZrdTGxQtfZ/krEtmP/p0o=; b=bW6Bxaz4UOOfIu7/D0KlUkC+EMHxBq3hP5NjfTr2B9nc76yUXmJev7pLzi0UDhdCP/ e7SZEZX/bDOXUdIW8QUlpZ34KVFtJ78c3L6VpTGwR9T3zEl9A8Nn6YcqX9N2yC8nnBtI xgrgO3eeVsU+8PUaUGg6IScZfJz518WPk0ogL8alJVh088p12wSibFBoWY2yhMCL2VqF RymMCf/vJ1QWaKdEodF9dSOI8uxenmouoBFgsp2h5OEVy+L9yH+iTWPvzneWmdqC2Edc tCnc4Y6QpuluAoLDN231XJGnCh3lXSE+iZjq9hxrVMSI52oe5Ivnc6/mxQFGYhrysreR lNrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si20265460pfn.122.2019.03.27.23.42.41; Wed, 27 Mar 2019 23:42:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726311AbfC1Glr (ORCPT + 99 others); Thu, 28 Mar 2019 02:41:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:39290 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725809AbfC1Glr (ORCPT ); Thu, 28 Mar 2019 02:41:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0BD5CAD63; Thu, 28 Mar 2019 06:41:46 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 22D00E1404; Thu, 28 Mar 2019 07:41:43 +0100 (CET) Date: Thu, 28 Mar 2019 07:41:43 +0100 From: Michal Kubecek To: Florian Fainelli Cc: Jiri Pirko , David Miller , netdev@vger.kernel.org, Jakub Kicinski , Andrew Lunn , John Linville , Stephen Hemminger , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v5 09/22] ethtool: implement EVENT notifications Message-ID: <20190328064143.GX26076@unicorn.suse.cz> References: <971a93b567c81103716902cd1ad00946201f9710.1553532199.git.mkubecek@suse.cz> <20190327130428.GB14297@nanopsycho> <20190327141443.GS26076@unicorn.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 27, 2019 at 07:14:43PM -0700, Florian Fainelli wrote: > > > On 3/27/2019 7:14 AM, Michal Kubecek wrote: > > On Wed, Mar 27, 2019 at 02:04:28PM +0100, Jiri Pirko wrote: > >> Mon, Mar 25, 2019 at 06:08:21PM CET, mkubecek@suse.cz wrote: > >>> Three types of netlink notifications are introduced: > >>> > >>> - ETHA_EVENT_NEWDEV to notify about newly registered network devices > >>> - ETHA_EVENT_DELDEV to notify about unregistered network devices > >>> - ETHA_EVENT_RENAMEDEV to notify about renamed network device > >>> > >>> The notifications are triggered by NETDEV_REGISTER, NETDEV_UNREGISTER and > >>> NETDEV_CHANGENAME notifiers. > >>> > >>> These notifications are intended for applications and daemons monitoring > >>> ethtool events to allow updating the list of existing devices without > >>> having to open another socket for rtnetlink. > >> > >> Wait. You duplicate events that are already going out through RTNETLINK. > >> App should open RTNETLINK in order to get those. Other apps are doing > >> that too. I don't think that duplications like this are desirable :/ > > > > Is there a way to filter or at least recognize these events when using > > rtnetlink? I couldn't find any. The only way seems to be getting every > > RTM_NEWLINK message (there can be quite a lot of those), always perform > > the lookup in my device list and recognize what happened - only to > > almost always find that nothing interesting. It is possible, sure, but > > I would really like to avoid it. > > I am afraid you are right about this, would adding a filtering > capability specifically for this in rtnetlink be a better route? Maybe we could add new IFLA_EVENT_* values and use IFLA_EVENT to mark RTM_NEWLINK messages announcing "new device" and "device rename". That way, monitoring application would still need to parse all RTM_NEWLINK messages but it would be able to recognize which announce a change in device list without a lookup in its structures. Michal