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=-4.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 AE411C43381 for ; Fri, 22 Feb 2019 20:10:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 75A672070B for ; Fri, 22 Feb 2019 20:10:00 +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="jjGPfxH0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726545AbfBVUJ7 (ORCPT ); Fri, 22 Feb 2019 15:09:59 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:45338 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbfBVUJ7 (ORCPT ); Fri, 22 Feb 2019 15:09:59 -0500 Received: by mail-qt1-f193.google.com with SMTP id d18so3906672qtg.12 for ; Fri, 22 Feb 2019 12:09:58 -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=3C6ym7lS50oT1n7Wj0oUap54UEXechclv/8Ydph3RLk=; b=jjGPfxH0t+Xy+f39yb1qYHAiCbTqLWCqR0ChHxzwtUZb2jjPdioo3ofwcqVN5Gx4iL Ta1UL9NJXs1IXSUVXDZir0XhTuKRJE6fG5xNAhooeheRfQsAJ31rlooE2fRPMC6TCq79 P/rKK28N7JeKpquaUAVKBRdG16sm66t2zr68J+pwQ6nlDlNUKyw9zkK18W5Lj92Z8f8j 619MhGOiz4vrCJ32b3Q/289dWJjr1aJLmZdm30sLIunRb1r/N0/zcRC75YqYENjUKjWD 0cLDcUy1UHrww9uu+fuKaZWzzSpaMcsmTJ5iXe/JSNTrHs+ShpyliMBE8ohST+nD+HBX 9HPg== 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=3C6ym7lS50oT1n7Wj0oUap54UEXechclv/8Ydph3RLk=; b=rY/uu4FXhicyC2WqLZEJ6/JXgv9UdsVA4H4gXzRPfDDO21Yeh0OsjWlndzRcgcE0GC l50GVJDPLAn1wY2997cU70QrEhRTR7vj1O82tKmXwpCIVCIOcl3vvNaoVF1B5X1thkzB ISENBd4hw+HewFL3eXlC4IeD77QqYKW3vGelivjGCgP1ohxLMZM45C4LPmFkJnybh+tg HGJuLVyur1jaKY3WAreemjWOa+9Tlpw3Z1OAtdXijz+dxlEWWaHwzDkw62m3zgYZjuEh ZD64cTEH8GeGePtZp2WOnWW4vPVl6fVL4IvwalsWbbfkOGlIngLcypo0aCWXboe7Xuzv /I6w== X-Gm-Message-State: AHQUAuaxI50wINO27Tg2cNYwF4kL+JpVVqCE6DBlSlVjnmi0o1ZL2Hz8 vdD5LfBOLsqO+Re58Tyrg9i4bA== X-Google-Smtp-Source: AHgI3IaxEVSBjbp6Fn1vdLzz1c+wE6x1E4aICaTrvfywjN4cL81Xv6vZufP2PqBjxH9SwvTi5Ai+/w== X-Received: by 2002:a0c:fac3:: with SMTP id p3mr4599398qvo.190.1550866197961; Fri, 22 Feb 2019 12:09:57 -0800 (PST) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id b24sm1805462qta.76.2019.02.22.12.09.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Feb 2019 12:09:57 -0800 (PST) Date: Fri, 22 Feb 2019 12:09:51 -0800 From: Jakub Kicinski To: Florian Fainelli Cc: davem@davemloft.net, jiri@resnulli.us, mkubecek@suse.cz, andrew@lunn.ch, netdev@vger.kernel.org, oss-drivers@netronome.com Subject: Re: [PATCH net-next v2 3/5] devlink: create a special NDO for getting the devlink instance Message-ID: <20190222120951.4eb762f9@cakuba.netronome.com> In-Reply-To: <4ae4a622-f45f-36a4-2ff5-b0553a40dc22@gmail.com> References: <20190222195410.9494-1-jakub.kicinski@netronome.com> <20190222195410.9494-4-jakub.kicinski@netronome.com> <4ae4a622-f45f-36a4-2ff5-b0553a40dc22@gmail.com> 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, 22 Feb 2019 12:04:07 -0800, Florian Fainelli wrote: > On 2/22/19 11:54 AM, Jakub Kicinski wrote: > > Instead of iterating over all devlink ports add a NDO which > > will return the devlink instance from the driver. > > > > v2: add the netdev_to_devlink() helper (Michal) > > > > Suggested-by: Jiri Pirko > > Signed-off-by: Jakub Kicinski > > --- > [snip] > > > - mutex_unlock(&devlink_mutex); > > + devlink = netdev_to_devlink(dev); > > + if (!devlink || !devlink->ops->info_get) > > + return; > > AFAICT devlink_create() allows one to specify a NULL ops argument (not > that this makes sense), so probably need to add a check against > devlink->ops here as well, unless we want to change devlink_create() to > refuse a NULL ops pointer. Oh, you're right! devlink_nl_cmd_reload() seems to be missing that check as well. Let me respin quickly. > Other than that: > > Reviewed-by: Florian Fainelli Thanks!