提交 9b08beba 编写于 作者: D Dhananjay Phadke 提交者: David S. Miller

netxen: fix skb alloc size for legacy firmware

Request 1532 bytes skb data size for NX3031. NX2031 firmware
needs 1760 sized buffers.
Signed-off-by: NDhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f17443f4
...@@ -143,18 +143,13 @@ ...@@ -143,18 +143,13 @@
#define NX_ETHERMTU 1500 #define NX_ETHERMTU 1500
#define NX_MAX_ETHERHDR 32 /* This contains some padding */ #define NX_MAX_ETHERHDR 32 /* This contains some padding */
#define NX_RX_NORMAL_BUF_MAX_LEN (NX_MAX_ETHERHDR + NX_ETHERMTU) #define NX_P2_RX_BUF_MAX_LEN 1760
#define NX_P3_RX_BUF_MAX_LEN (NX_MAX_ETHERHDR + NX_ETHERMTU)
#define NX_P2_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P2_MAX_MTU) #define NX_P2_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P2_MAX_MTU)
#define NX_P3_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P3_MAX_MTU) #define NX_P3_RX_JUMBO_BUF_MAX_LEN (NX_MAX_ETHERHDR + P3_MAX_MTU)
#define NX_CT_DEFAULT_RX_BUF_LEN 2048 #define NX_CT_DEFAULT_RX_BUF_LEN 2048
#define MAX_RX_BUFFER_LENGTH 1760 #define NX_RX_LRO_BUFFER_LENGTH (8060)
#define MAX_RX_JUMBO_BUFFER_LENGTH 8062
#define MAX_RX_LRO_BUFFER_LENGTH (8062)
#define RX_DMA_MAP_LEN (MAX_RX_BUFFER_LENGTH - 2)
#define RX_JUMBO_DMA_MAP_LEN \
(MAX_RX_JUMBO_BUFFER_LENGTH - 2)
#define RX_LRO_DMA_MAP_LEN (MAX_RX_LRO_BUFFER_LENGTH - 2)
/* /*
* Maximum number of ring contexts * Maximum number of ring contexts
......
...@@ -247,9 +247,14 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter) ...@@ -247,9 +247,14 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
rds_ring->skb_size = rds_ring->skb_size =
NX_CT_DEFAULT_RX_BUF_LEN; NX_CT_DEFAULT_RX_BUF_LEN;
} else { } else {
rds_ring->dma_size = RX_DMA_MAP_LEN; if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
rds_ring->dma_size =
NX_P3_RX_BUF_MAX_LEN;
else
rds_ring->dma_size =
NX_P2_RX_BUF_MAX_LEN;
rds_ring->skb_size = rds_ring->skb_size =
MAX_RX_BUFFER_LENGTH; rds_ring->dma_size + NET_IP_ALIGN;
} }
break; break;
...@@ -267,8 +272,8 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter) ...@@ -267,8 +272,8 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
case RCV_RING_LRO: case RCV_RING_LRO:
rds_ring->num_desc = adapter->num_lro_rxd; rds_ring->num_desc = adapter->num_lro_rxd;
rds_ring->dma_size = RX_LRO_DMA_MAP_LEN; rds_ring->dma_size = NX_RX_LRO_BUFFER_LENGTH;
rds_ring->skb_size = MAX_RX_LRO_BUFFER_LENGTH; rds_ring->skb_size = rds_ring->dma_size + NET_IP_ALIGN;
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册