From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next 6/6] netdevsim: Add simple FIB resource controller via devlink Date: Mon, 9 Apr 2018 10:18:19 +0200 Message-ID: <20180409081819.GF19345@nanopsycho> References: <20180328012200.15175-1-dsa@cumulusnetworks.com> <20180328012200.15175-7-dsa@cumulusnetworks.com> <20180405172718.GA9125@nanopsycho> <20180406055255.GB19345@nanopsycho> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, davem@davemloft.net, roopa@cumulusnetworks.com, shm@cumulusnetworks.com, jiri@mellanox.com, idosch@mellanox.com, jakub.kicinski@netronome.com, andy.roulin@gmail.com To: David Ahern Return-path: Received: from mail-wr0-f177.google.com ([209.85.128.177]:46897 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbeDIISW (ORCPT ); Mon, 9 Apr 2018 04:18:22 -0400 Received: by mail-wr0-f177.google.com with SMTP id d1so8368195wrj.13 for ; Mon, 09 Apr 2018 01:18:21 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Fri, Apr 06, 2018 at 11:22:29PM CEST, dsa@cumulusnetworks.com wrote: >On 4/5/18 11:52 PM, Jiri Pirko wrote: >> Thu, Apr 05, 2018 at 11:06:41PM CEST, dsa@cumulusnetworks.com wrote: >>> On 4/5/18 2:10 PM, David Ahern wrote: >>>> >>>> The ASIC here is the kernel tables in a namespace. It does not make >>>> sense to have 2 devlink instances for a single namespace. >>> >>> I put this example controller in netdevsim per a suggestion from Ido. >>> The netdevsim seemed like a good idea given that modules intention -- >>> testing network facilities. Perhaps I should have done this as a >>> completely standalone module ... >>> >>> The intention is to treat the kernel's tables *per namespace* as a >>> standalone entity that can be managed very similar to ASIC resources. >> >> So you say you want to treat a namespace as an ASIC? That sounds very >> odd to me :/ > >Why? The kernel has forwarding tables, acl's, etc just like the ASIC, >and each namespace is a separate set of tables. I don't get it. What's the point? For HW, the reason is it has limited resources and those resources are not mapped 1:1 with kernel object. However, for kernel, that is meaningless. > >If you think about it, userspace "programs" the kernel just like mlxsw >and userspace SDKs "program" an asic. I don't give a **** about sdks. I have no clue why you mention that here. > > >>> Given that I can add a resource controller module >>> (drivers/net/kern_res_mgr.c?) that creates a 'struct device' per network >>> namespace with a devlink instance. In this case the device would very >>> much be tied to the namespace 1:1. >> >> That sounds more reasonable and accurate, yet still odd. You would not >> have any netdevices there? Any ports? >> > >Sure, what ever ports are assigned to or created in the namespace. > >Nothing about the devlink API says it has to be a real h/w device. Sure, it could represent something made-up, like netdevsim. However I see a big misfit when you want to represent a namespace. >Nothing about the devlink API says it can only be used for real h/w that >has ports represented by netdevices that the devlink instance some how >has "control" over. > >As the netdevsim demo shows, I can build an L3 resource controller for >the kernel tables using just the devlink API and the in-kernel notifiers.