Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1183821ybe; Fri, 13 Sep 2019 12:21:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwE/YvLeDRQWn2qRqCGfrW6HkMx40pqXBQ1cSaNjFxXdXye0JXerINEQ8z/xWSVYxBoaXE3 X-Received: by 2002:a50:d552:: with SMTP id f18mr50170764edj.36.1568402493755; Fri, 13 Sep 2019 12:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568402493; cv=none; d=google.com; s=arc-20160816; b=bce1KBi/ZbEyZpL8c/LvxfKw7lGyEW1E1/Yvx62selU0SnSXVXiPa3hOM+7zJu96uy 6LywCrNS7nQEifIYI3uyblbQkgtTmRZhKmx+744J2MIbVl+O59GmR3dJBT4SMX/6GFl1 jOLieis14L/hTC008qkvmw97IrG6lKyzod6+9apcGuaEa90ZNStrohFVhsdDBJjTix37 nPKGbVDvwZpQVaL+rNzmPMl/G1K9aJKB+gdn+7PWQCbvJpADR0F2mBKPfpxicU/TXUbY efNme1X/l3CXJFEt5akBxVC5GSV230+PZA0reqhOHlEw8LfMzS0oJz7FqoiPGZBUrCle H+2A== 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; bh=n/8TaZzU4/Xd0tjzBKZmUfSDILX2IFr4ta9frYs5Xs0=; b=RPOX+7NiDU7J68pkTEbtbNs1pU7Aa6zV/kpkUVgpE7JECFsoMP0PUZ2g+CDGKCXHUz kLXuSJdaYN0b0LDRttdXer2CQme3TB6GkJiWCXjrmoKkCdz42fstA+5BF2j9L1tMNwjr Wv2zoKEcnWpMMU+yUpAOPmkBrbjr8pS68PEIBH2p90phg+qo7+Gq4EzVw7cQ1KLGty0g m4dMY3ItB2IBbRnuYsbNQ8f9TYSHSNGazFWiOpRxG0W6GI8mD7gazW+1l/7qb80dp53Y ug/SxbkBzG9R7EGOio6ULhq4KvsorF703a3A5oaMdJWIlNz8zOP56YL7f4chXkzEJlOE cPHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=SG0DRyf5; 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 b56si18227113edb.418.2019.09.13.12.21.09; Fri, 13 Sep 2019 12:21:33 -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=@sifive.com header.s=google header.b=SG0DRyf5; 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 S2388354AbfIMRkE (ORCPT + 99 others); Fri, 13 Sep 2019 13:40:04 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:45722 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388048AbfIMRkE (ORCPT ); Fri, 13 Sep 2019 13:40:04 -0400 Received: by mail-lf1-f67.google.com with SMTP id r134so22724721lff.12 for ; Fri, 13 Sep 2019 10:40:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n/8TaZzU4/Xd0tjzBKZmUfSDILX2IFr4ta9frYs5Xs0=; b=SG0DRyf5kA6SfAWvLtYPpTznmt8fjufKkkzVymJlQgIOKEaXvEH993F6f5kACbN+Yz lQ59k1nNDgSMthjqAKWH0SnAOgMLOYCbaMK3He6s/3UrpVFl+fAcnwMUonRXg/N0V+vO LarcEqtWjc5HfRN9gtzoUpOdxFRF8Qwzk5gLh3zTcV9n00M6tKYglOrhOIALZHi1DdoV El/q3LbxaktFwDSOnnGv+Xol4RPbrjoB1LdYe4fVBNmNKd7TZvsHOtNY6YkSRO5SAD7J SksemlJhD2EzSXR8Z7pX7rHudvXcWTv6xul2cxLZ99PC43CGMv+oBnAWf56mQ0EJorqj fpkQ== 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=n/8TaZzU4/Xd0tjzBKZmUfSDILX2IFr4ta9frYs5Xs0=; b=B04K2bPjtMfC4q/GmuxASEa23nPyiuK8ZuQLwMcDCghKZfavEMqtvlHA6JSJVROnIM Iv1vX92nuUTLk8QhxPSCDFYAyHrF4S6R0f9h92npYqeXJkIqsajlcAl9rzcXCxY+A/+6 s+TZZwf+8W3sX0ZuN4o2xb18+kINgxousTvQecpgxMfVlkhTm8C/F8rYXY+AHARowdOX PkfUs8tHo+d7trfs2CWAZi4XdanKeXE6Mn9fgXwjIvJ7GSI2QNHMSS4sYayibBN+PhXc IzFkHbOkNDaR6S0wswSA6VUWhvtyP7VzVj5uamP6K0ypPus1T6ubhiOff+DybQdeLtfj f9jg== X-Gm-Message-State: APjAAAUPFTgpBfxhTSrW2qUJBHyhBfi7zAswIQ7p8L2+/GURflV0k1Ee G4BuGgraxlXPd1fhXLHnREswWVtJTNxCWfpVjz5Srw== X-Received: by 2002:a19:ac0c:: with SMTP id g12mr32149008lfc.128.1568396401610; Fri, 13 Sep 2019 10:40:01 -0700 (PDT) MIME-Version: 1.0 References: <1558650258-15050-1-git-send-email-alan.mikhak@sifive.com> <305100E33629484CBB767107E4246BBB0A6FAFFD@DE02WEMBXB.internal.synopsys.com> <305100E33629484CBB767107E4246BBB0A6FC308@DE02WEMBXB.internal.synopsys.com> <192e3a19-8b69-dfaf-aa5c-45c7087548cc@ti.com> <75d578c2-a98c-d1ef-1633-6dc5dc3b0913@ti.com> <6e692ff6-e64f-e651-c8ae-34d0034ad7b9@ti.com> <40fafe93-d2dd-b1f5-bc16-cd84ff07bd13@ti.com> In-Reply-To: <40fafe93-d2dd-b1f5-bc16-cd84ff07bd13@ti.com> From: Alan Mikhak Date: Fri, 13 Sep 2019 10:39:50 -0700 Message-ID: Subject: Re: [PATCH] PCI: endpoint: Add DMA to Linux PCI EP Framework To: Kishon Vijay Abraham I Cc: Haotian Wang , haotian.wang@duke.edu, Gustavo Pimentel , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "lorenzo.pieralisi@arm.com" , "arnd@arndb.de" , "gregkh@linuxfoundation.org" , "jingoohan1@gmail.com" , "bhelgaas@google.com" , "wen.yang99@zte.com.cn" , "kjlu@umn.edu" , "linux-riscv@lists.infradead.org" , "palmer@sifive.com" , "paul.walmsley@sifive.com" , Vinod Koul 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, Sep 13, 2019 at 5:11 AM Kishon Vijay Abraham I wrote: > > + Haotian Wang > > On 03/06/19 11:12 PM, Alan Mikhak wrote: > > On Sun, Jun 2, 2019 at 9:43 PM Kishon Vijay Abraham I wrote: > >> Hi Alan, > >> On 31/05/19 11:46 PM, Alan Mikhak wrote: > >>> On Thu, May 30, 2019 at 10:08 PM Kishon Vijay Abraham I wrote: > >>>> Hi Alan, > >>>>> Hi Kishon, > >>>> > >>>> I still have to look closer into your DMA patch but linked-list mode or single > >>>> block mode shouldn't be an user select-able option but should be determined by > >>>> the size of transfer. > >>> > >>> Please consider the following when taking a closer look at this patch. > >> > >> After seeing comments from Vinod and Arnd, it looks like the better way of > >> adding DMA support would be to register DMA within PCI endpoint controller to > >> DMA subsystem (as dmaengine) and use only dmaengine APIs in pci_epf_test. > > > > Thanks Kishon. That makes it clear where these pieces should go. > > > >>> In my specific use case, I need to verify that any valid block size, > >>> including a one byte transfer, can be transferred across the PCIe bus > >>> by memcpy_toio/fromio() or by DMA either as a single block or as > >>> linked-list. That is why, instead of deciding based on transfer size, > >>> this patch introduces the '-L' flag for pcitest to communicate the > >>> user intent across the PCIe bus to pci-epf-test so the endpoint can > >>> initiate the DMA transfer using a single block or in linked-list mode. > >> The -L option seems to select an internal DMA configuration which might be > >> specific to one implementation. As Gustavo already pointed, we should have only > >> generic options in pcitest. This would no longer be applicable when we move to > >> dmaengine. > > > > Single-block DMA seemed as generic as linked-list DMA and > > memcpy_toio/fromio. It remains unclear how else to communicate that > > intent to pci_epf_test each time I invoke pcitest. > > > > Regards, > > Alan > > Hi Kishon, FYI, I integrated your changes for DMAengine client support to PCI endpoint framework into my development branch. The following is the link you provided earlier as reference. I have been using it with good results. Haotian Wang also used it in a recent patch for PCI endpoint function for virtnet. Would you be able to comment on if and when your DMAengine client support may be submitted upstream? http://git.ti.com/cgit/cgit.cgi/ti-linux-kernel/ti-linux-kernel.git/tree/drivers/pci/endpoint/pci-epf-core.c?h=ti-linux-4.19.y Regards, Alan Mikhak