From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: RE: [PATCH] mlx4_en: fix transmit of packages when blue frame isenabled Date: Sun, 09 Oct 2011 09:28:51 +0200 Message-ID: <1318145331.29415.372.camel@pasglop> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Eli Cohen , Thadeu Lima de Souza Cascardo , Eli Cohen , Yevgeny Petrilin , linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org To: David Laight Return-path: Received: from gate.crashing.org ([63.228.1.57]:43429 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750893Ab1JIH3S (ORCPT ); Sun, 9 Oct 2011 03:29:18 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: 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.