Received: by 2002:ac0:adb2:0:0:0:0:0 with SMTP id o47-v6csp6046imb; Thu, 30 Aug 2018 06:59:16 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbKJ6KkkvIwA1nldx6E9P9AFi9RVbjfxmwX2F/J2oD4o5hAruhldZNA94ZOM6klzsubmFTm X-Received: by 2002:a17:902:b702:: with SMTP id d2-v6mr10584432pls.12.1535637556064; Thu, 30 Aug 2018 06:59:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535637556; cv=none; d=google.com; s=arc-20160816; b=mOv0hwtqHpp0qnl4DQ3xfdSQRqcufY0plU5GgGm+8aKsC+rE7msFdrlMcT4Z6nGTea jkxspyRIGCjbYyp2lD1UniqmqRSBEWrjSvA9C/kup9CUXFxdoFm6M4n3YkDhxSfFxk6M 0y6OUSJmdnJiGGXWrVfSFT5gHDw0qm1rYMMMkGWuNh/tL0oDytsI+racB/9r4XbZeejA b91rhHB7NLKhij/fFeQWQ71n/BkdTC9lC9M8E3aqlFkhdYhax1xrjyDzm1oyymqu1WfV F2eZvfpnYhN0UVNjR6y4qtkHKbrH714pQ2k33w3eibyUNzIDDKzHwDJuo2C2ugvaiCdp cejA== 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=RYvtCHntOFf39RNiijk78XZLNHtjhDQz6GCS2aHc6Mc=; b=bvWmrGhs0S33D1N7le/mQs7U6spEn52CCRPblBX1XpTKEsDi4FWe0eauLl7g/Aa4O+ FCQo81ekWMuXfl49oYTtlFiee7PR6mxyIphLtRJRngRCc/KWy0DqChqIyuL4QZ9PlZtd LJe6gbobsxY1hgRzywI5MTQxt496dcwZHfh63JDty/Mhsi5DLXeUrNKu6lQMqu7hMnow cKKoNJHKUe5m/Vi1DdzdVLzWOQvKqOGR+YMDQuzdBoMH+o28y1KSkiIly7o/oqfH1rai 8vK3JQGHN7d2ASZcrPRUfGj434ZCXTlC8VTqqPYWAy96FiJdPGg8fkfj3jHfc8VBSSkM fEKg== 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 b39-v6si7262528plb.484.2018.08.30.06.59.00; Thu, 30 Aug 2018 06:59:16 -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 S1729099AbeH3R7U (ORCPT + 99 others); Thu, 30 Aug 2018 13:59:20 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:45311 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728713AbeH3R7U (ORCPT ); Thu, 30 Aug 2018 13:59:20 -0400 Received: by mail-qt0-f194.google.com with SMTP id g44-v6so9838366qtb.12; Thu, 30 Aug 2018 06:57:04 -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=RYvtCHntOFf39RNiijk78XZLNHtjhDQz6GCS2aHc6Mc=; b=ugK8XhnfLfy8Lp91ND1+KCN6/jkYqJwOU3WvjI/EYMo/QpSa+qEUyiIGq5RfNhJAhM gokoBbK3rOlwhqtFWEYSI0fQrWv/QezUVvs5l+EL57clsSu/EAXaqSaMpC49hkwRrfH0 UkWsySif0jB32LER/2RAAbM9xc3TYX2HhgjAcESf2t33emJEQ7qgJLDtTmFo2hkslntw wIUoPA/TsGSjiNnWi968IBrOLdhAKqME6t7S+fm9v9Z32cq/Uv0iziUn94SPhkLU5KTm mD+HioDSD63qGTv7swRYnfdNTbhZHWwSIHU6xji8CcP8MIcRQPlQRsatnaRM3TU6xoQJ 1Usw== X-Gm-Message-State: APzg51CqYF/Kfk5ZUK0pJmqEQLZU/qj5/bEb6TFOryGJHYyalhyf2mV9 Scoe3KY9q4E+ZqtvlEgxZotGo7+/K33OtSbxpDA= X-Received: by 2002:a0c:885b:: with SMTP id 27-v6mr11523359qvm.115.1535637423488; Thu, 30 Aug 2018 06:57:03 -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: Thu, 30 Aug 2018 15:56:47 +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 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? 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