Received: by 10.192.165.156 with SMTP id m28csp86403imm; Tue, 17 Apr 2018 07:00:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx48kffdjQSY3E9Vjz88w6fSP8CG8SOWT2w8qrZviBxLyz/53T6xhv2frEW2VHjMl1cHGVFwD X-Received: by 2002:a17:902:6590:: with SMTP id c16-v6mr2167356plk.292.1523973616599; Tue, 17 Apr 2018 07:00:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523973616; cv=none; d=google.com; s=arc-20160816; b=N/GgdT4KLMaJcGazis2mCvbJlLcmgbKJsixkt71LAsNiiaGdKHvhnKH3RjAM1oc9Up mRp4mfxWyCdoppvcSKyAV/XQVAMgJv6TI97PvGC19aJZpCICGQWO4J9pVmviMUfAC7Wb hzxi8n+QBcIRFhXZg9GgM1PEEwkCr2mgkKcqcloLoVHSDxCDDXobkSnrg/FR7sWMhFNc +lT+H2EP21yXAXVsIprgFKyAojjIyMCYKkDTdf24e5HLll6EzcRj8+Cayb08yn7xprXF dvQRQYacU23eo8uzxKX0RzJzEon9Hdn/6qkHwH9CbvdbQgNiDsgdIwWesioR7Pr/MsTY UIyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=2lBrwWh+Y8FqWml5x/k2loABIPLyM6yqsOOq6900vXw=; b=lIdQ4IksbOi9CVmHVDRGBzZUtkUXdD/XVnFBw5rwDqVQqpcRHPc8/XMK+ewDa+xNfT Ym8u3ix+UL/u1iLP2sUNjKu4C9IXGwHjMhMgLzY9eVcgQelg0h4FTsDNMe/gEeYZw9IG sj5u90MU0fVQXRb4GrQka5mAYy4raNRp2OU4LYp9naJvH2WL1cJjSSzgoOt/d/EtNsD2 vmDuaBQzthXjlstlh8wASVMzBSHwfJdnbQZDoa9H+dQ2uKgjk2/IAYndgk/kqRnrUliq k9As6CVJAfkk1wkJIgKivq/KCtSzySt+lAGsMQs6VwwObt5p02irPp0/+bEgpF0jq5EV dYEQ== 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 n11-v6si5115062plp.221.2018.04.17.07.00.02; Tue, 17 Apr 2018 07:00: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 S1753966AbeDQN6d (ORCPT + 99 others); Tue, 17 Apr 2018 09:58:33 -0400 Received: from www381.your-server.de ([78.46.137.84]:53958 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753088AbeDQN6a (ORCPT ); Tue, 17 Apr 2018 09:58:30 -0400 Received: from [88.198.220.131] (helo=sslproxy02.your-server.de) by www381.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1f8R7p-0004IT-Ke; Tue, 17 Apr 2018 15:58:25 +0200 Received: from [2003:86:2c44:e800:8200:bff:fe9b:6612] by sslproxy02.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-SHA:256) (Exim 4.84_2) (envelope-from ) id 1f8R7p-0000hg-CP; Tue, 17 Apr 2018 15:58:25 +0200 Subject: Re: [RFC 2/6] dmaengine: xilinx_dma: Pass AXI4-Stream control words to netdev dma client To: Peter Ujfalusi , Radhey Shyam Pandey , Vinod Koul Cc: "michal.simek@xilinx.com" , "linux-kernel@vger.kernel.org" , "dmaengine@vger.kernel.org" , "dan.j.williams@intel.com" , Appana Durga Kedareswara Rao , "linux-arm-kernel@lists.infradead.org" References: <1522665546-10035-1-git-send-email-radheys@xilinx.com> <1522665546-10035-3-git-send-email-radheys@xilinx.com> <20180411090854.GY6014@localhost> <7f549d2e-fc96-8c7e-d839-edb86ae088a5@metafoo.de> <4ba085c7-5256-6c8a-5697-c0d5736a6e46@ti.com> From: Lars-Peter Clausen Message-ID: <1fc10bec-5c2c-98f1-1d5b-b768dea844ed@metafoo.de> Date: Tue, 17 Apr 2018 15:58:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <4ba085c7-5256-6c8a-5697-c0d5736a6e46@ti.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.99.3/24488/Tue Apr 17 14:24:28 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/17/2018 03:46 PM, Peter Ujfalusi wrote: > On 2018-04-17 15:54, Lars-Peter Clausen wrote: >> On 04/17/2018 01:43 PM, Radhey Shyam Pandey wrote: >>> Hi Vinod, >>> >>>> -----Original Message----- >>>> From: Vinod Koul [mailto:vinod.koul@intel.com] >>>> Sent: Wednesday, April 11, 2018 2:39 PM >>>> To: Radhey Shyam Pandey >>>> Cc: dan.j.williams@intel.com; michal.simek@xilinx.com; Appana Durga >>>> Kedareswara Rao ; Radhey Shyam Pandey >>>> ; lars@metafoo.de; dmaengine@vger.kernel.org; >>>> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org >>>> Subject: Re: [RFC 2/6] dmaengine: xilinx_dma: Pass AXI4-Stream control >>>> words to netdev dma client >>>> >>>> On Mon, Apr 02, 2018 at 04:09:02PM +0530, Radhey Shyam Pandey wrote: >>>> >>>>> + >>>>> + if (chan->xdev->has_axieth_connected) { >>>>> + seg = list_first_entry(&desc->segments, >>>>> + struct xilinx_axidma_tx_segment, >>>> node); >>>>> + if (cb.callback_param) { >>>>> + app_w = (u32 *) cb.callback_param; >>>> >>>> why are you interpreting callback_param? This is plainly wrong. >>>> we do not know what is the interpretation of callback_param and it is >>>> internal to submitter. >>> In design, if AXI DMA is connected to AXI Ethernet IP there are certain >>> AXI4-Stream Status fields (RX) that we need to pass to ethernet driver >>> along with data buffer. An example includes: checksum fields, packet >>> length etc. To pass these control words there is a structure defined >>> between dmaengine and client. Before calling the client callback >>> stream control words are copied to dma client callback_param struct >>> (only if axieth is connected). >>> >>> I understand it's not an ideal way and we shouldn't be interpreting >>> callback_param but couldn't find any better alternative of passing >>> custom information from dmaengine to client driver and still be >>> aligned to the framework. >>> >>>> >>>> What exactly is the problem you are trying to solve? >>> As mentioned above we need to pass AXI4-stream words(custom >>> data) from dmaengine driver to dma client driver(ethernet) for >>> each DMA descriptor. Current solution populates callback_param >>> struct (only if axieth is connected). Please let me know if there is >>> an alternate solution. >> >> The standard interfaces need to work in a way that a client using them does >> not have to know to which DMA controller it is connected. In a similar way >> the DMA controller shouldn't have any client specific logic for the generic >> interfaces. Otherwise there is no point of having a generic interface. >> >> There are two options. >> >> Either you extend the generic interfaces so it can cover your usecase in a >> generic way. E.g. the ability to attach meta data to transfer. > > Fwiw I have this patch as part of a bigger work to achieve similar results: That's good stuff. Is this in a public tree somewhere? >> Or you can implement a interface that is specific to your DMA controller and >> any client using this interface knows it is talking to your DMA controller. > > Hrm, so we can have DMA driver specific calls? The reason why TI's keystone 2 > navigator DMA support was rejected that it was introducing NAV specific calls > for clients to configure features not yet supported by the framework. In my opinion it is OK, somebody else might have different ideas. I mean it is not nice, but it is better than the alternative of overloading the generic API with driver specific semantics or introducing some kind of IOCTL catch all callback. If there is tight coupling between the DMA core and client and there is no intention of using a generic client the best solution might even be to no use DMAengine at all.