Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp863178pxb; Wed, 29 Sep 2021 11:13:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlYO7IYZRzTFfZqrtlzwwG617lpbaxD7yVEDuFTm5Pfh1NJPKKPWD9OwDa0Wt5KV94IxVV X-Received: by 2002:a17:902:b188:b029:11b:1549:da31 with SMTP id s8-20020a170902b188b029011b1549da31mr1227651plr.7.1632939206177; Wed, 29 Sep 2021 11:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632939206; cv=none; d=google.com; s=arc-20160816; b=iA67IoIgrR/eWaxJoptQTHpCbX0A6iJIBN+TIRsGpfVeUUORKZCXi4LAGSL2Ck3s6q hwv+BaLeo6wjykmEsN/6b27Y12gev2oDZsyvk26ydDeCVhyh1RofOJPRBwuoR9aPo16N Bk22bZAuQn7T6fhBISYMz7oHs8GWCXSwMnZ//+OKh7oUc7k485A4hZXH6O93f2aJsE0C KXC5Zm4DlmHjw4gXdGaFGJ0dxWEzh9lun/UG3vTdSudJ7BuD5nJUzLi+waSBfmzs20dR f5Zhgia4LywnoVBoDnIOBMqJOnc89f5qsBTk6PPsZItUgCmc5ab8MRYBB+KE8GYj2pNl FEAA== 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=qCqJ9DEKp3deU+EchwE2I55uw6ByXzZqak1W1lwEfJg=; b=wmEq+qCiS2pYh8PO5iZEkwsaVIfqphCXRMuW1BSp3v7b02qWB9KlL3amjQp+U6RH1m QZHSe+O79mY8nXFOaenUlr//wEiIwxW2Fytd/xy0S77z8Ix1hpE31KX3Nxs3HbEooMt2 889RRcbDyGd7vE8XTLQojwXsTCJLqHGzEiVKFAWbdwCSowLQqwujGt12dYsGWuDIHOwy fNqdr8F69LKEU500qr+GRDJUxaUy6MvmMzWCq2k+EN2SGesVPg+MwHCC0Mzx0JKu7aIs 1Oipe+1kCdiV8gzjSpAo7OECgVfB7WRRw9XIXZMt2B0GEtWvgrxL/8RhY6SitIoboEmM v5Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ScXxN8A8; 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 l9si627087pgq.69.2021.09.29.11.13.09; Wed, 29 Sep 2021 11:13:26 -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=ScXxN8A8; 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 S1345489AbhI2R5W (ORCPT + 99 others); Wed, 29 Sep 2021 13:57:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:48984 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343675AbhI2R5V (ORCPT ); Wed, 29 Sep 2021 13:57:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3F91561406; Wed, 29 Sep 2021 17:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632938139; bh=Wdm5mZ9EIzamcCpNJ3f6wNkVlDGhsWErQpSRyqfdzvM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ScXxN8A83d1IhIwCquDkP/qeTHZqGJC3TLJ3FOxV2L1FoyPI6FHkUTH5yPMPNyPCU qXNzAifxJbHiPiO6nCkLMX7EPPaCyVhggywKQdGI6k8u/r+CShy6MDG1j6rLZglgcu igUym4bjnU1v9ZjB1vxlcRgu37WILOCSCsdSB7qn+EfYCWZE2anMLTjBSeGeEFXWkM 3EFSdkCUq1Todb5f+rX39drvyu8P8oZbA71z5YJJrjTkSrwr8bAk+DD5P0nKyaIpe8 CZpJTpp26nY4u4AUdYCrZiXjAbecEVDKi6gIbth+hYcnzqvJaDY5F6RZD0/6MUJuBl Z889Vw81JzPKg== Date: Wed, 29 Sep 2021 10:55:37 -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: <20210929105537.758d5d85@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: 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-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Sep 2021 18:31:51 +0300 Leon Romanovsky wrote: > 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: > > > 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. There's myriad ways you can hide features. Swapping ops is heavy handed and prone to data races, I don't like it.