Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp167853imm; Thu, 30 Aug 2018 10:57:04 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZFxOKkM1R8M2yfUH7JqS042bUX0plFk0Ypi3RCmVuuM/dhFlT/7Zht0j3h6c7v4cDubYpg X-Received: by 2002:a63:1516:: with SMTP id v22-v6mr10540147pgl.150.1535651824236; Thu, 30 Aug 2018 10:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535651824; cv=none; d=google.com; s=arc-20160816; b=NJBa0Nm4kjgLY7lBJ3oII3rf08HniJkiCeS8MEakuB2Jgztx0qSl2UL4Pu+JXxc82z 4hXfmvGtbEoXfzRPvJ5wYBYs9KLW4OCgqpcpt6Meoxt088nFO7BV+Ztkxe17368S5UpO 9zAZjQy/qP9styETT0QqOqNOsKsdsrFVEzK07lmD4Fyt3lhFjOrIYQVT4Q3xeCYlv+57 T0G9wYIKTYjTXkTU0h74gOPjayM+L01iXvD6YR3IYcduD0S/+qjaGt7dZmwdmDnk/XnF 4u2reP1wjDZ6oLZlGsOkrf8orVthyvi91o+mME8uOcW13Ey7fvjA2RalwSjeraWbUZYa 9cvQ== 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 :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=cwjXYU8YmUTvMNgco6t8puRj5FYzVGryWaQQJbRGf7E=; b=KSjdBNNOMfxSv9Uetc9jd6M3ekXHjyExiSC5qruv/LgRLUk/vsJeewk0JzpgwLhkce AX+LK0BQ9eEslO4bNsU6pWtZfLhZ0i523Kfu1jLWQrmTAckH8mNVP60/KilN4BKd25/y o0XdUcSSBqV9lwM/Nann/yyyGn3Atwg4xlwJUu/Zj7PGulkszwrBpaD7tsU92XggFmlK uGLkNmxt0orpC3j9SPqcSqD0R2EjgS9JhQgp09lINzU3ntDBeglFm5XHOmVr+2MBtLiG V5yJfeyym6WylXPbnJ5QnDpxhio30dBqJFeH4O6p/MVY8BdUrgNfbjEU6cyZqyiHUqOw f+xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mH+JVfLI; 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 93-v6si7176051plf.113.2018.08.30.10.56.49; Thu, 30 Aug 2018 10:57:04 -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=mH+JVfLI; 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 S1727408AbeH3V7F (ORCPT + 99 others); Thu, 30 Aug 2018 17:59:05 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38347 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726235AbeH3V7E (ORCPT ); Thu, 30 Aug 2018 17:59:04 -0400 Received: by mail-wr1-f67.google.com with SMTP id w11-v6so8855517wrc.5; Thu, 30 Aug 2018 10:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cwjXYU8YmUTvMNgco6t8puRj5FYzVGryWaQQJbRGf7E=; b=mH+JVfLIvo+7FctFTuK9oxLanUmC4jhbK/twkN5Q0ToHUD1Z77/3hPTULmUCOw1is3 UOqikgaUeSTMsIvWvxR9nw1cXyLqfhIjsLGRZ5OQt/EvHlBKojmwttgTLYJZ1zeOVedh njShBfi0HpJsYRU1oUiTMrqWEwydLzk6OGUnXY+C5QjF28yeXk8KS5ow7kJlTOQjmM8r wwfzuj2fpFRk0Ga6d4anKQyKJNecpRWa272O5H1wv0PFk3cbVFTUf+j1AYwlRM5dLFWT vWmSXQZQGSXYkSwOnpQAWRX/RdJkIdeLP3+LZ1xejhtoeo801eSoWby6KpsItRpH3hUk kMPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cwjXYU8YmUTvMNgco6t8puRj5FYzVGryWaQQJbRGf7E=; b=He9Rr4QIgDdgt4+mufnqkSr/wvLEBUE1/59nNuLE2Jh3IcRrGB1e5pu1Mh6x4tRVO5 LnB2PN1++1XCK+iUnSADKGGAd2DcZAcGj/+qNYC05eQ4AfK7f4L1sB1NhdQv6Gw0ZtEe rA4/RlS9Ml7cZxpi9+CCQWdhg+tdTq7NV/tWl1/p7rqBTiaoljQDmr1qOlMO5AzcW7mf uJcPmtfGwYh2w9qgu1Kv3JkY+AnWNu7kSZrTh4delGRlL4Hqm1mSP4bVPQEvTQjybjiw KvOXUQR5Vu9PFZirBJpCir0XXOIKrXWjyNQRbHCsAaROaLpd/MNGgFxLoLHGiTjzgaUg Wdpw== X-Gm-Message-State: APzg51DIgqAt1vBWJOuuImTES6+WW2wBIq3FlW3/EMTefA+LnS9Ij/pt x4vx17SPM7EPkxDCcUbFSyZl6mDsMYfBLtdVXBc= X-Received: by 2002:adf:9d81:: with SMTP id p1-v6mr7926777wre.12.1535651744869; Thu, 30 Aug 2018 10:55:44 -0700 (PDT) MIME-Version: 1.0 References: <1535453838-12154-1-git-send-email-sunil.kovvuri@gmail.com> <1535453838-12154-12-git-send-email-sunil.kovvuri@gmail.com> In-Reply-To: From: Sunil Kovvuri Date: Thu, 30 Aug 2018 23:25:33 +0530 Message-ID: Subject: Re: [PATCH 11/15] soc: octeontx2: Add Marvell OcteonTX2 CGX driver To: Arnd Bergmann Cc: LKML , olof@lixom.net, LAKML , linux-soc@vger.kernel.org, Sunil Goutham 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 Thu, Aug 30, 2018 at 7:37 PM Arnd Bergmann wrote: > > On Tue, Aug 28, 2018 at 3:10 PM Sunil Kovvuri wrote: > > > > > > > If this is a regular PCI ethernet driver, why do you put it into driver/soc > > > > > rather than drivers/net/ethernet/ ? > > > > > > > > No, this is not a ethernet driver, as mentioned in the cover letter > > > > this driver and AF driver doesn't > > > > handle any IO. There will be a separate ethernet driver (will submit > > > > that as well in future) which will > > > > communicate with these drivers for configuring hardware. > > > > > > > > The driver in question here is for a serdes controller which handles > > > > physical ethernet interfaces. > > > > Admin function driver gathers info w.r.t current state of physical > > > > ethernet interfaces from this driver > > > > and notifies actual ethernet driver about changes, if any. > > > > > > Ok. Can you describe the structure that the PCI devices appear > > > in? It might help to be make the connection between the differnet > > > patches to understand how things fit together. In the final > > > picture, how many different pci_driver instances do you have, > > > and what part are they for? > > > > List of PCI devices are CGX, RVU PF0-PFn SRIOV physical functions > > and RVU VF0-VFn SRIOV virtual functions. No of VFs per PF is configurable > > and done by low level firmware. > > > > List of PCI driver instances would be CGX driver, RVU PF0 (i.e admin > > function) driver, > > PF1-PFn either netdev driver or crypto driver, VF0-VFn functionality would be > > same as their PF. > > > > The current plan is to have CGX driver, Admin function driver, PF > > netdev driver, VF netdev driver and PF/VF crypto drivers. > > Ok, I think I understand the PF/VF distinction now. One (to me) > surprising aspect here is that you not just have one physical function > that you can use to assign resources to multiple virtual functions, > but also a second level of virtualization that is used to assign > resources to "physical functions" that are less physical than the > name suggests. Yes, PF is just for name sake, on-boot there is no difference between PFs/VFs as such. PF0 has privilege access to assign resources to all PFs and their VFs. This admin function driver loads for PF0. > > The part that I have not grasped yet is what the split between > the CGX and the AF is for, how they relate to one another, and > what the software abstraction for the two is going to be. In HW, CGX is a separate PCI device which handles the serdes and physical ethernet interface. Ethernet driver in drivers/net/ethernet can only communicate to admin function driver since they share a mailbox memory. So we had to bind both CGX and admin function drivers to almost work as one, inorder to provide relavent info to ethernet drivers. That's why we have many functions from CGX driver which AF uses. eg: Firmware gets to know about a physical interface status change, which CGX driver gets to know and it uses AF's mailbox communication to inform ethernet driver about the event. > > > > Is the idea that an ethernet device driver always attaches to a > > > virtual function that gets created by the main driver, and that > > > the two drivers share no interfaces on the kernel side, or do > > > you have multiple drivers linking to each other? > > > > Ethernet device driver can attach to both physical function and virtual function > > whose HW resources are provisioned by admin function driver. > > > > Yes the PF/VF ethernet drivers and these drivers won't share any > > kernel interfaces. > > Physical ethernet interface is owned by ethernet driver only, this driver just > > configures which ethernet driver instance uses which physcial interface. > > Ok. > > Arnd