From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH RFC net-next 7/7] netdevsim: Add simple FIB resource controller via devlink Date: Mon, 26 Mar 2018 16:33:34 +0200 Message-ID: <20180326143334.GI1891@nanopsycho> References: <20180323065010.GM2074@nanopsycho.orion> <03eade79-1727-3a31-8e31-a0a7f51b72cf@cumulusnetworks.com> <20180323150149.GD2125@nanopsycho> <20180323150516.GE2125@nanopsycho> <20180324072621.GA1891@nanopsycho> <2eadcfb9-6dd2-d533-7ae3-c9299a70a172@cumulusnetworks.com> <20180324160238.GE1891@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, David Ahern To: David Ahern Return-path: Received: from mail-wr0-f171.google.com ([209.85.128.171]:41637 "EHLO mail-wr0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751714AbeCZOdg (ORCPT ); Mon, 26 Mar 2018 10:33:36 -0400 Received: by mail-wr0-f171.google.com with SMTP id f14so19142540wre.8 for ; Mon, 26 Mar 2018 07:33:36 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Sun, Mar 25, 2018 at 04:24:11PM CEST, dsa@cumulusnetworks.com wrote: >On 3/24/18 10:02 AM, Jiri Pirko wrote: >>>>>>>> >>>>>>>> Wait a second. What do you mean by "per-network namespace"? Devlink >>>>>>>> instance is always associated with one physical device. Like an ASIC. >>>>>>>> >>>>>>>> >>>>>>>>> has a net entry, the simplest design is to put it into the namespace of >>>>>>>>> the controller. Without it, controlling resource sizes in namespace >>>>>>>>> 'foobar' has to be done from init_net, which is just wrong. >>>>>>> >>>>>>> you need to look at how netdevsim creates a device per netdevice. >>>>>> >>>>>> That means one devlink instance for each netdevsim device, doesn't it? >>>>>> >>>>> >>>>> yes. >>>> >>>> Still not sure how to handle namespaces in devlink. Originally, I >>>> thought it would be okay to leave all devlink instances in init_ns. >>>> Because what happens if you move netdev to another namespace? Should the >>>> devlink move as well? What if you have multiple ports, each in different >>>> namespace. Can user move devlink instance to another namespace? Etc. >>>> >>> >>> The devlink instance is associated with a 'struct device' and those do >>> not change namespaces AFAIK. >> >> Yeah. But you put devlink instance into namespace according to struct >> net_device. That is mismatch. >> > >New netdevsim netdevice creates a new 'struct device' which creates a >new devlink instance. The namespace the netdev is created in is then >passed to the devlink instance. Yes, the netdev could change namespaces, >but that is something we can easily prevent if it has a devlink instance. > >But really, we are way down a tangent with respect to the intent of this >patch set. I am fine with limiting the example resource controller to I know. That is just something that I spotted :)