Received: by 10.213.65.68 with SMTP id h4csp3497327imn; Tue, 3 Apr 2018 06:05:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Y19DsPzth40yDHvX7cXvpP6yJJ6oJx1EKDKHRCpqUT50hxE25rZSThn4k9+4pMWvWxcqf X-Received: by 2002:a17:902:aa04:: with SMTP id be4-v6mr14070628plb.90.1522760753438; Tue, 03 Apr 2018 06:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522760753; cv=none; d=google.com; s=arc-20160816; b=NkT839E6KRz+c34jd/ocilZ86RL1InaS5TMVnz3WsGORcsnenIfIhnJ3OgE06tzCLS pGwymBf7vwGFvmixaIWNseTdEXIychII9SDoK0ZdjYBgCduUXSJ5uo0arQdM07V1rIM1 PmMc1Bjr2IJjx6wldcdRC9avSMj+FCWkD2/ldhs5+K8d72bc+vnOwdkkUbqD2GdTCYuS Rmdt286o9/Koep/DHnjGITFJf5P2mmQw+xUlrbjPk2RVy4rD0Zx0t1vUuQ1KTbHcjNTu xtZ53nmzscYi5JvgsYg2G28XeQMVUuHDL//PWetaqtikT+fasabFC3ajbdOnfJFgRBiP ElTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=4EG7mkai4asAscMY5ZY6lFALKP0IUJAHA43hs1H7ohg=; b=pYf0iUXqxGzeyl6QPgtdRYfBmNkpu4AvlliZKJlfHDuFGb8UXeSTEYSzY4YMeorXGO UyVDn7bGN6c6XFBY2cjmr5YEFnkOQcJwp+HIAES5AiG58NTqZLcE+hLPktgmbmsf7HuZ M2yc/CyrfgugohCQetFXZCnMeGkvYvI7S3NjhN8nPF2+kryiVYMSgJ20e1OD/8MKTzhS 0Iv7bvd0nbfnifsRmDw9XU5yhrIWxY28bD2Yt5uscuEFXPJ3GYUpRP1rzLL/tK6L31gs vxPQZthhZBw2fHTlel1JU2Ogkuf+lWogiOAR8SprMOZUnIuY9Nn2WcIOgIcEm9jyMkWa Th+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=lCh50d0E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w28si2021804pgc.632.2018.04.03.06.05.37; Tue, 03 Apr 2018 06:05:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=lCh50d0E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932305AbeDCNEH (ORCPT + 99 others); Tue, 3 Apr 2018 09:04:07 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:49778 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932153AbeDCNEG (ORCPT ); Tue, 3 Apr 2018 09:04:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=4EG7mkai4asAscMY5ZY6lFALKP0IUJAHA43hs1H7ohg=; b=lCh50d0EvTuSNuVwioJoJw2xFDsXmYFdc2FLjQJBtJVZqJK9Am+jtz9mgcj86wpyhrs61fm4jB42FF/ijegSuoEZeu6GAIgCiV1hhRSgQyRWkcjENzF3m76WK8Mt5gbQPrrP7bA9/0fdwI7qBEt+Neac4FkxOdjm3ZemZ3w27Kw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1f3LbV-0008VN-OO; Tue, 03 Apr 2018 15:04:01 +0200 Date: Tue, 3 Apr 2018 15:04:01 +0200 From: Andrew Lunn To: Razvan Stefanescu Cc: Arnd Bergmann , gregkh , Laurentiu Tudor , Linux Kernel Mailing List , Stuart Yoder , Ruxandra Ioana Ciocoi Radulescu , Roy Pledge , Networking , Ioana Ciornei Subject: Re: [PATCH v3 2/4] bus: fsl-mc: add restool userspace support Message-ID: <20180403130401.GB31740@lunn.ch> References: <20180328162811.GB15827@lunn.ch> <20180402134441.GB10520@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 03, 2018 at 11:12:52AM +0000, Razvan Stefanescu wrote: > DPAA2 offers several object-based abstractions for modeling network > related devices (interfaces, L2 Ethernet switch) or accelerators > (DPSECI - crypto and DPDCEI - compression), the latter not up-streamed yet. > They are modeled using various low-level resources (e.g. queues, > classification tables, physical ports) and have multiple configuration and > interconnectivity options, managed by the Management Complex. > Resources are limited and they are only used when needed by the objects, > to accommodate more configurations and usage scenarios. > > Some of the objects have a 1-to-1 correspondence to physical resources > (e.g. DPMACs to physical ports), while others (like DPNIs and DPSW) > can be seen as a collection of the mentioned resources. The types and > number of such objects are not predetermined. > > When the board boots up, none of them exist yet. Restool allows a user to > define the system topology, by providing a way to dynamically create, destroy > and interconnect these objects. Hi Razvan The core concept with Linux networking and offload is that the hardware is there to accelerate what Linux can already do. Since Linux can already do it, i don't need any additional tools. You have new hardware. It might offer features which we currently don't have offload support for. But all the means is you need to extend the core networking code which implements the software version of that feature to offload to the hardware. The board knows how many physical ports it has. switchdev can then setup the plumbing to create the objects needed to represent the ports. Restool is not needed for that. > In the latter case, the two DPNIs will not be connected to any physical > port, but can be used as a point-to-point connection between two virtual > machines for instance. Can Linux already do this? Isn't that what PCI Virtual Functions are all about? You need to find the current Linux concept for this, and extend it to offload the functionality to hardware. If Linux can do it, it already has the tools to configure it. Restool is not needed for that. > So, it is not possible to connect a DPNI to a DPSW after it was > connected to a DPMAC. The DPNI-DPMAC pair would have to be > disconnected and DPMAC will be reconnected to the switch. DPNI > interface that is no longer connected to a DPMAC will be destroyed > and any new addition/deletion of a DPNI/DPMAC interface to the > switch port will trigger the entire switch re-configuration. Switches and ports connected to switches are dynamic. They come and go. You don't expect it to happen very often, but Linux has no restrictions on this. You need to figure out how best to offload this to your hardware. Maybe when you create the switch object you make a guess as to how many ports you need. Leave some of the ports not connected to anything. You can then add ports to the switch using the free ports. If you run out of ports, you have no choice but to destroy the switch object and create a new one. Hopefully that does not take too long. Restool is not needed for this, it all happens within the switchdev driver. Andrew