Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp292804ybb; Thu, 28 Mar 2019 02:38:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEwiakHDpiXSjitXLWAoyPDpEMHJozNG+Wa6eUcNK4aO9P7WBwllvQOE15U+9qVhhnuzRi X-Received: by 2002:a62:4553:: with SMTP id s80mr39746203pfa.141.1553765922844; Thu, 28 Mar 2019 02:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553765922; cv=none; d=google.com; s=arc-20160816; b=ONyzCb+pAgv+x1FoRjfYJbU8u3/seDB8EvKzEwn7btLte+iyA2575gdMsdXOM6bJ2N 6KftNbGIhPxv4kpSDgUufTpZ2o8uO1PxCPIMHB4xxw98VuPHNe6bShR3zuk4ESfShVmq HzJhCcoDnQ3RJ9saeBb3jcK/yKgvpsvChHXkrEOKTy6t0JWajXV5mAFb7FKl4HTFvn6z GsyaYJFaThpexpOPoPbVnZOnDnJvBKoLYsUy6PuOmwztZOUkXiRmC15lVMcZj72NA58M fsyyK4rJL2M9a6/tJ3ohAJ9m8zCc+SoTJOLAyng/FFhQ1+L3QmHgnLmg7HBfA15XF6QB Rbnw== 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=NJPaH7hHISzT77YXwL/rUyhnTY8GDqqoN2Womf3hVF0=; b=CgQc0MTcY2yBVsJNXaArFZgOmfam5KVC5Y0bJ5Q5EIeuL0duR87R12dIOV+jD0BxSm fbSRVox8phZsIOIDmyPFSXOYGo4859Q/U9Y3lCJEqSHbF5fIarJdIdDVM/oBbUB0IpK8 Flp7/9KBK63AOIV2tvkR9mhOa0UX06ol3rLIVfN6qHGoPYtp8hsl7Y0iMs3oUUGHa6zi XKr2IChDUKsDlEtejyCuC4JzvkYN/qo57dC7zQDFNz1KIdgaEMuxTgK/F6ahYe7n4pXP waT6pgyYWNR8Hul5XQfKIyefz5PX6zZcpt5b7mzvBH1NXMcSlCYpCx8ZmsCUaol44JnC 8wRA== 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 b189si20283687pfa.65.2019.03.28.02.38.27; Thu, 28 Mar 2019 02:38:42 -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 S1726703AbfC1Jhu (ORCPT + 99 others); Thu, 28 Mar 2019 05:37:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:50106 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725815AbfC1Jhu (ORCPT ); Thu, 28 Mar 2019 05:37:50 -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 45A77AEF5; Thu, 28 Mar 2019 09:37:49 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 74954E1404; Thu, 28 Mar 2019 10:37:46 +0100 (CET) Date: Thu, 28 Mar 2019 10:37:46 +0100 From: Michal Kubecek To: Jiri Pirko Cc: Florian Fainelli , 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 05/22] ethtool: introduce ethtool netlink interface Message-ID: <20190328093746.GA26076@unicorn.suse.cz> References: <8795d07d3315b232b4e7ebc7d109c9aa3185e555.1553532199.git.mkubecek@suse.cz> <20190326120909.GF2230@nanopsycho> <20190326132427.GK26076@unicorn.suse.cz> <20190326134251.GA5181@nanopsycho.orion> <20190327092604.GP26076@unicorn.suse.cz> <20190327095023.GC6979@nanopsycho> <7e883a7c-7f1a-b1a0-4735-0ad368998c65@gmail.com> <20190328081010.GJ14297@nanopsycho> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190328081010.GJ14297@nanopsycho> 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 Thu, Mar 28, 2019 at 09:10:10AM +0100, Jiri Pirko wrote: > Thu, Mar 28, 2019 at 03:05:14AM CET, f.fainelli@gmail.com wrote: > > > > > >On 3/27/2019 2:50 AM, Jiri Pirko wrote: > >> > >> Why don't you have ETHTOOL_MSG_SET_FOO for set? I think that for > >> kerne->userspace the ETHTOOL_MSG_FOO if fine. I would change the > >> ordering of words thought, but it is cosmetics: > >> ETHTOOL_MSG_FOO /* kernel->userspace messages - replies, notifications */ > >> ETHTOOL_MSG_FOO_GET > >> ETHTOOL_MSG_FOO_SET > >> ETHTOOL_MSG_FOO_ACT > >> > >> What do you think? > > > >We could even name the notification explicitly with: ETHTOOL_MSG_NOTIF > >or ETHTOOL_MSG_NTF just so we spell out exactly what those messages are. > > Sound good. Something like: > > ETHTOOL_MSG_FOO_GET > ETHTOOL_MSG_FOO_GET_RPLY /* kernel->userspace replies to get */ > ETHTOOL_MSG_FOO_SET > ETHTOOL_MSG_FOO_ACT > ETHTOOL_MSG_FOO_NTF /* kernel->userspace async messages - notifications */ The names sound fine to me and having different message ids would still allow processing messages by the same handler easily. But there is one potential issue I would like to point out: this way we spend 4 message ids for a get/set pair rather than 2. These message ids (genlmsghdr::cmd) are u8, i.e. the resource is not as infinite as one would wish. There are 80 ioctl commands (43 "get" and 29 "set") at the moment. Netlink API should be less greedy in general. I already combined some ioctl commands into one netlink request type and with an easy way to add new attributes to existing commands, we won't need to add new commands as often (certainly not in a way which left us with 9 "get" and 9 "set" ioctl commands for netdev features). So even with 4 ids per get/set pair, we might be safe for reasonably long time. But it's still something to keep in mind. Michal