From patchwork Sun Apr 18 14:48:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladislav Zolotarov X-Patchwork-Id: 50403 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 BD293B7D0F for ; Mon, 19 Apr 2010 00:48:50 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754897Ab0DROso (ORCPT ); Sun, 18 Apr 2010 10:48:44 -0400 Received: from mms3.broadcom.com ([216.31.210.19]:3308 "EHLO MMS3.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754796Ab0DROsn (ORCPT ); Sun, 18 Apr 2010 10:48:43 -0400 Received: from [10.16.192.224] by MMS3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Sun, 18 Apr 2010 07:48:30 -0700 X-Server-Uuid: B55A25B1-5D7D-41F8-BC53-C57E7AD3C201 Received: from mail-irva-12.broadcom.com (10.11.16.101) by SJEXCHHUB01.corp.ad.broadcom.com (10.16.192.224) with Microsoft SMTP Server id 8.2.247.2; Sun, 18 Apr 2010 07:48:30 -0700 Received: from [10.185.6.94] (lb-tlvb-vladz.il.broadcom.com [10.185.6.94]) by mail-irva-12.broadcom.com (Postfix) with ESMTP id 4B71069CA8; Sun, 18 Apr 2010 07:48:29 -0700 (PDT) Subject: [PATCH 3/13] bnx2x: Increase DMAE max write size for 57711 to the max From: "Vladislav Zolotarov" To: davem@davemloft.net cc: netdev@vger.kernel.org, eilong@broadcom.com Date: Sun, 18 Apr 2010 17:48:30 +0300 Message-ID: <1271602110.27235.180.camel@lb-tlvb-vladz> MIME-Version: 1.0 X-Mailer: Evolution 2.28.3 X-WSS-ID: 67D5C43431G95141940-01-01 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Increase DMAE max write size for 57711 to the maximum allowed value. Signed-off-by: Vladislav Zolotarov Signed-off-by: Eilon Greenstein --- drivers/net/bnx2x.h | 2 +- drivers/net/bnx2x_main.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 0706c2c..fc00f79 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h @@ -1165,7 +1165,7 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, #define DMAE_CMD_E1HVN_SHIFT DMAE_COMMAND_E1HVN_SHIFT #define DMAE_LEN32_RD_MAX 0x80 -#define DMAE_LEN32_WR_MAX 0x400 +#define DMAE_LEN32_WR_MAX(bp) (CHIP_IS_E1(bp) ? 0x400 : 0x2000) #define DMAE_COMP_VAL 0xe0d0d0ae diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 33d7484..da89cb0 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c @@ -352,13 +352,14 @@ void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32) void bnx2x_write_dmae_phys_len(struct bnx2x *bp, dma_addr_t phys_addr, u32 addr, u32 len) { + int dmae_wr_max = DMAE_LEN32_WR_MAX(bp); int offset = 0; - while (len > DMAE_LEN32_WR_MAX) { + while (len > dmae_wr_max) { bnx2x_write_dmae(bp, phys_addr + offset, - addr + offset, DMAE_LEN32_WR_MAX); - offset += DMAE_LEN32_WR_MAX * 4; - len -= DMAE_LEN32_WR_MAX; + addr + offset, dmae_wr_max); + offset += dmae_wr_max * 4; + len -= dmae_wr_max; } bnx2x_write_dmae(bp, phys_addr + offset, addr + offset, len);