From d2757fc4076118e13180e91f02c3c52659be3d9d Mon Sep 17 00:00:00 2001 From: Matt Carlson Date: Mon, 12 Apr 2010 06:58:27 +0000 Subject: tg3: Optimize rx double copy test On a PCIX bus, the 5701 has a bug which requires the driver to double copy all rx packets. The rx code uses the rx_offset device member as a flag to determine if this workaround should take effect. The following patch will modify the rx_offset member such that this test will become less clear. The patch starts by integrating the workaround check into the packet length check. It rounds out the implementation by relaxing the workaround restrictions if the platform has efficient unaligned accesses. Signed-off-by: Matt Carlson Reviewed-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/tg3.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/net/tg3.h') diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index 9e7fe0e7cdb..43dd1d26243 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h @@ -23,8 +23,6 @@ #define TG3_BDINFO_NIC_ADDR 0xcUL /* 32-bit */ #define TG3_BDINFO_SIZE 0x10UL -#define RX_COPY_THRESHOLD 256 - #define TG3_RX_INTERNAL_RING_SZ_5906 32 #define RX_STD_MAX_SIZE 1536 @@ -2754,9 +2752,11 @@ struct tg3 { struct tg3_napi napi[TG3_IRQ_MAX_VECS]; void (*write32_rx_mbox) (struct tg3 *, u32, u32); + u32 rx_copy_thresh; u32 rx_pending; u32 rx_jumbo_pending; u32 rx_std_max_post; + u32 rx_offset; u32 rx_pkt_map_sz; #if TG3_VLAN_TAG_USED struct vlan_group *vlgrp; @@ -2776,7 +2776,6 @@ struct tg3 { unsigned long last_event_jiffies; }; - u32 rx_offset; u32 tg3_flags; #define TG3_FLAG_TAGGED_STATUS 0x00000001 #define TG3_FLAG_TXD_MBOX_HWBUG 0x00000002 -- cgit v1.2.3-70-g09d2