Received: by 10.192.165.156 with SMTP id m28csp18767imm; Tue, 17 Apr 2018 05:56:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+y6SXubKkU77Qgfb7G+LYlyz9U7WD30kh7VKEXi4E7My9USO5fKV3RoCBQqLRyEYxAtQKP X-Received: by 10.99.109.200 with SMTP id i191mr1654049pgc.291.1523969818382; Tue, 17 Apr 2018 05:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523969818; cv=none; d=google.com; s=arc-20160816; b=NgQZ7BgNhipXaRtHLIrJ968Fg92tUKsEVlmIFMeWIwXysEOnUuVo45SLjbTGL5fa3/ +dRtOzrTFwoWGDr0yvhBDSHFbjTivbWTBxXcneqsbrQ3xbtuir+KvOutKXR+5QJIfQEF W0UlfeevYXpr4mGyRrHeS9It7Ic4VknBACaOP17t2T1WRMb2V6FTCfJ8nrg3HFeb0reV NSlV9t53U5OyBKoStjpGcwi3zJooYNRnM7DnK2u1MInyZKMhP0x18jj30wn+WWcddrwx bq4a73oS9RpaNCMWy4aw/LYX7dBsEcQb3nfwHiC3EY8snvLZZ6tcMlyNL5kvdr+MpsmU xpOA== 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=zVQojI74EjSuL65CLpJu6OxOq/bsvdnss/wM4K17iGw=; b=shIpazHaq2x0UQrd58RBZD5lQ9lXuwpwOUynjpoGGY+n8zjv1QIDZLmY519epDpQMB wUxNNHqWEbD9f2bgwZV5g9eyDQw3wk7K+2vwSb/5tyAJ4aOVkSM0lPHnA+OF4Yve919d LBJCxisWM55kLfFs+qNaVU2NNdmSXXcH2z8lgS62HKTXR3psrguXOtkzWBKAOwiLF7J2 uoSa7OgszNxcqICRIXOYYeAzykK+cfO7jVlErm4MY0XHDJ0SYgGu9CsVgq6PCglx2sJG zh3CAm62BRYifItjBFDwRwt3GeYvuqTJFGZKdIe1HQy1IAyQbLs8kggo4su7rj2Jy1rN Z68Q== 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 f8si11373743pgr.419.2018.04.17.05.56.43; Tue, 17 Apr 2018 05:56:58 -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 S1753435AbeDQMyz (ORCPT + 99 others); Tue, 17 Apr 2018 08:54:55 -0400 Received: from www381.your-server.de ([78.46.137.84]:35905 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753231AbeDQMyy (ORCPT ); Tue, 17 Apr 2018 08:54:54 -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 1f8Q8H-0008Ug-Pv; Tue, 17 Apr 2018 14:54:49 +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 1f8Q8H-00080O-IR; Tue, 17 Apr 2018 14:54:49 +0200 Subject: Re: [RFC 2/6] dmaengine: xilinx_dma: Pass AXI4-Stream control words to netdev dma client To: Radhey Shyam Pandey , Vinod Koul Cc: "dan.j.williams@intel.com" , "michal.simek@xilinx.com" , Appana Durga Kedareswara Rao , "dmaengine@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" References: <1522665546-10035-1-git-send-email-radheys@xilinx.com> <1522665546-10035-3-git-send-email-radheys@xilinx.com> <20180411090854.GY6014@localhost> From: Lars-Peter Clausen Message-ID: <7f549d2e-fc96-8c7e-d839-edb86ae088a5@metafoo.de> Date: Tue, 17 Apr 2018 14:54:48 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 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. 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.