Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp194831imm; Thu, 30 Aug 2018 11:39:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdarFDKgkFS7aoIYASCDiiqIZ7sV+mloBbFRoKtejKB/+A5s7OW0b7Y6dHo8kI7VVOdBCuSQ X-Received: by 2002:a62:5cc1:: with SMTP id q184-v6mr11837375pfb.241.1535654365466; Thu, 30 Aug 2018 11:39:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535654365; cv=none; d=google.com; s=arc-20160816; b=k5jkQbA+W2Ky2SHmYpBVIF6caBGTRKQbFKxYsIDSXVTfZPWD1hsE1Bu71mkRfROMOV gqEb3hC9U0pmKprG29rxaQ3J7Gm81ocHxXCPqaeshUfkWJNrqUIAGfD2iR95J0Sydb37 a8vyFF9tFJcGpCrcFxw3jvkxVxO2AoX3v9DfyyUsDgiYkR1DLbdHUbMt1HULzOcNSA3Q 66Mq87k/y/dEp9QCdUy+cyFzrKvVLcFONR8T86DIz/5RoHJEMEH18tmgofALv9W4xKdQ xohV+c0Mg9MqH1iLafjhYRq/kSxfueTbwT6noLuv91AOmFrTHK3pj1bTNARFAoLYb/hn k/kw== 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=jcQ8owcppVEFIYb2YIOo4LepepkxBcVtZIlrtg8OzOA=; b=pq12IcrecfECNnAmiPQpi2bLy6w8tBpWfdTY5twf6IDtGshXI1Jf0H3kyLZO3XZfu7 KKNiLp9jfLBBZ6SiXdSMaZ1rWFJv9Gc2FJjW2PG5L405Jgm6DUE8YS5GEPAfFgRJSTds 0v3K7LnSFXux9UOTTL0htxGHsfKjyQaKDbcgeujRk0zDk7mb5u87yZAGi86Ozn0DBkD4 1XPgXLZORoc3GchvNLrF6/bEzzaRyDyZaicBTs9mdlv66/wxbfiSJt2l+imlDtdw5Gl2 K1dlGXHY1zzSWX4PmaGA1ujHPGasyPh8t9GQukAvbgpVMw0Smw03oUU9Ws+GPDHuu3nV JCHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="BJGFw/qD"; 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 h8-v6si7781473pli.14.2018.08.30.11.39.10; Thu, 30 Aug 2018 11:39:25 -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="BJGFw/qD"; 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 S1728348AbeH3Wke (ORCPT + 99 others); Thu, 30 Aug 2018 18:40:34 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:41128 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727722AbeH3Wkd (ORCPT ); Thu, 30 Aug 2018 18:40:33 -0400 Received: by mail-wr1-f68.google.com with SMTP id z96-v6so8958098wrb.8; Thu, 30 Aug 2018 11:37:03 -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=jcQ8owcppVEFIYb2YIOo4LepepkxBcVtZIlrtg8OzOA=; b=BJGFw/qD2hlTwvzJyrIIhxbWACxFpZc6H4FfunZmJzTTrQr7JyUvApaV3a28HIEh9U RyOjguUZcT9qOVfvXuBWo5IsgyihaFCuObHisXetB4ZStKO1IstKi9XhZkWZEL9sL0/j xHlyqnFd0yRSyXZS/DnzfWd1mXOrFV4Rk9IIvdjMcH3hzln2LP8uzJZuiUxz9NGOc17H 9xhB9b+DBWwDbKdCX11cIakF2AZ46jIZMi+zRkZnZlxj48So0xNso0gFhIxExxQi5hFb 1VYHkZMGsF2FBEX7Oqv8xdVQ5cLjGW6M5MuQIudDIA0+k4fDXtSgZiC5WSj+Uh3tRKYl gKLw== 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=jcQ8owcppVEFIYb2YIOo4LepepkxBcVtZIlrtg8OzOA=; b=gtACozguZTs7jiSyFOq5I8aKYAB7+IX6MprjqRa19Y9R4mWZT2/JoP8CZCU73Yem9A Sk5PEZtiMxCUo8SFOksB2ykbNDNOlRnG+VWSKftuGDJRwM483X2+blFWnhuaiyy2DzwS eFOFhJp5QGGRaHRxFkk1ly/rgH9ZPiqm5j5Z6cDT6PDx2nwZ+cTgP00PAVHtKisqQYMs UFZ8eEyKDFN46eK+YD8TLSkQHnD57wQ1es5boJQ7DXwd2oOs+UOS2NFewhVWmd/HK6AC 7kf6MeOyJaT+yd/iP00R+eAHKRDuxmVp20qzJhDmZjPA91dh9h/8AKbNT8AbHIjyPn5C AVJA== X-Gm-Message-State: APzg51BJRPQCsHPTpYjgugRt1/pRiteVgnGaR3udjFba2O71UasP0BaT EcEB+m9Lh03cuK6WlaFPcdO5IDWuEEjSN2794S8= X-Received: by 2002:a5d:61c1:: with SMTP id q1-v6mr8855124wrv.33.1535654222913; Thu, 30 Aug 2018 11:37:02 -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 00:06:51 +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 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: > > > > > > > > On Tue, Aug 28, 2018 at 5:33 PM Arnd Bergmann wrote: > > > > > > > > > > On Tue, Aug 28, 2018 at 12:57 PM wrote: > > > > > > > > > > > > From: Aleksey Makarov > > > > > > > > > > > > This patch adds mailbox support infrastructure APIs. > > > > > > Each RVU device has a dedicated 64KB mailbox region > > > > > > shared with it's peer for communication. RVU AF has > > > > > > a separate mailbox region shared with each of RVU PFs > > > > > > and a RVU PF has a separate region shared with each of > > > > > > it's VF. > > > > > > > > > > > > These set of APIs are used by this driver (RVU AF) and > > > > > > other RVU PF/VF drivers eg netdev, crypto e.t.c. > > > > > > > > > > > > Signed-off-by: Aleksey Makarov > > > > > > Signed-off-by: Sunil Goutham > > > > > > Signed-off-by: Lukasz Bartosik > > > > > > > > > > Why does this driver not use the drivers/mailbox/ infrastructure? > > > > > > > > > This is a common administrative software driver which will be handling requests > > > > from kernel drivers and as well as drivers in userspace applications. > > > > We had to keep mailbox communication infrastructure same across all usages. > > > > > > Can you explain more about the usage of userspace applications > > > and what interface you plan to use into the kernel? > > > > 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. > > Ok, so the mailbox here is a communication mechanism between > two device drivers that may run on the same kernel, or in different > instances (user space, virtual machine, ...), but each driver > only talks to the mailbox visible in its own device, right? Yes. > > 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? > > Arnd 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. Thanks, Sunil.