Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp687976pxb; Wed, 29 Sep 2021 07:42:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOLJC766qj73iT2btsavqqrQjEFhfvuxgdPjw70d4wDrs4aLqtTh1vcbJKnhbYwUjiquV+ X-Received: by 2002:a50:bf07:: with SMTP id f7mr321172edk.288.1632926570210; Wed, 29 Sep 2021 07:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632926570; cv=none; d=google.com; s=arc-20160816; b=eV3HDvB53tKH4FULeOsqj1TH8GJV9jLBaAXa9RI3nFEvzMk7XaLarU25BEaVyH3put GHdcZKIngZ8M0oaAHhqS8I3l1izjO/3lfl1w0uxg8iH1vtC7R2zo3tw5bmEoyHY+A8vN Eu0wQzeYIUZFmpqPWc0mlOSDlcJCUhJBFJc21ChD1mActpV35aakgkkVSdKgIo3a3Rgl f6gyB/p3pBgI5WDe15ERAua/1MjMa9vO5GBHODaX6X6V2i2KeuZmv0MGX8aosatYUkkD RAyTi1K6gNEHWGJuyb0F8Y2uBwu12YcjtwhLXfcJa5/cZvKd43KVZH//4J6OcPn4hSp5 9QIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=eR2PMCCOFDM4j0WzLh8Rn+TUYkcrDVeFlnfVuG+xBZs=; b=0iCJUaMc0wtwJM0SU6YOZmMOeYyGoOMrSPxKLtymsfcK2BKFJkA+yS78WOByY1YWp/ HZ0dVuKdgLBMpeDFrMdSsssxBov/lMkQEqMSVnqJbwlPuXCPsGE7yLdfgrpdrMSWuhw1 7JC2OOCneQ/8xuM/wle/qBWnVQpeJcKQS2IlI2syF1Uly3onxApWbEbOe++UGC4bUH+o J1hteNjPs4fSVos83s/bFHJMN8boYCenFbfpPoySJpDwx6Z4Gr/DJArZqgV7B5uPhjU+ TzXSHd/uK8zRJdiyIDb+IE4cLcCKo84MRHFNcwlD2SXlW+cEZ2FPZYvp9I2BX/kzT+mk zWaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eqiziXnf; 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 eg50si106819edb.93.2021.09.29.07.42.26; Wed, 29 Sep 2021 07:42:50 -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=eqiziXnf; 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 S1344315AbhI2OlZ (ORCPT + 99 others); Wed, 29 Sep 2021 10:41:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:34124 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244630AbhI2OlY (ORCPT ); Wed, 29 Sep 2021 10:41:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D7FC061288; Wed, 29 Sep 2021 14:39:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632926383; bh=nnq87NutyIOGGif5N+QrkzjWO+6VWs0z6DZ46avoARs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eqiziXnfY6Gb8Aqa7QR6beBqHy27XIjRrNUvvAZpBe8wAWCnLdAtcFyomIe7AQOpr 4y5Asa4+B80UxnB1HHcJhWNrtHtO1xZ3wY/gSf+jYnf98cFaKFzj08VOrxUhrIW7Xl WhtES6XqwCW5MPr95wOLYo64luS6u1zSPfI8WRAF7ohJTYNANFQJlfrV9MLvFa+BQB qRGrx+33hqKztnR5yfNuHpe7tcbvP77g91NjW7WEy/hhDjv2PbU7F3vMSN5g+9a7XX 6BT/cH+dKXao9KYoRKv24DJNK8fNaz/UswWiMxA+XjskLExRXFjir7NSfinIiFeJQq T9KesJYV0X2ng== Date: Wed, 29 Sep 2021 07:39:40 -0700 From: Jakub Kicinski To: Leon Romanovsky 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: <20210929073940.5d7ed022@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20210929064004.3172946e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 2. Same behaviour across all netdev devices. Unclear what this is referring to.