From patchwork Thu Oct 6 13:57:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 118098 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 6B98BB7490 for ; Fri, 7 Oct 2011 00:58:22 +1100 (EST) Received: from mail-ww0-f41.google.com (mail-ww0-f41.google.com [74.125.82.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 298B5B6F98 for ; Fri, 7 Oct 2011 00:58:09 +1100 (EST) Received: by wwf10 with SMTP id 10so7717071wwf.2 for ; Thu, 06 Oct 2011 06:58:04 -0700 (PDT) Received: by 10.216.132.198 with SMTP id o48mr1061015wei.7.1317909483851; Thu, 06 Oct 2011 06:58:03 -0700 (PDT) Received: from localhost ([82.166.227.17]) by mx.google.com with ESMTPS id fo7sm10342553wbb.20.2011.10.06.06.58.01 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Oct 2011 06:58:02 -0700 (PDT) Date: Thu, 6 Oct 2011 15:57:59 +0200 From: Eli Cohen To: Thadeu Lima de Souza Cascardo Subject: Re: [PATCH] mlx4_en: fix transmit of packages when blue frame is enabled Message-ID: <20111006135759.GH2681@mtldesk30> References: <1317388995-411-1-git-send-email-cascardo@linux.vnet.ibm.com> <953B660C027164448AE903364AC447D2235D9A8C@MTLDAG02.mtl.com> <20111003143721.GA3596@oc1711230544.ibm.com> <953B660C027164448AE903364AC447D2235DAA9D@MTLDAG02.mtl.com> <20111003205358.GB3596@oc1711230544.ibm.com> <1317708132.29415.213.camel@pasglop> <20111004202620.GA3455@oc1711230544.ibm.com> <20111005081502.GB2681@mtldesk30> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20111005081502.GB2681@mtldesk30> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Eli Cohen , "netdev@vger.kernel.org" , linuxppc-dev@lists.ozlabs.org, Yevgeny Petrilin X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org On Wed, Oct 05, 2011 at 10:15:02AM +0200, Eli Cohen wrote: How about this patch - can you give it a try? From dee60547aa9e35a02835451d9e694cd80dd3072f Mon Sep 17 00:00:00 2001 From: Eli Cohen Date: Thu, 6 Oct 2011 15:50:02 +0200 Subject: [PATCH] mlx4_en: Fix blue flame on powerpc The source buffer used for copying into the blue flame register is already in big endian. However, when copying to device on powerpc, the endianess is swapped so the data reaches th device in little endian which is wrong. On x86 based platform no swapping occurs so it reaches the device with the correct endianess. Fix this by calling le32_to_cpu() on the buffer. On LE systems there is no change; on BE there will be a swap. Signed-off-by: Eli Cohen --- drivers/net/mlx4/en_tx.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c index 16337fb..3743acc 100644 --- a/drivers/net/mlx4/en_tx.c +++ b/drivers/net/mlx4/en_tx.c @@ -601,6 +601,16 @@ u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb) static void mlx4_bf_copy(unsigned long *dst, unsigned long *src, unsigned bytecnt) { + int i; + __le32 *psrc = (__le32 *)src; + + /* + * the buffer is already in big endian. For little endian machines that's + * fine. For big endain machines we must swap since the chipset swaps again + */ + for (i = 0; i < bytecnt / 4; ++i) + psrc[i] = le32_to_cpu(psrc[i]); + __iowrite64_copy(dst, src, bytecnt / 8); }