Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp804891pxb; Wed, 29 Sep 2021 10:00:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqeVlj5i358FgidpgS0qvoXcncN70d7qpBF0Y9FpxlGK0z9LMJMEs0KEkErI+/lvsdUMTZ X-Received: by 2002:a63:d806:: with SMTP id b6mr836479pgh.395.1632934859386; Wed, 29 Sep 2021 10:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632934859; cv=none; d=google.com; s=arc-20160816; b=Ld007HkJLi/bjCORDjv/1/lD8Wq86HjITxv7P1StzxKsfqlcEfS9FkH77JDwrUDs5D AEZrJo6bXwOih3Zb4e/FvRx2uNeGCLE29DmmuA3WSBCzGA5gsv2upOD2TdheHD8baVeK LInZUZkC8bFrQISBUqgqsCKnQI7+9+nDYRA4JW39Ngj7TqBJ7FA4HY3NjyJHPtvJS5ja DolplgdRBY3eCgKo/Of9rheIvu4UHpZ5hRV6FREJuyk/zVZM6D5nc8qGkcWSI5P5EboT NFjrv7VfN9JNrnAeWg5Z0HJVFFDQG6Jbflz139AiurwwVQPZbtTjCZ8MJuV2ZFAcUS2U j27Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hyMAXNAzEQWpypQD5Pa392BkUFozEEn4H5cuw+MxEVg=; b=JLMeY7OoMpfC57DmhhPzULyWwL3fk52bD7KvOcBm8LOosJ0N5FLDoOw5IhoGQGprtH r48mcZZxp9JvlYMSs27ycf12MMSjY1g+w0QnMt89LjfKVdyyUwN9ruXvlNVK7hCjIpf/ Yb8kjNMrrXxdR0YUCUOLCTMhZKCjsmips6/UpK1BA5GNpHvxDpdaPoBFeIyNQT0U7aHd ic/zLAVYvjsPTPn1Bx5UNBnt9vomXMWvA62SrPE6DbOuii00GbVMVqR1lIwfXU8/zk51 ooctxAPV4OBkleD7JkdZCUWk9tVVvQ+8GZvUt2xAfilvnN4ztWh6gCYkB/QA2ihv5fxH ufmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a8sMw03R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c3si481903pgc.199.2021.09.29.10.00.42; Wed, 29 Sep 2021 10:00:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a8sMw03R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345321AbhI2Pdh (ORCPT + 99 others); Wed, 29 Sep 2021 11:33:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:40962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345178AbhI2Pdg (ORCPT ); Wed, 29 Sep 2021 11:33:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 87BE661159; Wed, 29 Sep 2021 15:31:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632929515; bh=HXwoS1HjJA1S0yfWFpWczWoEmqeqJ8/hI4qGlsQfiLE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=a8sMw03Rp6PGGokI/cGFo4lnq8A92MECDtnNRH0qAYiC9K1Vj5DaLvJfztY1rEwx2 J3FjihL9ii52e8Zfc1LoVAXfQPLIFtkcWyusSyw6hrLPxYhHTnB49JgfL17mN5pY50 8YPYUUzVPu6Gkd6TA90y1EU7fcrWlEMBwJGhL7hOX7n7IYjBvJbjvmnzc7myNa6TOJ xOL0M+HYncEtqnaVZr7i4ot3tZbMpp7lbMxXHKZaRL6OYsWT1I2t1Q0jXuKcshj3+i EhRojJsY7u7SHu6Llx2j3/ql9Ac0a4DTztxk62AfY9CPj7ePahwroyGlhgI7Xfabug yDOSXw/s46Y1Q== Date: Wed, 29 Sep 2021 18:31:51 +0300 From: Leon Romanovsky To: Jakub Kicinski Cc: "David S . Miller" , Alexandre Belloni , Andrew Lunn , Ariel Elior , Bin Luo , Claudiu Manoil , Coiby Xu , Derek Chickles , drivers@pensando.io, Eric Dumazet , Felix Manlunas , Florian Fainelli , Geetha sowjanya , Greg Kroah-Hartman , GR-everest-linux-l2@marvell.com, GR-Linux-NIC-Dev@marvell.com, hariprasad , Ido Schimmel , intel-wired-lan@lists.osuosl.org, Ioana Ciornei , Jerin Jacob , Jesse Brandeburg , Jiri Pirko , Jonathan Lemon , Linu Cherian , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-rdma@vger.kernel.org, linux-staging@lists.linux.dev, Manish Chopra , Michael Chan , Moshe Shemesh , netdev@vger.kernel.org, oss-drivers@corigine.com, Richard Cochran , Saeed Mahameed , Salil Mehta , Satanand Burla , Shannon Nelson , Shay Drory , Simon Horman , Subbaraya Sundeep , Sunil Goutham , Taras Chornyi , Tariq Toukan , Tony Nguyen , UNGLinuxDriver@microchip.com, Vadym Kochan , Vivien Didelot , Vladimir Oltean , Yisen Zhuang Subject: Re: [PATCH net-next v1 0/5] Devlink reload and missed notifications fix Message-ID: References: <20210929064004.3172946e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210929073940.5d7ed022@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210929073940.5d7ed022@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 29, 2021 at 07:39:40AM -0700, Jakub Kicinski wrote: > On Wed, 29 Sep 2021 17:13:28 +0300 Leon Romanovsky wrote: > > On Wed, Sep 29, 2021 at 06:40:04AM -0700, Jakub Kicinski wrote: > > > On Wed, 29 Sep 2021 15:00:41 +0300 Leon Romanovsky wrote: > > > > This series starts from the fixing the bug introduced by implementing > > > > devlink delayed notifications logic, where I missed some of the > > > > notifications functions. > > > > > > > > The rest series provides a way to dynamically set devlink ops that is > > > > needed for mlx5 multiport device and starts cleanup by removing > > > > not-needed logic. > > > > > > > > In the next series, we will delete various publish API, drop general > > > > lock, annotate the code and rework logic around devlink->lock. > > > > > > > > All this is possible because driver initialization is separated from the > > > > user input now. > > > > > > Swapping ops is a nasty hack in my book. > > > > > > And all that to avoid having two op structures in one driver. > > > Or to avoid having counters which are always 0? > > > > We don't need to advertise counters for feature that is not supported. > > In multiport mlx5 devices, the reload functionality is not supported, so > > this change at least make that device to behave like all other netdev > > devices that don't support devlink reload. > > > > The ops structure is set very early to make sure that internal devlink > > routines will be able access driver back during initialization (btw very > > questionable design choice) > > Indeed, is this fixable? Or now that devlink_register() was moved to > the end of probe netdev can call ops before instance is registered? > > > and at that stage the driver doesn't know > > yet which device type it is going to drive. > > > > So the answer is: > > 1. Can't have two structures. > > I still don't understand why. To be clear - swapping full op structures > is probably acceptable if it's a pure upgrade (existing pointers match). > Poking new ops into a structure (in alphabetical order if I understand > your reply to Greg, not destructor-before-contructor) is what I deem > questionable. It is sorted simply for readability and not for any other technical reason. Regarding new ops, this is how we are setting callbacks in RDMA based on actual device support. It works like a charm. > > > 2. Same behaviour across all netdev devices. > > Unclear what this is referring to. If your device doesn't support devlink reload, it won't print any reload counters at all. It is not the case for the multiport mlx5 device. It doesn't support, but still present these counters. Thanks