Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754747AbbGQDHn (ORCPT ); Thu, 16 Jul 2015 23:07:43 -0400 Received: from mga01.intel.com ([192.55.52.88]:6492 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753207AbbGQDHl (ORCPT ); Thu, 16 Jul 2015 23:07:41 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,492,1432623600"; d="asc'?scan'208";a="525723303" Date: Fri, 17 Jul 2015 08:39:26 +0530 From: Vinod Koul To: Maxime Ripard Cc: Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Thomas Petazzoni , Boris Brezillon , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/2] dmaengine: xdmac: Add scatter gathered memset support Message-ID: <20150717030926.GC5086@localhost> References: <1436177964-19380-1-git-send-email-maxime.ripard@free-electrons.com> <1436177964-19380-3-git-send-email-maxime.ripard@free-electrons.com> <20150716120154.GN5086@localhost> <20150716141105.GJ28632@lukather> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jL2BoiuKMElzg3CS" Content-Disposition: inline In-Reply-To: <20150716141105.GJ28632@lukather> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3210 Lines: 82 --jL2BoiuKMElzg3CS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 16, 2015 at 04:11:05PM +0200, Maxime Ripard wrote: > Hi Vinod, >=20 > > > + /* > > > + * The scatterlist API gives us only the address and > > > + * length of each elements. > > > + * > > > + * Unfortunately, we don't have the stride, which we > > > + * will need to compute. > > > + * > > > + * That make us end up in a situation like this one: > > > + * len stride len stride len > > > + * +-------+ +-------+ +-------+ > > > + * | N-2 | | N-1 | | N | > > > + * +-------+ +-------+ +-------+ > > > + * > > > + * We need all these three elements (N-2, N-1 and N) > > > + * to actually take the decision on whether we need to > > > + * queue N-1 or reuse N-2. > > > + * > > > + * We will only consider N if it is the last element. > > > + */ > > > > Why do you need stride? > >=20 > > This is scatterlist so the computation of stride sounds odd here. Ideal= ly > > you should take the scatterlist and program the lli for controller. >=20 > Because it is sub-optimal if the length and stride are equals from one > descriptors to another. The XDMAC is able to repeat any given > descriptor a given number of time (which is one by default), which > means that if the parameters of the transfer don't change, we simply > have to increment the number of time the descriptor has to be used, > instead of creating a new one that the controller will have to fetch. >=20 > In the non-optimal case (ie the length and/or stride change from one > scatterlist element to another), we simply fallback to a one LLI per > scatter list element. Sound fine to me. The optimization is a good one then... Another question though, do you expect stride to be linear for your cases, if so have you actually though about using interleaved API, for these cases --=20 ~Vinod --jL2BoiuKMElzg3CS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVqHHmAAoJEHwUBw8lI4NHkY4P/jL4V5eHGEA0JTYZqhMsOb+K /MIUMTGBINkVLxkKB5MvpBtKrhgVRkI9GyjRx5lnWTfuufHwCcrbTysBBGTQSfnj IPEEXOyUeu8j7urKVZf/bcOGPCRpNbPF96KwuQwsSby/KXXtCe3GOj/LMhg63HRd Uzy90AsRqRf5VdMc5LdC56hTe2JawXCW4vJTe5G2mHccQPSBI92jwrqVZboHiShd nlsa6U9TWjtSj0uv5OAz2rfTHWPzlpa4QlmBYdpDTgyDdpuDYZGgwYv1udp0uOpU lWEADIEzw4BxgjHIY4FpHrP2GVEr800G4wCYD3EBNHbha+OMG1zWfjv9FBUgmFVk +b5YEhqsn01DKUqS018tRljmtoj1LRhjlwlfEeHPNMS89zZaZzKtsWpBxKwPjXSp j1EsutCpJKTyaniT6EZ6gpqIwWyY5QzcdqLMPD/ojbgF7mTUA6JbY8u69XM533hF 5B+0eBE5oCou3Z2bSlcMg/xPVpEsHC/sR8JNcxy0BLQ4CUVy57zJbgJzfQN28IUj 5EN4F4p5zvtSwxIjRNukdmt7wIDxWKj4FI3/gAffrvLJgJSsxXef6pQ1y9h9SFPG nDIeEGJjh/pegE84Zk75tcsiFIpVhUOd1rarpHDVK2auu2lyXRKTylbjTwtNDQh1 qA5MtSU+RvmK/27SxL6B =BlCb -----END PGP SIGNATURE----- --jL2BoiuKMElzg3CS-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/