Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp654313imm; Fri, 31 Aug 2018 09:39:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYcOiKg3iZfaZjbIphmvkL+VUTj+O6teNJSnq7OdijRx+dyOMHAweghhM/JfkOWvGn8B9ai X-Received: by 2002:a63:1f0a:: with SMTP id f10-v6mr14951322pgf.66.1535733563477; Fri, 31 Aug 2018 09:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535733563; cv=none; d=google.com; s=arc-20160816; b=LjlZhk86ClwbSJ/bPh96spVf1M9zXZDBo42Am5o4wq8zHBRrEp7e0sH9TqSIZYPjfC nC9b6ZlCplfQUCADJMsIVVldAuE5QHjt8x/nBVxBobgzxz5qoZSUigkPwwiZLYd+rGmk ZOrOo4X2LsJ7pfZUqztU5ypPj91INMZ2QqjlfjeRFbhLSTCbnFxddH7DGLUvq6c0ox+b 6vSyk5XJe1ou2mTeh6A2SMQy124J9pbC6p5R+CmTQfmCdAxktRIl4jNZhxsNEK9Rqzlb zfW8jbEFWVqTEiAIF3mZ5RjaDB8afQ3IqqyYhs1xyhge4pQLBTJ678QDy5WJbfsPMJev DkfA== 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:arc-authentication-results; bh=TP8ZGwsEQsRzmKoj0dBlNuXeVoWE5a822Ceik/rVN28=; b=ljG0ggdWBpwMfDfm5KydrFIkSBML53q2pZ7uejnMreYkGsCfnPKNBhkQbn0K76Eou1 n3nMNzDjdkZO8czLu4s/gnNvXCAowxSRsaxZysLeNO9SVcRRreRDGiUnwI/4NheEpCxR 1tCwTzpqnq6pEzpWZxorKqLJr1GYXzk8FkxA7yZG2BwwJ6apIWuvnHFdUleQoxvOPgj3 fHoyv2zHqt5TBf2yt/KvW7s3KsNu9Ns7R6ch2S+VbaDXZNlgn4k2ZUK3gjMdOC22jHLh j0H1odKSHHtBu5naOQQs0LY22AXoUgIAKnTxj1K2zdvu8Fg+1PffU9zzsvYwRh+v953B 36Zw== ARC-Authentication-Results: i=1; mx.google.com; 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 p19-v6si9702010plo.432.2018.08.31.09.39.06; Fri, 31 Aug 2018 09:39:23 -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; 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 S1728430AbeHaSYD (ORCPT + 99 others); Fri, 31 Aug 2018 14:24:03 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:35340 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727432AbeHaSYD (ORCPT ); Fri, 31 Aug 2018 14:24:03 -0400 Received: by mail-qt0-f194.google.com with SMTP id j7-v6so14689499qtp.2; Fri, 31 Aug 2018 07:16:21 -0700 (PDT) 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=TP8ZGwsEQsRzmKoj0dBlNuXeVoWE5a822Ceik/rVN28=; b=HHzCE3z67iUppeLTCzG0QwJIeCfLHLIFVQpxLusiTKcQvMwRD3qV8b8kcSY3tq4k55 TdEDEHppPGJ6pcS2tAGDWzt5ClAnj8GEvUtjs+ol2pBCDZzAAeHUbVMPEZcd87D5kO7r XusBlSlv69q68eoOXKThYGyQiOLSKMucrkJaSeDl4gNagnwpkQwVAdG70AU6RJzjaDe+ 260K3Njggk1MnpHyKrWve7F4ZwLuUcDkAS5Kpx3t783k7nKMZZ2/ZbVgbcZQzXKyiJk8 TM1lWoYAT9WeP7RctfJNBiJUTVvekgLW0Dt8Lgo8B57LeKEmsHX+FvfH8DlQkxrqTxCD LkXQ== X-Gm-Message-State: APzg51BcdGUYIOetlvBX5f1QUxTl/NQ47FAKUxVMTktWu1UcokAPp7jU 2YgrSx3uvHTbYXw25Pi6pI17q3m1kHtq12BrvcI= X-Received: by 2002:a0c:c171:: with SMTP id i46-v6mr15625072qvh.40.1535724980590; Fri, 31 Aug 2018 07:16:20 -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: Arnd Bergmann Date: Fri, 31 Aug 2018 16:16:04 +0200 Message-ID: Subject: Re: [PATCH 04/15] soc: octeontx2: Add mailbox support infra To: Sunil Kovvuri Cc: Linux Kernel Mailing List , Olof Johansson , Linux ARM , linux-soc@vger.kernel.org, amakarov@marvell.com, sgoutham@marvell.com, lbartosik@marvell.com, Networking , David 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 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