[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1369037707-27026-4-git-send-email-weiyang@linux.vnet.ibm.com>
Date: Mon, 20 May 2013 16:15:06 +0800
From: Wei Yang <weiyang@...ux.vnet.ibm.com>
To: jeffrey.t.kirsher@...el.com
Cc: e1000-devel@...ts.sourceforge.net, netdev@...r.kernel.org,
Wei Yang <weiyang@...ux.vnet.ibm.com>
Subject: [PATCH 3/4] e1000e: Calculate the desc_len based on adapter type
desc_len represents the size of descriptor in rx_ring. There are two kinds of
rx descriptors, e1000_rx_desc_packet_split(32 byte) and
e1000_rx_desc_extended(16 byte). Different adapter will use different rx
descriptors.
When allocating the dma space for this descriptor in current implementation,
the code ignore the descriptor type and take it as e1000_rx_desc_packet_split
in any case. This behavior will not effect the function, but will require
double size of dma space.
This patch will calculate the desc_len based on the adapter type.
Tested on T420, which use e1000_rx_desc_extended and works fine.
Signed-off-by: Wei Yang <weiyang@...ux.vnet.ibm.com>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 5cb8321..a2e8a53 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -2364,7 +2364,12 @@ int e1000e_setup_rx_resources(struct e1000_ring *rx_ring)
goto err_pages;
}
- desc_len = sizeof(union e1000_rx_desc_packet_split);
+ if (adapter->rx_ps_pages) {
+ /* this is a 32 byte descriptor */
+ desc_len = sizeof(union e1000_rx_desc_packet_split);
+ } else {
+ desc_len = sizeof(union e1000_rx_desc_extended);
+ }
/* Round up to nearest 4K */
rx_ring->size = rx_ring->count * desc_len;
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists