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=-2.5 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham 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 ED94AC43381 for ; Fri, 1 Mar 2019 07:35:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B288A2186A for ; Fri, 1 Mar 2019 07:35:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="MmCbIFyu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732726AbfCAHfy (ORCPT ); Fri, 1 Mar 2019 02:35:54 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36458 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732081AbfCAHfy (ORCPT ); Fri, 1 Mar 2019 02:35:54 -0500 Received: by mail-wm1-f67.google.com with SMTP id j125so11246169wmj.1 for ; Thu, 28 Feb 2019 23:35:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=s2GTVTj+kpi+pUFJ3VJKVhMKzQ0lMlTJQCBSX1KT6Zs=; b=MmCbIFyunp/I/ue4scNqAf89ETIRGQvmuBiYLNht6+LNffLvgV6t5c1QDc8MYqXhFZ MDYRUQL6ys2IOSF+c85qPNtZWMvngtmS8swG9eQ/G8S4siOZwKEOp8aEyQdMOjIqkoMi cdjONVkTTsi2gI6AMxYg1nEH+bptPK1/71BuIthx75zEjSc66i9U/9hRc45FEV03VcIE lm8jjThrNTtvahSLyxbX1xp5/SuTHLF4rr7hEGC1g+ChFiez089glROn1BLjWNJvJdNt ltXW+UupoW8U4cnYUSnNOo/G2QL+Rdo7VAefAQvs8QoBPE0wSkRtl8AcWlZOl+w/nYdE Jl9w== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=s2GTVTj+kpi+pUFJ3VJKVhMKzQ0lMlTJQCBSX1KT6Zs=; b=Qyln9lr51UZ4fLm5vNnxxT5pDndCcOcxjV1FgktcohsgRcIAia7a/CUWePsAhpBwgC tT7e2/B9Kvci3Kr2PPzGkIBO3BcgTSvWvu2EuhQalweTNfNsiuxd/PP4f7AoI+Ef7Xj0 vkqoUA7ujCEhERM1V3nyCeTmnnMd+6rmW/qFLPjOYsoHYiVa043wRFdT8950Y1DlQJpg w45wi8AZ+Yj+hSuHYw8B9MA49Iwaniv8tlN2QjWNngftg6RR6VwIBAtfpN5NK7HZIU8N YWoOnuK8uu/sQbMhTrWBEC5TvgU+4oOulDl7GjYg2cVvVCwNjDU0fbmTo9Y7q9QJhs0z A7Ug== X-Gm-Message-State: AHQUAuYsNiIya7TC/hN9BgouHOMoS1gfYo7+jVLlTaTjmcpCEcdFB/Fl 9/AaP2aeiz5Fv2e2aHwjoYzYkw== X-Google-Smtp-Source: AHgI3IZYXd1JJ5RR+hyUJK0e0DKy0ifFCqo1ZTN4sig6YmrMd/8knNe/XCHhRxsqf5nej5nhjQ0hlQ== X-Received: by 2002:a1c:14e:: with SMTP id 75mr2094177wmb.48.1551425750764; Thu, 28 Feb 2019 23:35:50 -0800 (PST) Received: from localhost (ip-89-177-134-16.net.upcbroadband.cz. [89.177.134.16]) by smtp.gmail.com with ESMTPSA id f1sm879046wmh.44.2019.02.28.23.35.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 23:35:50 -0800 (PST) Date: Fri, 1 Mar 2019 08:25:57 +0100 From: Jiri Pirko To: Jakub Kicinski Cc: davem@davemloft.net, oss-drivers@netronome.com, netdev@vger.kernel.org, parav@mellanox.com, jgg@mellanox.com Subject: Re: [PATCH net-next 4/8] devlink: allow subports on devlink PCI ports Message-ID: <20190301072557.GG2314@nanopsycho> References: <20190226182436.23811-1-jakub.kicinski@netronome.com> <20190226182436.23811-5-jakub.kicinski@netronome.com> <20190227123753.GB2240@nanopsycho> <20190227103000.6ea6f7c0@cakuba.netronome.com> <20190228085624.GD2324@nanopsycho.orion> <20190228082404.5b6d1061@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190228082404.5b6d1061@cakuba.netronome.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Thu, Feb 28, 2019 at 05:24:04PM CET, jakub.kicinski@netronome.com wrote: >On Thu, 28 Feb 2019 09:56:24 +0100, Jiri Pirko wrote: >> Wed, Feb 27, 2019 at 07:30:00PM CET, jakub.kicinski@netronome.com wrote: >> >On Wed, 27 Feb 2019 13:37:53 +0100, Jiri Pirko wrote: >> >> Tue, Feb 26, 2019 at 07:24:32PM CET, jakub.kicinski@netronome.com wrote: >> >> >PCI endpoint corresponds to a PCI device, but such device >> >> >can have one more more logical device ports associated with it. >> >> >We need a way to distinguish those. Add a PCI subport in the >> >> >dumps and print the info in phys_port_name appropriately. >> >> > >> >> >This is not equivalent to port splitting, there is no split >> >> >group. It's just a way of representing multiple netdevs on >> >> >a single PCI function. >> >> > >> >> >Note that the quality of being multiport pertains only to >> >> >the PCI function itself. A PF having multiple netdevs does >> >> >not mean that its VFs will also have multiple, or that VFs >> >> >are associated with any particular port of a multiport VF. >> >> >> >> We've been discussing the problem of subport (we call it "subfunction" >> >> or "SF") for some time internally. Turned out, this is probably harder >> >> task to model. Please prove me wrong. >> >> >> >> The nature of VF makes it a logically separate entity. It has a separate >> >> PCI address, it should therefore have a separate devlink instance. >> >> You can pass it through to VM, then the same devlink instance should be >> >> created inside the VM and disappear from the host. >> > >> >Depends what a devlink instance represents :/ On one hand you may want >> >to create an instance for a VF to allow it to spawn soft ports, on the >> >other you may want to group multiple functions together. >> > >> >IOW if devlink instance is for an ASIC, there should be one per device >> >per host. So if we start connecting multiple functions (PFs and/or VFs) >> >to one host we should probably introduce the notion of devlink aliases >> >or some such (so that multiple bus addresses can target the same >> >> Hmm. Like VF address -> PF address alias? That would be confusing to see >> eswitch ports under VF devlink instance... I probably did not get you >> right. > >No eswitch ports under VF, more in case of mutli-PF. Bus addresses of >all PFs aliasing to the same devlink instance. The multi-PF aliasing makes sense to me. > >> >devlink instance). Those less pipelined NICs can forward between >> >ports, but still want a function per port (otherwise user space >> >sometimes gets confused). If we have multiple functions which are on >> >the same "switchid" they should have a single devlink instance if you >> >ask me. That instance will have all the ports of the device. >> >> Okay, that makes sense. But the question it, can the same devlink >> instance contain ports that does not have "Switchid"? > >No strong preference if switchid is different. To me devlink is an ASIC >instance, if the multiport card is constructed by copy-pasting the same >IP twice onto a die, and the ports really are completely separate, there >is no reason to require single devlink instance. Okay. > >> I think it would be beneficial to have the switchid shown for devlink >> ports too. Then it is clean that the devlink ports with the same >> switchid belong to the same switch, and other ports under the same >> devlink instance (like PF itself) is separate, but still under the same >> ASIC. > >Sure, you mean in terms of UI - user space can do a link dump or get >that from sysfs, right? I thinking about moving it to devlink. I'll work on it more today. > >> >You say disappear from the host - what do you mean. Are you referring >> >to the VF port disappearing? But on the switch the port is still >> >> No, VF itself. eswitch port will be still there on the host. >> >> >> >there, and you should show the subports on the PF side IMHO. Devlink >> >ports should allow users to understand the topology of the switch. >> >> What do you mean by "topology"? > >Mostly which ports are part of the switch and what's their "flavour". >Also (less importantly) which host netdevs are "peers" of eswitch ports. Makes sense. > >> >Is spawning VMDq sub-instances the only thing we can think of that VMs >> >may want to do? Are there any other uses? >> > >> >> SF (or subport) feels similar to that. Basically it is exactly the same >> >> thing as VF, only does reside under PF PCI function. >> >> >> >> That is why I think, for sake of consistency, it should have a separate >> >> devlink entity as well. The problem is correct sysfs modelling and >> >> devlink handle derived from that. Parav is working on a simple soft >> >> bus for this purpose called "subbus". There is a RFC floating around on >> >> Mellanox internal mailing list, looks like it is time to send it >> >> upstream. >> >> >> >> Then each PF driver which have SFs would register subbus devices >> >> according to SFs/subports and they would be properly handled by bus >> >> probe, devlink and devlink port and netdev instances created. >> >> >> >> Ccing Parav and Jason. >> > >> >You guys come from the RDMA side of the world, with which I'm less >> >familiar, and the soft bus + spawning devices seems to be a popular >> >design there. Could you describe the advantages of that model for >> >the sake of the netdev-only folks? :) >> >> I'll try to draw some ascii art :) > >Yess :) > >> >Another term that gets thrown into the mix here is mediated devices, >> >right? If you wanna pass the sub-spawn-soft-port to a VM. Or run >> >DPDK on some queues. >> > >> >To state the obvious AF_XDP and macvlan offload were are previous >> >answers to some of those use cases. What is the forwarding model >> >for those subports? Are we going to allow flower rules from VMs? >> >Is it going to be dst MAC only? Or is the hypervisor going to forward >> >as it sees appropriate (OvS + "repr"/port netdev)?