From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3FB38B6F70 for ; Sun, 9 Oct 2011 18:29:12 +1100 (EST) Subject: RE: [PATCH] mlx4_en: fix transmit of packages when blue frame isenabled From: Benjamin Herrenschmidt To: David Laight In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Sun, 09 Oct 2011 09:28:51 +0200 Message-ID: <1318145331.29415.372.camel@pasglop> Mime-Version: 1.0 Cc: netdev@vger.kernel.org, Yevgeny Petrilin , Eli Cohen , Eli Cohen , linuxppc-dev@lists.ozlabs.org, Thadeu Lima de Souza Cascardo List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, 2011-10-06 at 15:10 +0100, David Laight wrote: > horrid... > 1) I'm not sure the caller expects the buffer to be corrupted. > 2) It contains a lot of memory cycles. > 3) It looked from the calls that this code is copying descriptors, > so the transfer length is probably 1 or 2 words - so the loop > is inefficient. > 4) ppc doesn't have a fast byteswap instruction (very new gcc might > use the byteswapping memery access for the le32_to_cpu() though), > so it would be better getting the byteswap done inside > __iowrite64_copy() - since that is probably requesting a byteswap > anyway. > OTOH I'm not at all clear about the 64bit xfers.... And it's just plain wrong anyway. You should never have to byteswap a copy. Ben.