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=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no 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 B43A0C31E40 for ; Tue, 6 Aug 2019 22:32:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85189216F4 for ; Tue, 6 Aug 2019 22:32:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="yMgJAm3B" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727278AbfHFWcm (ORCPT ); Tue, 6 Aug 2019 18:32:42 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:45924 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726069AbfHFWcm (ORCPT ); Tue, 6 Aug 2019 18:32:42 -0400 Received: by mail-qk1-f195.google.com with SMTP id s22so64346708qkj.12 for ; Tue, 06 Aug 2019 15:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=EGaZ8RP80FY9CmE0fn2kYCqnI1vjVxqIduIlg4yYPMA=; b=yMgJAm3Boa6/US3MTiXxCrBYRnxwlP1x2Dqt0vvSZdyUDvMoEHAd4GlIjzD4L/khnI KJwgPG9t4ZEG58uc89j+ZXACAau0F7aCpnUjcN8nm+xYwzyPPo7yYplrwr+bqRnp71ge GsIUaSsJSb/PxFAs4sxOp59KEVnoS5aB+wMuUygTkCYEx9fBSsQBdh+Ce5B0bGmho4MO SRIJy0HXsImP7++kozBuY8zQY3c27qkoRhxvBmasmW2dSQKcHjWNQzDxT5OwCmus+jfW WeHVDvX5VIQ350Xox+1xbUyL2t2eP0IN3+9Yulqod6U4dBTn9D4C8oHZcnQxd+ZZSbHq vL8A== 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:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=EGaZ8RP80FY9CmE0fn2kYCqnI1vjVxqIduIlg4yYPMA=; b=PBeP9/q+87DlDcV3YRv1QqcnZteqTo2QddcKFU2u7iAqFqHw4xsW8rFI2nE5JzB8+D OOthkLnn20+lYhaHhwLJpsGiUMYydaF0g7iT+oRwJJIJNzZPU0O+CcWjD9xtKwJy5P5P 5OM1U6rc1bTvXvWqPv4H6IU6NUddaI5erVTkZGWNSI5GbCYKbYBcr8yHzXaXT7h1XUZQ MeK/coeMr39m8hV+4SEkAKVyqkBbeUMlE15StfMiDk6e4L6JF7xoCbPYJVG2UQazrXBq uquUyFVF52P9a9xnW3qQZt2KJ9WelsxnGZnzZdxOYfqjXjxpS0y0AuYqnsaY9EpGmjrA /PuA== X-Gm-Message-State: APjAAAU3u4YEDZBuGFGRv3IRcXBAOYDuiqkMWEOLk4RG7ENhmWDBTgGz w0i84myfkeA1XLQGkheM03T+GA== X-Google-Smtp-Source: APXvYqxzWHWcSkVl7jJj/3cx270+lBA6XQMF18Q9hEC1STdP+dwcn0ftnU/H3LlhWPt5fBR8sKEpyw== X-Received: by 2002:a37:8b86:: with SMTP id n128mr5392653qkd.446.1565130760915; Tue, 06 Aug 2019 15:32:40 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id y6sm35551963qki.67.2019.08.06.15.32.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 06 Aug 2019 15:32:40 -0700 (PDT) Date: Tue, 6 Aug 2019 15:32:14 -0700 From: Jakub Kicinski To: David Ahern Cc: davem@davemloft.net, netdev@vger.kernel.org, jiri@resnulli.us, David Ahern Subject: Re: [PATCH net] netdevsim: Restore per-network namespace accounting for fib entries Message-ID: <20190806153214.25203a68@cakuba.netronome.com> In-Reply-To: <20190806191517.8713-1-dsahern@kernel.org> References: <20190806191517.8713-1-dsahern@kernel.org> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 6 Aug 2019 12:15:17 -0700, David Ahern wrote: > From: David Ahern > > Prior to the commit in the fixes tag, the resource controller in netdevsim > tracked fib entries and rules per network namespace. Restore that behavior. > > Fixes: 5fc494225c1e ("netdevsim: create devlink instance per netdevsim instance") > Signed-off-by: David Ahern Thanks. Let's see what Jiri says, but to me this patch seems to indeed restore the original per-namespace accounting when the more natural way forward may perhaps be to make nsim only count the fib entries where fib_info->net == devlink_net(devlink) > -void nsim_fib_destroy(struct nsim_fib_data *data) > +int nsim_fib_init(void) > { > - unregister_fib_notifier(&data->fib_nb); > - kfree(data); > + int err; > + > + err = register_pernet_subsys(&nsim_fib_net_ops); > + if (err < 0) { > + pr_err("Failed to register pernet subsystem\n"); > + goto err_out; > + } > + > + err = register_fib_notifier(&nsim_fib_nb, nsim_fib_dump_inconsistent); > + if (err < 0) { > + pr_err("Failed to register fib notifier\n"); unregister_pernet_subsys(&nsim_fib_net_ops); ? > + goto err_out; > + } > + > +err_out: > + return err; > }