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=-5.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT 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 30F12C10F03 for ; Tue, 23 Apr 2019 19:14:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F3B23217D9 for ; Tue, 23 Apr 2019 19:14:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="rtB1ac15" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726157AbfDWTOS (ORCPT ); Tue, 23 Apr 2019 15:14:18 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:33769 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725957AbfDWTOS (ORCPT ); Tue, 23 Apr 2019 15:14:18 -0400 Received: by mail-wm1-f65.google.com with SMTP id z6so2924358wmi.0 for ; Tue, 23 Apr 2019 12:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/KxsKLxsZ5gUdbwby69VEI2uReq9Qk3uTshn0/VTmjQ=; b=rtB1ac15ynpbPzsycDChX8RBJxvzsJJEXek92Py1P7YUEPnpdxm/XX2OI+6AaDqXRb BHnknlXKeBu//Q3D1mZ0k2TU03dkLuJudAr39WOdlPlz2G9/y7KZA1mUaehmhHMxtbUG 09nKMTAgxBlfdA0nZbavJZwX3NXRiQYo2aXEmAu46KH1WJ7+7N3OaqjTyGrM8E+2bvTb THIyT9JTdSI+CW/LISx7X59thXn9asyq4salN+IFQGaOFB75aJzRvUIWOC4gvQrskhtD z5soXKyJwczUgNGSgzhssXjT9qk0+OPj2ajsDPhWyJcGaB5Mak3uVJCqKYOjuzBCPBlL dUsw== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/KxsKLxsZ5gUdbwby69VEI2uReq9Qk3uTshn0/VTmjQ=; b=YBVRCd7dEqqPX8MCKngwSEJ75d5p00mrFJ6nzdhmLoPRQlHjnVrKt/9///xyUHoyBI XMZqw1TgLFrDiHOPcws89kr9tp4pnDX6sSA2Dzvq0nT4sxsSykTQ7WP1DGpJNqGwNp5L By5yuBVN/3d/mkWP70kjXXc8DdaiLQsR+y6v9Og5w4hjIcknp8I8A8urmUGS30atU/X/ SlVaTUflYlLYIVsXagydKlEWm+bXb4RL8UtnlHIcEE90MI1THQNDZSg1DxOBZW90yP73 eWh7KQZh5G8SI494ULHZFiGy9slOmDeGok1pChgop5UK9HXlfVLjuXVGHOjbboT8mPEd A69Q== X-Gm-Message-State: APjAAAXo4DZ4fcaR7nIanwngHdMZtwJaIXyDPMHhMtfhwsOvRgXqfVXf M/itJ5mf33LwLZpV9r+oKB52jw== X-Google-Smtp-Source: APXvYqwrg0dmVD/ibzGOkpOWMuQOIzPpUSSHbS+KaGtaZdOzaGs8rrM3IaF21xnzJ243Opt78d14jQ== X-Received: by 2002:a1c:4102:: with SMTP id o2mr3299921wma.91.1556046856989; Tue, 23 Apr 2019 12:14:16 -0700 (PDT) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id t13sm4155866wru.70.2019.04.23.12.14.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Apr 2019 12:14:16 -0700 (PDT) Date: Tue, 23 Apr 2019 21:14:15 +0200 From: Jiri Pirko To: Jakub Kicinski Cc: netdev@vger.kernel.org, davem@davemloft.net, mlxsw@mellanox.com, dsahern@gmail.com Subject: Re: [patch net-next v2 15/16] netdevsim: move netdev creation/destruction to dev probe Message-ID: <20190423191415.GK2677@nanopsycho.orion> References: <20190420102922.6001-1-jiri@resnulli.us> <20190420102922.6001-16-jiri@resnulli.us> <20190422123133.161fb1a1@cakuba.netronome.com> <20190423072014.GC2677@nanopsycho.orion> <20190423100528.48908627@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190423100528.48908627@cakuba.netronome.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Tue, Apr 23, 2019 at 07:05:28PM CEST, jakub.kicinski@netronome.com wrote: >On Tue, 23 Apr 2019 09:20:14 +0200, Jiri Pirko wrote: >> Mon, Apr 22, 2019 at 09:31:33PM CEST, jakub.kicinski@netronome.com wrote: >> >On Sat, 20 Apr 2019 12:29:21 +0200, Jiri Pirko wrote: >> >> diff --git a/tools/testing/selftests/bpf/test_offload.py b/tools/testing/selftests/bpf/test_offload.py >> >> index 5f2e4f9e70e4..a0566dcf064a 100755 >> >> --- a/tools/testing/selftests/bpf/test_offload.py >> >> +++ b/tools/testing/selftests/bpf/test_offload.py >> >> @@ -1,6 +1,7 @@ >> >> #!/usr/bin/python3 >> >> >> >> # Copyright (C) 2017 Netronome Systems, Inc. >> >> +# Copyright (c) 2019 Mellanox Technologies. All rights reserved >> > >> >What's your guiding principle with adding those copyright lines >> >everywhere? >> >> Semi-random :) I can remove it if you want. > >Technically I have no opinion, personally I find it petty and >unnecessary in the git era.. Probably not worth your time now >to go and remove :) > >> >> +class NetdevSim: >> >> + """ >> >> + Class for netdevsim netdevice and its attributes. >> >> + """ >> >> + >> >> + def __init__(self, nsimdev, port_index): >> >> + self.nsimdev = nsimdev >> >> + self.port_index = port_index >> >> + self.ns = "" >> >> + self.dfs_dir = "%s/ports/%u/" % (nsimdev.dfs_dir, port_index) >> >> + self.dfs_refresh() >> >> + >> >> + ifname = "eni%unp%u" % (nsimdev.addr, port_index + 1) >> >> + timeout = 0.5 >> >> + timeout_start = time.time() >> >> + >> >> + while True: >> >> + try: >> >> + _, [self.dev] = ip("link show dev %s" % ifname) >> >> + except Exception as e: >> >> + if time.time() < timeout_start + timeout: >> >> + continue >> >> + raise e >> >> + break >> > >> >udevadm settle? The reliance on latest systemd is a real bad idea, >> >> Not sure that "udevadm settle" would help here. The diver bus probe handle >> may be executed from a workqueue, so here, there might be the udev event >> queue empty yet still the netdev is not present. > >Mm.. true. I must say I had a ton of issues with this in Netronome >test systems, those "wait for renames" loop always broke no matter >what.. OS upgrade, adding debug stuff into the kernel.. I get >flashbacks. I've seen udev easily take 20s to rename on a heavy kernel. >Since we replaced the loops with udevadm settle - it's been a bliss. >YMMV but in my experience regardless of workqueues and all udev is way >more reliable. Sure, But I don't see how udevadm settle would help here. Hmm but perhaps I can poll sysfs until the device appears there and then I can udevadm settle. > >> >could you fall back to netdevsimX names if eni$SOME$CUFT is not found? >> >> That would not help. If you have udev which does not support this, you >> are going to endup with "eth0, eth1, .." > >That is not great :( The kbuild bot runs BPF offload tests, they run >with some CentOS user space. If we don't want to name the device in >the kernel, perhaps it'd be possible to scan sysfs? The ifc names >should be under $device/net/, right? Yeah, hmm. I'll think about it and fix. Thanks!