Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp688030imm; Fri, 31 Aug 2018 10:29:55 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb4cji6aItUNDMXQdXnmI9TP8jlSIMFRpRsiOzNaGKLTu9MOqxqq1MdhnBixRu3ehnFm70e X-Received: by 2002:a17:902:8c82:: with SMTP id t2-v6mr2174235plo.241.1535736595070; Fri, 31 Aug 2018 10:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535736595; cv=none; d=google.com; s=arc-20160816; b=CdAYwLSCON4F7N1nnWOYgtP/dC21YT+YlkVXnl10p+ob+O3kQXzT9vTD4an3bGwzXR cI1xVXEav5q1aCsYOl+bAn8QIYDOhS4nfZ53mDPIM4s13xzd+xTknHtj8p0d6BMGCrPd 8lCzhvfujhwsGj6qX0PO/XSgC1brjq1NYWXNlcI54JtRX942hhAjFDZEtmO49XdT5AEv BkG1ephJExlUMVKjQKDvGHGQHUYdexQVAl9sIPeJAY23n6jQOZ/mqY0niHTzjZuY3c3x nq8oS9IgSvFU5bVaqyFWVRfSYyHLdNg/KRc25G6n8Nk4+3kxT1uZ0kIJ3oSrPfmfllqE 5H7g== 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=7QoZGT2HFme8Q3ztIq1Z9OsqVbgIPLDBdFi3J7NpRs8=; b=CAT+6Pf2It6tFlOMzlEF2n9qwDs4cCY227oPiKR+e8p1C9ho3ALTP4hjw4Xdie4mnH ESWijRLLjWR7Wx7pglFgh2lRLAY1yfxvqcerb7VdsiOZSLA4qz8YH0wLT0RnGQAGI8qZ ZqQ6HOB+DYHXT+h3U/tOnMQk6HWKMvg+/2vXwGIMCOCvBCTLYz4XeO90HbJ4Aid1EFuL FeE7S0UWC4i6ALzCHZnUP9qiE6wxkJ3ZrZbnbfAfLsm3OIP3FoPvzJzxvHuKCr5fKGjM kLdqLNiCRKHVMNBcvCFPZO5UU5Vcb6fZYt25gVehAAPjTBeBYWklfX5WT916LivXODH9 oSDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XF0C11ub; 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 e1-v6si10575669plk.166.2018.08.31.10.29.40; Fri, 31 Aug 2018 10:29:55 -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=XF0C11ub; 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 S1727681AbeHaVeH (ORCPT + 99 others); Fri, 31 Aug 2018 17:34:07 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46276 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726915AbeHaVeH (ORCPT ); Fri, 31 Aug 2018 17:34:07 -0400 Received: by mail-wr1-f67.google.com with SMTP id a108-v6so11864825wrc.13; Fri, 31 Aug 2018 10:25:37 -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=7QoZGT2HFme8Q3ztIq1Z9OsqVbgIPLDBdFi3J7NpRs8=; b=XF0C11ubjT525Fjlh+iMur/yKO8SB6/A48UaE3m+rWK5mVystgjKFW6RK7DXOLUqWG a8kRnvQSZP4PA+OEz3hKJIqOzeyZ6z1IqSMSr38mULj5kKE1UMVE6vTsnDLzt5Ovc5FJ kJWWONphnSUUG5Y4/MgjsOe6nX7Lvlv7Udc3t8FWTqxwqqVBy6QB2u7ahmyF9uhpM/rY Z3JqwbqLcdg1xXOW3GR8H/UdOQ67wp9oi3QS44maMVbFgiGHpJucJIdjl76QZzCtVd7/ r4vjsvyquC9dOjhbsTjIam9f2v4XAOW97zgXQCFq46/2vEsAwSDgh2c84uQ0aZCwWfaZ 7Nag== 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=7QoZGT2HFme8Q3ztIq1Z9OsqVbgIPLDBdFi3J7NpRs8=; b=kutmAOl7eByqA69FgwF3ONIfmWnGTGW9TkpgyOMdN4uqnkrvOCGf0lpxQmCdQc+Yc6 LRniLDvJKRc+nXmLWm0I/6wTekSug30XEYA0wVn9EVTM9qp2JtF08DXBMK9zcF4Zxqp7 lM4TGNbj+xnOjvncGckZpXqpysv4X8dCIqdEzI1BASygZ/gNS40SVXc1zelJUqlgp3Bw Eay20FIO6nRaRahR2/ciYdsL19FD1JxG7PjMhQim8c/gWlJo5ahZYc83HYCb1jMcNz7r q+myQqMVB6DForMoseUPBw1CUokLWXJ7nphzt1pxkzsvkyWIem39EFkwO/ovXKRH1rLY muVA== X-Gm-Message-State: APzg51AFNvNtSPMVstyHEfmVk17kDRSFe4KGCUnFM8mLQgY7sgEqRhhp BF8N2krV69iUVsrFM7ehovce98zgM+D7P0NeZOw= X-Received: by 2002:adf:82c3:: with SMTP id 61-v6mr11972348wrc.131.1535736336582; Fri, 31 Aug 2018 10:25:36 -0700 (PDT) MIME-Version: 1.0 References: <1535453838-12154-1-git-send-email-sunil.kovvuri@gmail.com> <1535453838-12154-5-git-send-email-sunil.kovvuri@gmail.com> In-Reply-To: From: Sunil Kovvuri Date: Fri, 31 Aug 2018 22:55:25 +0530 Message-ID: Subject: Re: [PATCH 04/15] soc: octeontx2: Add mailbox support infra To: Arnd Bergmann Cc: LKML , olof@lixom.net, LAKML , linux-soc@vger.kernel.org, Aleksey Makarov , Sunil Goutham , Lukasz Bartosik , Linux Netdev List , "David S. Miller" 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 Fri, Aug 31, 2018 at 7:46 PM Arnd Bergmann wrote: > > On Thu, Aug 30, 2018 at 8:37 PM Sunil Kovvuri wrote: > > On Thu, Aug 30, 2018 at 7:27 PM Arnd Bergmann wrote: > > > On Tue, Aug 28, 2018 at 3:23 PM Sunil Kovvuri wrote: > > > > On Tue, Aug 28, 2018 at 6:22 PM Arnd Bergmann wrote: > > > > > On Tue, Aug 28, 2018 at 2:48 PM Sunil Kovvuri wrote: > > > > Any PCI device here irrespective in what domain (kernel or userspace) > > > > they are in > > > > use common mailbox communication. Which is > > > > # Write a mailbox msg (format is agreed between all parties) into > > > > shared (between AF and other PF/VFs) > > > > memory region and trigger a interrupt to admin function. > > > > # Admin function processes the msg and puts reply in the same memory > > > > region and trigger > > > > IRQ to the requesting device. If the device has a driver instance > > > > in kernel then it uses > > > > IRQ and userspace applications does polling on the IRQ status bit. > > > > > > What is the purpose of the exported interface then? Is this > > > just an abstraction so each of the drivers can talk to its own > > > mailbox using a set of common helper functions? > > > > > > > Yes, that's correct. > > > > In kernel there will be a minimum of 3 drivers which will use this > > mailbox communication. > > So instead of duplicating APIs and structures in every driver, we > > thought of adding them in this AF driver and export them to ethernet > > and crypto drivers. > > Ok. My feeling is then that the API is fine, but that it should not > be part of the AF module but rather be a standalone module. > > My comment about the generic mailbox API no longer applies > here: you don't have a single shared mailbox hardware interface, > but each device has its own mailbox register set, so there > is no point in setting up a separate device for it, but I see > no need for creating an artificial dependency on the AF > driver. E.g. in a virtual machine that only has one ethernet > interface, you otherwise wouldn't load that driver, right? > > Arnd Good point, thanks for catching this. Will look into this and post a v2 series. Thanks, Sunil.