Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp448550lqp; Sat, 13 Apr 2024 04:25:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVI+FUYIIWEebAKXLgZhmLjLxbwq77PmgxuE+NqaUtot9g2S6ZSEgdC/DpZ0JQZDpWWCwzy6JOCOpqr5/i09gDhoOKTsrOL5cBRnn619Q== X-Google-Smtp-Source: AGHT+IFqwmuj4P/Q0UwIXngEbcgM89BeH4y8D5M3bB1YboMxlZ/U1DkB2D2X4jJKURV+YqMAG/lg X-Received: by 2002:a50:d55d:0:b0:566:d333:45e8 with SMTP id f29-20020a50d55d000000b00566d33345e8mr3323530edj.20.1713007511071; Sat, 13 Apr 2024 04:25:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713007511; cv=pass; d=google.com; s=arc-20160816; b=c1CV2bofxNH10nZoUm5LCenKL39ymHozJF8tzaerxyRsp/5u7N5qqdu4mjPPZ8639y lGPTBmXbATeb2S3Zrn+51JODVN7Oax4yq5P5jxc5lyKsxDh6MdzAZK5yYqp5NOTEoHs+ l71lGDALIUuXpiJa+y6Ppci/x+JHi4IXAGO+UtAPFs3AOkXr/08U6C//kewD+jBalmO7 c4YTuryFZ7+cu1PQ5CMYasz78kpvW57GSSjJoG8vf0axsPyxpVnVigalLsrSch9D2Lhv Glw1dkLvbBSdRWnEu8E6fgzDm8thtkbW8LBjWzQLottY+xw5Kvo+N7/Wa+DBuNHecv12 5ShQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=muhAfFhWn3ahExZk6anwTVpBa5CXLWeUVOdePglVPbs=; fh=MY2PVltkHSzjjFTifoh8n/alBGaarJc8ZQHEs99HbPQ=; b=QzctLegiXwha3dbSxN/fzNx4uyMQWH6eVzancZVqRQ3oQ/XFG4ar8e0ivM4SloYyFy uRSfMImhAz39rJ6aYm4y97+TIX5eQF4sbUPXjDlJwQZ84CWcLC6nvRdvXIRtnCjiNCx3 F8MtanqRdZ7IRAQBnjkmz1ff/hrgF/p34SOXc+agioUF+r2JTqCkeETavGncrR6+PlT3 0kpFd3EAxEl82kPK7wPWA+sFrGxGc6tBEuDaQnM3s3JsEsuw3Ppd107ePsLn/pLgBfSr g3WIKbhyRpDdIAoO8tAUf8q05p3pVsAXB/FrKizi72WF/NGua63CYgFDiRptII7HLBXY NX/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uri4XwlR; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-143706-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143706-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o21-20020a509b15000000b00570099f51casi875123edi.344.2024.04.13.04.25.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 04:25:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143706-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uri4XwlR; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-143706-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143706-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9F9BE1F22063 for ; Sat, 13 Apr 2024 11:25:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B6A93F9CB; Sat, 13 Apr 2024 11:25:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="uri4XwlR" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D6963D0D9 for ; Sat, 13 Apr 2024 11:25:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713007503; cv=none; b=Fj1rVM0e8sAMM8/SaI5w3oamkcAL4ObOfey1nVYXnnyHkENwiCi14ro2URMeY6sAZ1v5zCgNMiu1WvAJ2tvgKc72dmbGEe3LW1nGw4t3oN+9fYYgLY1MuPVIKN/dHVxQjE/1RRTYvGMviP3Rid27TsamVQ1+XJUbvYelSTG4VcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713007503; c=relaxed/simple; bh=bIZwXJuyXzez1b15wr20TySh8UjtK3VL4+xANWMGEUc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pfbakMe6tb2wcvUJu8PQCKdoUvUh/z6vlUsPcSMEFDwxpOONTpQxbrvJ2j7uC82Yo6lbCGzEK2Mr7xu5gb8T7xaqCeoAwQDxPxO+CCTV8I6sKe3vs5AptBy2dbUXXyzwLsE5E8/eAi5gT4d8INDi9ELBlMO4BzUMeWj0ygV5dW0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uri4XwlR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 933E3C2BBFC; Sat, 13 Apr 2024 11:25:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713007503; bh=bIZwXJuyXzez1b15wr20TySh8UjtK3VL4+xANWMGEUc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uri4XwlRqwXUyeEIp7cGLT2/6MyUe1SPz+G24cxFSa7LC+K3XBZPmxUu6z43bFImR Np1fJpVqokMCwtN6HK7JnZBpP3GI60LGbgeiGEfMtFIgsuPpKvfFHEINonvYDVuYuv xg6yphZ3GvWwp2p2vp7/5TORVO/xG339vMb4nHX0= Date: Sat, 13 Apr 2024 13:25:00 +0200 From: Greg KH To: Vamsi Krishna Attunuru Cc: "arnd@arndb.de" , "linux-kernel@vger.kernel.org" , Jerin Jacob Subject: Re: [EXTERNAL] Re: [PATCH v5 1/1] misc: mrvl-cn10k-dpi: add Octeon CN10K DPI administrative driver Message-ID: <2024041310-bundle-patio-8a22@gregkh> References: <20240412121005.1825881-1-vattunuru@marvell.com> <2024041250-nursing-tidy-db7e@gregkh> <2024041258-reminder-widely-00c0@gregkh> <2024041351-endowment-underrate-4b8d@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Apr 13, 2024 at 10:58:37AM +0000, Vamsi Krishna Attunuru wrote: > > > > -----Original Message----- > > From: Greg KH > > Sent: Saturday, April 13, 2024 11:18 AM > > To: Vamsi Krishna Attunuru > > Cc: arnd@arndb.de; linux-kernel@vger.kernel.org; Jerin Jacob > > > > Subject: Re: [EXTERNAL] Re: [PATCH v5 1/1] misc: mrvl-cn10k-dpi: add > > Octeon CN10K DPI administrative driver > > > > On Fri, Apr 12, 2024 at 04:19:58PM +0000, Vamsi Krishna Attunuru wrote: > > > > > > > > > > -----Original Message----- > > > > From: Greg KH > > > > Sent: Friday, April 12, 2024 9:05 PM > > > > To: Vamsi Krishna Attunuru > > > > Cc: arnd@arndb.de; linux-kernel@vger.kernel.org > > > > Subject: Re: [EXTERNAL] Re: [PATCH v5 1/1] misc: mrvl-cn10k-dpi: add > > > > Octeon CN10K DPI administrative driver > > > > > > > > On Fri, Apr 12, 2024 at 01:56:36PM +0000, Vamsi Krishna Attunuru wrote: > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > From: Greg KH > > > > > > Sent: Friday, April 12, 2024 5:57 PM > > > > > > To: Vamsi Krishna Attunuru > > > > > > Cc: arnd@arndb.de; linux-kernel@vger.kernel.org > > > > > > Subject: [EXTERNAL] Re: [PATCH v5 1/1] misc: mrvl-cn10k-dpi: add > > > > > > Octeon CN10K DPI administrative driver > > > > > > > > > > > > Prioritize security for external emails: Confirm sender and > > > > > > content safety before clicking links or opening attachments > > > > > > > > > > > > ---------------------------------------------------------------- > > > > > > ---- > > > > > > -- On Fri, Apr 12, 2024 at 05:10:05AM -0700, Vamsi Attunuru wrote: > > > > > > > Adds a misc driver for Marvell CN10K DPI(DMA Engine) device's > > > > > > > physical function which initializes DPI DMA hardware's global > > > > > > > configuration and enables hardware mailbox channels between > > > > > > > physical function (PF) and it's virtual functions (VF). VF > > > > > > > device drivers (User space drivers) use this hw mailbox to > > > > > > > communicate any required device configuration on it's respective > > VF device. > > > > > > > Accordingly, this DPI PF driver provisions the VF device resources. > > > > > > > > > > > > > > At the hardware level, the DPI physical function (PF) acts as > > > > > > > a management interface to setup the VF device resources, VF > > > > > > > devices are only provisioned to handle or control the actual > > > > > > > DMA Engine's data transfer > > > > > > capabilities. > > > > > > > > > > > > No pointer to the userspace code that uses this? Why not? How > > > > > > are we supposed to be able to review this? > > > > > > > > > > Userspace code will use two functionalities (mailbox & ioctl) from > > > > > this driver. DPDK DMA driver uses the mailbox and the dpdk > > > > > application uses the ioctl to setup the device attributes. We are > > > > > waiting for this kernel driver get merged to update the > > > > > corresponding support in DPDK > > > > driver and applications. I will provide the pointers to both the use > > > > cases in userspace code. > > > > > Meanwhile below is the current dpdk dma driver that uses sysfs > > > > > based scheme to convey mbox requests to the kernel DPI driver > > > > > which gets > > > > replaced with hardware mailbox scheme once mrvl-cn10k-dpi kernel > > > > driver is merged. > > > > > https://urldefense.proofpoint.com/v2/url?u=https- > > > > 3A__github.com_DPDK_d > > > > > pdk_blob_main_drivers_common_cnxk_roc- > > > > 5Fdpi.c&d=DwIBAg&c=nKjWec2b6R0mO > > > > > > > > > > > yPaz7xtfQ&r=WllrYaumVkxaWjgKto6E_rtDQshhIhik2jkvzFyRhW8&m=o3EhoL > > > > s7dsod > > > > > -YHS438Wl2Pf_MKMBYegGSKteoX3qFTB0HV897ykpCVbTp- > > > > nmj4e&s=A6TJDFUtPm3ksJh > > > > > qop89CL8GgKj4sjkJIVi1-RdnUr8&e= > > > > > > > > So this is a DPDK thing? Ugh, do the networking people know about this? > > > > If not, why aren't they reviewing this? > > > > > > Actually, It's not networking related. Like the Linux kernel, DPDK > > > also supports multiple subsystems like network, scheduler, DMA, > > > mempool etc. Regarding the usecases, the DPDK Marvell DMA/DPI VF > > > driver interacts(over hardware mailbox) with the mrvl-cn10k-dpi misc > > kernel driver(administrative driver) for setting up the VF device resources. > > > > So this is something that the PCI core should be concerned about then? > > No, it's a normal PCIe sriov capability implemented in all sriov capable PCIe devices. > Our PF device aka this driver in kernel space service mailbox requests from userspace > applications via VF devices. For instance, DPI VF device from user space writes into > mailbox registers and the DPI hardware triggers an interrupt to DPI PF device. > Upon PF interrupt, this driver services the mailbox requests. Isn't that a "normal" PCI thing? How is this different from other devices that have VF? > > > DPDK is one example that uses this driver, there can be other > > > userspace generic frameworks/applications where the virtual functions > > > are binded to userspace drivers and interact with physical/administrative > > function driver running in the kernel. > > > > Are there other devices/drivers that do this today in Linux? Why make a > > device-specific api for this common functionality? > > The apis defined in this driver are specific to Marvell DPI hardware. The api, yes, but that's the point, shouldn't this be generic for all hardware that supports this? Implementation should be device specific, in the driver. > For instance, > the variables molr(max outstanding load requests), fifo_max, ebus_port are > DPI hardware specific. Generally, drivers use driver-specific api to configure > any device-specific configuration which does not fit in common functionality right. > > Mailbox operations like dpi_queue_open & close are requests sent from VF device > to PF device for setting up the VF queue resources. Why is an ioctl to a random character device the correct api to userspace for this type of thing? Shouldn't this go through the PCI layer api instead? thanks, greg k-h