Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp830602img; Thu, 21 Mar 2019 09:48:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwn23ZfRcIjvUmJHYmR05Q6YVNnU8VoL+uEAB308c9jKgSwn/jc067U+NGlx83F49j5WlSO X-Received: by 2002:a63:83:: with SMTP id 125mr4216081pga.403.1553186919028; Thu, 21 Mar 2019 09:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553186919; cv=none; d=google.com; s=arc-20160816; b=tPBOOmRb/ovfXA+dkkTBASbgxOhMfHgueHnmpQR1u9KonLTjNf4j2SrVIf3I8m6Bwf m9e007pVMwQoM27JN9EtwwIJGCSHaOpJTB0XDuyyUql8d4ViGm63qRTVS5+/cUB10ic6 Wch6Nr4gCxEBKMEiNKWEveduRO1mNVptSlwyWPFLjLDEViHphpNjmdVHfhmdC+ljDxHl 5T0Lm0ZQf8N5O6G9P1Hop2q8BoJ9rayHvpa/wnTQ1pYbUxZSA3paY3gsIaBsOJ3PN8EY 7CiGT80Gl8CClaoGs2TUHPNuw28xy80T8IJE8ujmESvUtu59YlxLlx6FbIq/tV5UvIyp jGuA== 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=18KcygWfcLTp9Y99Rn90GzvXf19xwSbnbIbuEMq4qo4=; b=WbCsQ6lQJ0lFwz+CJYBAwYj+WGY/M9ioToZQypILzEE9HCYNbagkZhLKtJ/dBmOlE9 FQf20JrhMFh6m1pNAYoiQoE7q0taNhKBJAdu0o3PmXhBcEjjMEFsDNFEoj7y1ifxx3x0 v0hpMX/L597EhkqVrzvuSY2Sg3/WteNEBG5udRUUCwKxIIq9jO4rbKZqUX39h/3TuMmd 6nAhqCDJEND5pJ2ejCYoLU/lcB0vJMDskkMhER0AMc7kuCDmE2HB9zndGYbztaBgGjny BlbK1rkjIQr51d9oFiHS1/dwf7uVCgplskOz/umWTywVz8rcuArobIdNK7KY86NmYRPL 7H5A== 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 e22si4361615pgv.317.2019.03.21.09.48.22; Thu, 21 Mar 2019 09:48:39 -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 S1728576AbfCUQre (ORCPT + 99 others); Thu, 21 Mar 2019 12:47:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:44712 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727829AbfCUQre (ORCPT ); Thu, 21 Mar 2019 12:47:34 -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 CC536AF68; Thu, 21 Mar 2019 16:47:32 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 3E5E3E00BF; Thu, 21 Mar 2019 17:47:31 +0100 (CET) Date: Thu, 21 Mar 2019 17:47:31 +0100 From: Michal Kubecek To: Andrew Lunn Cc: David Miller , netdev@vger.kernel.org, Jakub Kicinski , Jiri Pirko , Florian Fainelli , John Linville , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v4 05/22] ethtool: introduce ethtool netlink interface Message-ID: <20190321164731.GJ29968@unicorn.suse.cz> References: <20190321135705.GB17655@lunn.ch> <20190321141343.GH29968@unicorn.suse.cz> <20190321152509.GB23408@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190321152509.GB23408@lunn.ch> 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 21, 2019 at 04:25:09PM +0100, Andrew Lunn wrote: > On Thu, Mar 21, 2019 at 03:13:43PM +0100, Michal Kubecek wrote: > > On Thu, Mar 21, 2019 at 02:57:05PM +0100, Andrew Lunn wrote: > > > On Thu, Mar 21, 2019 at 02:07:35PM +0100, Michal Kubecek wrote: > > > > +static int __init ethnl_init(void) > > > > +{ > > > > + int ret; > > > > + > > > > + ret = genl_register_family(ðtool_genl_family); > > > > + if (ret < 0) > > > > + panic("ethtool: could not register genetlink family\n"); > > > > > > Panic seems a bit strong. Do we really want to kill the box because > > > this fails? > > > > When I switched CONFIG_ETHTOOL_NETLINK from tristate to bool, I checked > > some other non-modular subsystems to see what they do on failed > > initialization and each of them did handle it by panic() so I didn't > > think about it too much and did the same. > > > > Thinking about it now, if the family registration fails, the only entry > > point to care about should be ethtool_notify() (I'll have to check more > > carefully to be sure) so that adding a check there should be sufficient > > to let everything work (except for the netlink interface, of course). > > Hi Michal > > So maybe do a WARN_ON() and return the error code. > > Linus has been quite vocal about killing the box when there is no real > need... Yes, WARN_ON() seems to be the right thing to do: it says clearly enough something went seriously wrong but doesn't make the system completely unusable. I'll do that in v5. Michal