From mboxrd@z Thu Jan 1 00:00:00 1970 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=-1.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 5650FC43381 for ; Fri, 15 Feb 2019 15:51:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 278B6222A1 for ; Fri, 15 Feb 2019 15:51:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="Aefog8iv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388538AbfBOPvR (ORCPT ); Fri, 15 Feb 2019 10:51:17 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33213 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726146AbfBOPvR (ORCPT ); Fri, 15 Feb 2019 10:51:17 -0500 Received: by mail-pl1-f193.google.com with SMTP id y10so5157717plp.0 for ; Fri, 15 Feb 2019 07:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=P3okTO5vIFSmeDNnq8yLUyqzd9v0zH9tbIdx9Z+oFxI=; b=Aefog8iv5gUgTQswEBw4tIPc0QUPAX+Bh6RrvsAg/1AFKWkcsR4LQfeG6jDJ59m18T xq+f5w6sTtqaYFcSPvt/E548F1sLAMeGb3g8LyRPNJmKlnyBC62bgV0d5I+vUkosUZqA LD8vmiYgNFvSzk2cPOgoaamuJPS0MtICymSmz9RNxkq5gMfFRAR19UF4ghKE1AU1E0tQ ia3mPSRLJvY1OVMe0IuqM0lCIw27goyOztMRfT/IsU5m/U/uNA3bUig6OVijE3c78h+2 G9SEu49yJmZJNNKhldEJlnR/kTlt7xTo+wqqZATao67I2xvo9efUb9JYRowZzqqqIZLg MCig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=P3okTO5vIFSmeDNnq8yLUyqzd9v0zH9tbIdx9Z+oFxI=; b=mwwMr/aYtOtSq3e3U0U2AFkMhn7OUNOJ2f+1Fe+nfjTqD5sr0G0Uh7AtpnUT6Q/bxY 5X0A7ZKHzLz8x33LJgOkKvHfE1e7vhYDCTNNvjByZN4gwZtDmbmvGirqDKnx3cU7uMEu VVncWh5C60bemzMebi/FdZJ+l2Be3Fcceu+dtFCkRGAI9z6edoI0We4IHmameQ+doSI5 WKbcOrHSi1qY4QGHDAso46aNm5cFgdGQr6pCsBusnLreJtOqZ9CL31nzE5ACOHRkcde6 hEUGinMWOQNiQyLF/giZJCKf8xILNTxssX0mBNcmoG7dtKvwBHuoF9ctLx+W979cvhNp /0Kw== X-Gm-Message-State: AHQUAuZ8atYNIRKYq7+PN2Yjf5uXYYQHML4AuviKK9LLd7a38iyLwi88 q314C4FteQMk5DKnnlvYTHRRsJXQZIHIgA== X-Google-Smtp-Source: AHgI3Ib2elT+sfFtp+SHLB12Txq3wdc+Fk1RbDE/L7GlGhl9HavSFDBJxKZjv7HJVZuSKlNnrnN25g== X-Received: by 2002:a17:902:28aa:: with SMTP id f39mr10950419plb.297.1550245876522; Fri, 15 Feb 2019 07:51:16 -0800 (PST) Received: from cakuba.netronome.com ([2601:646:8e00:1b7a::2]) by smtp.gmail.com with ESMTPSA id 67sm10804805pfl.175.2019.02.15.07.51.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Feb 2019 07:51:16 -0800 (PST) Date: Fri, 15 Feb 2019 07:51:12 -0800 From: Jakub Kicinski To: Jiri Pirko Cc: Michal Kubecek , netdev@vger.kernel.org, davem@davemloft.net, oss-drivers@netronome.com, andrew@lunn.ch Subject: Re: [PATCH net-next 2/3] ethtool: add compat for flash update Message-ID: <20190215075112.121dfd5a@cakuba.netronome.com> In-Reply-To: <20190215101713.GE2343@nanopsycho> References: <20190214214046.19182-1-jakub.kicinski@netronome.com> <20190214214046.19182-3-jakub.kicinski@netronome.com> <20190215085315.GL25518@unicorn.suse.cz> <20190215101713.GE2343@nanopsycho> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 15 Feb 2019 11:17:13 +0100, Jiri Pirko wrote: > >> static int __init devlink_module_init(void) > >> { > >> return genl_register_family(&devlink_nl_family); > > > >We already have similar lookup in devlink_compat_running_version() (the > >only difference seems to be that we keep holding devlink_mutex until the > >end there) and it's likely the net_device -> devlink lookup will be > >needed in more places in the future. How about having a helper for it? That's the last one that's on my radar, info and flashing are the big per-ASIC items. If we need more hopefully we can put the compat in the shiny new ethnl user space :) > >I also wonder how does the lookup scale. But I don't have clear idea > >how long the lists can become in real life and the ethtool operations > >are not really time critical. > > Another thing is, that you don't really have to do the lookup. If you > have struct net_device *dev inside the driver, you can get the devlink > instance according to that. So it is just a matter of another ndo I > guess. Sounds like more repetitive per driver code to get to information the core already has. We can do a rhashtable if it really ever becomes an issue (which is unlikely, how many ports are you going to have on a box.. and this is not a dump - one call one lookup).