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: 118097 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0F3B5B7105 for ; Fri, 7 Oct 2011 00:58:15 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758619Ab1JFN6H (ORCPT ); Thu, 6 Oct 2011 09:58:07 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:53475 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758515Ab1JFN6G (ORCPT ); Thu, 6 Oct 2011 09:58:06 -0400 Received: by wyg34 with SMTP id 34so2836491wyg.19 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 Cc: Benjamin Herrenschmidt , Yevgeny Petrilin , "netdev@vger.kernel.org" , Eli Cohen , linuxppc-dev@lists.ozlabs.org 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) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.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); }