Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp878942pxb; Wed, 27 Oct 2021 14:20:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMHzKGirMtib6aTWjl1lv5MDn9B0xe10bTW0ESWEZNRwqriEL3fCOwrtvQQtph2ugpqosy X-Received: by 2002:a17:906:2505:: with SMTP id i5mr54127ejb.450.1635369601896; Wed, 27 Oct 2021 14:20:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635369601; cv=none; d=google.com; s=arc-20160816; b=TXaSiZe17Glg1h5IbUoNXE2XBAKwhfdqR6sDANqm519hZucepws9UtYMnl27KgI4K0 BX7RRDSAsaLgeYbSXlBtbjpxAKjxySt7OETVaGTp2jZOusEjwgDzrkaebJ/gTySr+5ys 84tHecxupnSTYCDwGbuiozQhoR9rmb4CltttIjSy7aL2tTWS3ynWv/eLHNmQ+See5KmW d8fEdaLKSefqyf6Y/ZvNhU72ST51gIRTulRGU0DeQPDP9Fnny8jKUBHfPrpcHhAzKf7Q 2l4vpiy0p2/N12gilF+lDfZVfZtmH1tY5YQw1MCcs1pRAUyUcEyXgfHPeq9kIIpepldu v9Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VpwmGL8q732gZ5k2cD5aoLwnIVUmOGw5/VzkkTYxkIg=; b=Vx09DvthXFiJ4sMOMKMfSAF2BCI2cvGp+TQkdHwm2Ib80gAuCuGs+B1mrZ3nSPCJ7/ 9UILKwBmFQzPMWj6tJuQolO4RqM8bS2wNrGDBb5FfyICNExXDAfi083zl7YHz9+4UCjV NG8hBQ2i0qQMJdO7mW+odrJRplQpbu4uZt83FmXjkMLRb2g33dUEZvzIbkpmR/gFCrD7 u0wSUBfCVe6J6rHryLxCzNCn54I8neVjo6qpgMQf6bkqBto599/mzDUYlF1E+4WkNXd/ NpJqVsPsk52iCQFYkyqMnpXq5YHy2kIA2Uf7OC+yxw9rN9q+ezOw1OFhtRn/phrQsuuK cl5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=JMCMuYh6; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e3si1219399ejm.466.2021.10.27.14.19.38; Wed, 27 Oct 2021 14:20:01 -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=@broadcom.com header.s=google header.b=JMCMuYh6; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240986AbhJ0Its (ORCPT + 98 others); Wed, 27 Oct 2021 04:49:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232108AbhJ0Itr (ORCPT ); Wed, 27 Oct 2021 04:49:47 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC144C061570 for ; Wed, 27 Oct 2021 01:47:21 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id y80so4389880ybe.12 for ; Wed, 27 Oct 2021 01:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VpwmGL8q732gZ5k2cD5aoLwnIVUmOGw5/VzkkTYxkIg=; b=JMCMuYh6Yuaf/upleikyxO5k9kDJMxBSqPkmgFsHj8CoV2zJ043vXEQ7VGHTkX7GoH yk75qwH1hs9rZR3qEQz9oZt3a7ExG/ja2uAvuoKsAQSRzUdAlIKHiRZr+AFRg/15WqNl W5kBihpfnHI/ofIDS6KQ9a8RJSjtU+du8IToQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VpwmGL8q732gZ5k2cD5aoLwnIVUmOGw5/VzkkTYxkIg=; b=rznXzuRPDBIdbHgTHBr6v2gYu/CjRhaHulj3FBM6QrmXwQIeaY2XcL/TsTyhqtmqYE A/HybC/aGemadNj9rN/bXQybWng0DtZfYbstIpbvceUiypxmlO8BAvQIfbhjyt4F7IUU hUxDPW5dsNHs23+PAJclWyZZB52Vr8wrFoFHx7ZxPT1Ymn0dyGetSz2m/qss6OP16BDl KDsxMKJuSPajJ0w7Hh8ShXSpOXGZTW4gkTa2NwnnLw2lGtThUUqeLcX6u3+0xr9AfGjc XKP7WAxdrM0V43atdLw3lgz8lU0MQq63kmwI4QHp2dwouIFFcNRqQ4djpPQ2FL1Fu/gf Youg== X-Gm-Message-State: AOAM532Oy+tOeZqONRxSDAJ/ms7ayqgDOv6E5cDmD5tHcx95Z7QdfvEm nzYNK8lAsoqwl0ptCNe1kmPtGafE9iH6bS1eyqNioA== X-Received: by 2002:a05:6902:724:: with SMTP id l4mr20420002ybt.193.1635324440879; Wed, 27 Oct 2021 01:47:20 -0700 (PDT) MIME-Version: 1.0 References: <725e121f05362da4328dda08d5814211a0725dac.1635064599.git.leonro@nvidia.com> In-Reply-To: From: Edwin Peer Date: Wed, 27 Oct 2021 01:46:44 -0700 Message-ID: Subject: Re: [PATCH net-next] netdevsim: Register and unregister devlink traps on probe/remove device To: Leon Romanovsky Cc: Ido Schimmel , "David S . Miller" , Jakub Kicinski , Ido Schimmel , Jiri Pirko , Linux Kernel Mailing List , netdev , syzbot+93d5accfaefceedf43c1@syzkaller.appspotmail.com, Michael Chan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2021 at 11:43 PM Leon Romanovsky wrote: > In our case, the eth driver is part of mlx5_core module, so at the > device creation phase that module is already loaded and driver/core > will try to autoprobe it. > However, the last step is not always performed and controlled by the > userspace. Users can disable driver autoprobe and bind manually. This > is pretty standard practice in the SR-IOV or VFIO modes. While you say the netdev will not necessarily be bound, that still sounds like the netdev will indeed be presented to user space before devlink_register() when it is auto-probed? > This is why devlink has monitor mode where you can see devlink device > addition and removal. It is user space job to check that device is > ready. Isn't it more a question of what existing user space _does_ rather than what user space _should_ do? > > This isn't about kernel API. This is precisely about existing user > > space that expects devlink to work immediately after the netdev > > appears. > > Can you please share open source project that has such assumption? I'm no python expert, but it looks like https://github.com/openstack-charmers/mlnx-switchdev-mode/ might. We've certainly had implicit user space assumptions trip over registration order before, hence the change we made in January last year to move devlink registration earlier. Granted, upon deeper analysis, that specific case pertained to phys port name via sysfs, which technically only needs port attrs via ndo_get_devlink_port, not devlink_register(). That said, I'm certainly not confident that there are no other existing users that might expect to be able to invoke devlink in ifup scripts. > > What do you suggest instead? > > Fix your test respect devlink notifications and don't ignore them. That's not very helpful. The test case does what the user in the field did to break it. We can't assume users have always been using our APIs the way we intended. Regards, Edwin Peer