Received: by 10.213.65.68 with SMTP id h4csp261943imn; Tue, 3 Apr 2018 20:23:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx49kdzkrANii6Swo5onAv+iIQQnnunOIBgQtmIyJFX1mpC8cbk8kC+EPrVEWGVEVSnKc3iPq X-Received: by 2002:a17:902:8a94:: with SMTP id p20-v6mr16788367plo.94.1522812237036; Tue, 03 Apr 2018 20:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522812236; cv=none; d=google.com; s=arc-20160816; b=TnHbq3k7lG0znQl0r0Ddgd5WBW6dIo/0nGpYaGWkSHR32HUuclNwOjKD78q/mGfCWR wOq7bxnuxk0IdDKGCJW55RHJIW951vtpoxrY9k7hZI3ktJasEk8k6JOaYNfs96cs5UAW zxOGrNHiAeWWM74JlsLfcViYHLsTeqlpepiX2mrIt5N9XBhWRPemyYaGrdZm/Aqa3Ocl zvNHWCfx/+iRHH5EJVd3mzqF5CTJD7DFErVw02sqGTrFG8cTT9AD10guDUFl5k2449jz TuF3nofBRld7ysrv5rWFUECIwm+4awwQtkYE5XJ2gjC0HsQ8Jc51qRLy9zgow+e4z7Xx Yvkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=YHpKvu4yFNnrrcb+vVpsxU4no5IBMEtIIj0JWO7r7Tg=; b=bEeP4WX2MljHndC9yxsQ8pSJ6SknL/2yItCftN5Pd8WBFlsTxOdNUcfy3AtEuV3X2L XYVHz/vQA8NZ9zCprqpRIX7QUBnTf2igHEFEFXftyGK1+cZzypE2E8LoFCRCSfd0bSM1 EVuE/p9iy8T+mUgNE0tO9iCWskI9Fw6UT07QVbFWACyK7/ggxLl48MbFE/Z9EHaVgk/0 w9/FRoHZQ0qEp6SVHpFZF5Iwmkd0oW52x/edjh43v/ErrMVKX03QrQrbcIYdILYGZJuA wSWZucvMruUEN2UKWXQX8ur31YlP1PbUI/tlCmXqrxGSWCQWMifP8wIHd3L5fqydbP8h Hcag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vO6HA0uU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si2931535pgt.528.2018.04.03.20.23.43; Tue, 03 Apr 2018 20:23:56 -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=@gmail.com header.s=20161025 header.b=vO6HA0uU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753731AbeDDDWd (ORCPT + 99 others); Tue, 3 Apr 2018 23:22:33 -0400 Received: from mail-ua0-f176.google.com ([209.85.217.176]:41410 "EHLO mail-ua0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753519AbeDDDWb (ORCPT ); Tue, 3 Apr 2018 23:22:31 -0400 Received: by mail-ua0-f176.google.com with SMTP id g2so6506477uan.8; Tue, 03 Apr 2018 20:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YHpKvu4yFNnrrcb+vVpsxU4no5IBMEtIIj0JWO7r7Tg=; b=vO6HA0uUwSGYMZ5HDk5YRkg2XH1nhlVgU3c4YcJ6xemTgjynB1TC6PRnNRu21jHi9/ LShvFLA846911VIqcWkJVuwCzTpWOkBTyvk1603JVCgRM0FJnu8FIW1Xzi76aJj2s+iy ZTle/5ScXbWq28VDiyw69mJ9Nra8w/40XVztSgzdYU0mhA9+jfbFG1ob5/RO/7wvgg0q eEQeAQ4MRbu5UhTWK4cWUmRA8eLH7cgvHJ+g2Y2YMBTmxXdpJY2JfrVY+xi6qrQiYjPb DvYbC6dvdNCoxwkno5d4VtX7/hyi3cVw10icT0MDr+emCLvurAO7GeK4jlxxo7I1ksMp yqIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YHpKvu4yFNnrrcb+vVpsxU4no5IBMEtIIj0JWO7r7Tg=; b=SgPNu5c0VwpG4xbJZumr3L1mXTfiMU3BiU/gO0Z/Rxl+KQ506IPPe4I6HTqDhyC0+g YEH+3SFwlPmlUX3g1R+aZw+V38OD+IT0zNLjJ9wFqTHfFQMSgtv6ZncXwbSYf27NIIXM +SENCM6RoPamgUfYmt1q60aW+pa+qW+osUEC6G1kUFRD2vNQJZWSvi0fGrp9eLbJdW3i vWQPHhQuWkxk7EzQZK8RV3p03xQG3QzXziW4fy4h+AAHBR0uPbfDRNusI6aQwMWZ31Cx y5aVI1lPoxcIcFwceVUmT+IXku04pFAvIjvGY9/t26V3QMYe++0vOZdKUDrYFH+tx/SE JiAQ== X-Gm-Message-State: ALQs6tDvglqW2/Y6V5XQe1jOftLZqHUaIBaOeS9Q16SwM36k/7QCZDsh Z05UZm95Fasq7oDWosQ9V8ZI/sf6Mk3iCV81z1A= X-Received: by 10.176.85.4 with SMTP id t4mr10613865uaa.49.1522812150148; Tue, 03 Apr 2018 20:22:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.36.5 with HTTP; Tue, 3 Apr 2018 20:22:29 -0700 (PDT) In-Reply-To: <20180404010549.GA12443@lunn.ch> References: <20180404010549.GA12443@lunn.ch> From: Stuart Yoder Date: Tue, 3 Apr 2018 22:22:29 -0500 Message-ID: Subject: Re: [PATCH v3 2/4] bus: fsl-mc: add restool userspace support To: Andrew Lunn Cc: Arnd Bergmann , Ioana Ciornei , gregkh , Laurentiu Tudor , Linux Kernel Mailing List , Ruxandra Ioana Ciocoi Radulescu , Razvan Stefanescu , Roy Pledge , Networking Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 3, 2018 at 8:05 PM, Andrew Lunn wrote: >> Suppose you want to create and assign a network interface to a KVM >> virtual machine, you would do something like the following using >> a user space tool like restool: >> -create a new (empty) dprc object >> -create a new dpni and assign it to the dprc >> -create a new dpio and assign it to the dprc >> -create a new dpbp and assign it to the dprc >> -create a new dpmcp and assign it to the dprc >> -create a new dpmac and assign it to the dprc >> -connect the dpni to the dpmac > > Hi Stuart > > It this connecting to a physical port at the bottom? Yes. > If so, i would expect that when you probe the device you just create > all these for each physical port. The problem is that there is not just one set of objects to implement a network interface. For the highest throughput packet processing you need one dpio per core. So, it will depend on what the requirements are. You might want multiple dpbp (buffer pools) and set up pools of different size buffers for different packet classifications. You might want to have other objects like a crypto accelerator (dpseci) in the container as well. The dprc is a container holding any combination of those objects. So you have complete flexibility. > You then just need to map one of > them into the KVM, in the same way you map one PCI device into a KVM. > > If these are virtual devices, VF devices you would normally do > > echo 4 > /sys/class/net//device/sriov_numvfs > > on the physical device to create virtual devices. > >> The fsl-mc bus and DPAA2 is very NXP-specific, so there doesn't >> seem to be anything that can be made generic here to provide >> more common benefit. > > Which is why you should try to avoid all of this. The user knows how > to use standard linux commands and concepts. They don't want to have > to learn the inside plumbing of your hardware. I hear you. It is more complicated this way...having all these individual objects vs just a single "bundle" of them that represents a NIC. But, that's the way the DPAA2 hardware is, and we're implementing kernel support for the hardware as it is. Thanks, Stuart