提交 251a84c9 编写于 作者: A Amit Kumar Salecha 提交者: David S. Miller

qlcnic: cleanup unused code

LRO ring, cut-thru mode and specific fw version are not
valid to Qlogic CNA device.
Signed-off-by: NAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1bb09fb9
...@@ -98,8 +98,6 @@ ...@@ -98,8 +98,6 @@
#define QLCNIC_CT_DEFAULT_RX_BUF_LEN 2048 #define QLCNIC_CT_DEFAULT_RX_BUF_LEN 2048
#define QLCNIC_LRO_BUFFER_EXTRA 2048 #define QLCNIC_LRO_BUFFER_EXTRA 2048
#define QLCNIC_RX_LRO_BUFFER_LENGTH (8060)
/* Opcodes to be used with the commands */ /* Opcodes to be used with the commands */
#define TX_ETHER_PKT 0x01 #define TX_ETHER_PKT 0x01
#define TX_TCP_PKT 0x02 #define TX_TCP_PKT 0x02
...@@ -133,7 +131,6 @@ ...@@ -133,7 +131,6 @@
#define RCV_RING_NORMAL 0 #define RCV_RING_NORMAL 0
#define RCV_RING_JUMBO 1 #define RCV_RING_JUMBO 1
#define RCV_RING_LRO 2
#define MIN_CMD_DESCRIPTORS 64 #define MIN_CMD_DESCRIPTORS 64
#define MIN_RCV_DESCRIPTORS 64 #define MIN_RCV_DESCRIPTORS 64
...@@ -144,7 +141,6 @@ ...@@ -144,7 +141,6 @@
#define MAX_RCV_DESCRIPTORS_10G 8192 #define MAX_RCV_DESCRIPTORS_10G 8192
#define MAX_JUMBO_RCV_DESCRIPTORS_1G 512 #define MAX_JUMBO_RCV_DESCRIPTORS_1G 512
#define MAX_JUMBO_RCV_DESCRIPTORS_10G 1024 #define MAX_JUMBO_RCV_DESCRIPTORS_10G 1024
#define MAX_LRO_RCV_DESCRIPTORS 8
#define DEFAULT_RCV_DESCRIPTORS_1G 2048 #define DEFAULT_RCV_DESCRIPTORS_1G 2048
#define DEFAULT_RCV_DESCRIPTORS_10G 4096 #define DEFAULT_RCV_DESCRIPTORS_10G 4096
...@@ -402,7 +398,6 @@ struct qlcnic_hardware_context { ...@@ -402,7 +398,6 @@ struct qlcnic_hardware_context {
rwlock_t crb_lock; rwlock_t crb_lock;
struct mutex mem_lock; struct mutex mem_lock;
u8 cut_through;
u8 revision_id; u8 revision_id;
u8 pci_func; u8 pci_func;
u8 linkup; u8 linkup;
...@@ -917,7 +912,6 @@ struct qlcnic_adapter { ...@@ -917,7 +912,6 @@ struct qlcnic_adapter {
u16 num_txd; u16 num_txd;
u16 num_rxd; u16 num_rxd;
u16 num_jumbo_rxd; u16 num_jumbo_rxd;
u16 num_lro_rxd;
u8 max_rds_rings; u8 max_rds_rings;
u8 max_sds_rings; u8 max_sds_rings;
......
...@@ -412,7 +412,6 @@ qlcnic_get_ringparam(struct net_device *dev, ...@@ -412,7 +412,6 @@ qlcnic_get_ringparam(struct net_device *dev,
ring->rx_pending = adapter->num_rxd; ring->rx_pending = adapter->num_rxd;
ring->rx_jumbo_pending = adapter->num_jumbo_rxd; ring->rx_jumbo_pending = adapter->num_jumbo_rxd;
ring->rx_jumbo_pending += adapter->num_lro_rxd;
ring->tx_pending = adapter->num_txd; ring->tx_pending = adapter->num_txd;
if (adapter->ahw.port_type == QLCNIC_GBE) { if (adapter->ahw.port_type == QLCNIC_GBE) {
......
...@@ -230,17 +230,8 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter) ...@@ -230,17 +230,8 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
switch (ring) { switch (ring) {
case RCV_RING_NORMAL: case RCV_RING_NORMAL:
rds_ring->num_desc = adapter->num_rxd; rds_ring->num_desc = adapter->num_rxd;
if (adapter->ahw.cut_through) { rds_ring->dma_size = QLCNIC_P3_RX_BUF_MAX_LEN;
rds_ring->dma_size = rds_ring->skb_size = rds_ring->dma_size + NET_IP_ALIGN;
QLCNIC_CT_DEFAULT_RX_BUF_LEN;
rds_ring->skb_size =
QLCNIC_CT_DEFAULT_RX_BUF_LEN;
} else {
rds_ring->dma_size =
QLCNIC_P3_RX_BUF_MAX_LEN;
rds_ring->skb_size =
rds_ring->dma_size + NET_IP_ALIGN;
}
break; break;
case RCV_RING_JUMBO: case RCV_RING_JUMBO:
...@@ -254,13 +245,6 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter) ...@@ -254,13 +245,6 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
rds_ring->skb_size = rds_ring->skb_size =
rds_ring->dma_size + NET_IP_ALIGN; rds_ring->dma_size + NET_IP_ALIGN;
break; break;
case RCV_RING_LRO:
rds_ring->num_desc = adapter->num_lro_rxd;
rds_ring->dma_size = QLCNIC_RX_LRO_BUFFER_LENGTH;
rds_ring->skb_size = rds_ring->dma_size + NET_IP_ALIGN;
break;
} }
rds_ring->rx_buf_arr = (struct qlcnic_rx_buffer *) rds_ring->rx_buf_arr = (struct qlcnic_rx_buffer *)
vmalloc(RCV_BUFF_RINGSIZE(rds_ring)); vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
...@@ -556,12 +540,10 @@ qlcnic_has_mn(struct qlcnic_adapter *adapter) ...@@ -556,12 +540,10 @@ qlcnic_has_mn(struct qlcnic_adapter *adapter)
QLCNIC_FW_VERSION_OFFSET, (int *)&flashed_ver); QLCNIC_FW_VERSION_OFFSET, (int *)&flashed_ver);
flashed_ver = QLCNIC_DECODE_VERSION(flashed_ver); flashed_ver = QLCNIC_DECODE_VERSION(flashed_ver);
if (flashed_ver >= QLCNIC_VERSION_CODE(4, 0, 220)) {
capability = QLCRD32(adapter, QLCNIC_PEG_TUNE_CAPABILITY); capability = QLCRD32(adapter, QLCNIC_PEG_TUNE_CAPABILITY);
if (capability & QLCNIC_PEG_TUNE_MN_PRESENT) if (capability & QLCNIC_PEG_TUNE_MN_PRESENT)
return 1; return 1;
}
return 0; return 0;
} }
...@@ -1279,7 +1261,6 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter, ...@@ -1279,7 +1261,6 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter,
skb = buffer->skb; skb = buffer->skb;
if (!adapter->ahw.cut_through)
skb_reserve(skb, 2); skb_reserve(skb, 2);
dma = pci_map_single(pdev, skb->data, dma = pci_map_single(pdev, skb->data,
......
...@@ -543,21 +543,9 @@ qlcnic_check_options(struct qlcnic_adapter *adapter) ...@@ -543,21 +543,9 @@ qlcnic_check_options(struct qlcnic_adapter *adapter)
brd_name, adapter->ahw.revision_id); brd_name, adapter->ahw.revision_id);
} }
if (adapter->fw_version < QLCNIC_VERSION_CODE(3, 4, 216)) { dev_info(&pdev->dev, "firmware v%d.%d.%d\n",
adapter->driver_mismatch = 1;
dev_warn(&pdev->dev, "firmware version %d.%d.%d unsupported\n",
fw_major, fw_minor, fw_build); fw_major, fw_minor, fw_build);
return;
}
i = QLCRD32(adapter, QLCNIC_SRE_MISC);
adapter->ahw.cut_through = (i & 0x8000) ? 1 : 0;
dev_info(&pdev->dev, "firmware v%d.%d.%d [%s]\n",
fw_major, fw_minor, fw_build,
adapter->ahw.cut_through ? "cut-through" : "legacy");
if (adapter->fw_version >= QLCNIC_VERSION_CODE(4, 0, 222))
adapter->capabilities = QLCRD32(adapter, CRB_FW_CAPABILITIES_1); adapter->capabilities = QLCRD32(adapter, CRB_FW_CAPABILITIES_1);
adapter->flags &= ~QLCNIC_LRO_ENABLED; adapter->flags &= ~QLCNIC_LRO_ENABLED;
...@@ -575,7 +563,6 @@ qlcnic_check_options(struct qlcnic_adapter *adapter) ...@@ -575,7 +563,6 @@ qlcnic_check_options(struct qlcnic_adapter *adapter)
adapter->num_txd = MAX_CMD_DESCRIPTORS; adapter->num_txd = MAX_CMD_DESCRIPTORS;
adapter->num_lro_rxd = 0;
adapter->max_rds_rings = 2; adapter->max_rds_rings = 2;
} }
...@@ -2566,24 +2553,12 @@ qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter) ...@@ -2566,24 +2553,12 @@ qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter)
#define is_qlcnic_netdev(dev) (dev->netdev_ops == &qlcnic_netdev_ops) #define is_qlcnic_netdev(dev) (dev->netdev_ops == &qlcnic_netdev_ops)
static int
qlcnic_destip_supported(struct qlcnic_adapter *adapter)
{
if (adapter->ahw.cut_through)
return 0;
return 1;
}
static void static void
qlcnic_config_indev_addr(struct net_device *dev, unsigned long event) qlcnic_config_indev_addr(struct net_device *dev, unsigned long event)
{ {
struct in_device *indev; struct in_device *indev;
struct qlcnic_adapter *adapter = netdev_priv(dev); struct qlcnic_adapter *adapter = netdev_priv(dev);
if (!qlcnic_destip_supported(adapter))
return;
indev = in_dev_get(dev); indev = in_dev_get(dev);
if (!indev) if (!indev)
return; return;
...@@ -2662,7 +2637,7 @@ qlcnic_inetaddr_event(struct notifier_block *this, ...@@ -2662,7 +2637,7 @@ qlcnic_inetaddr_event(struct notifier_block *this,
adapter = netdev_priv(dev); adapter = netdev_priv(dev);
if (!adapter || !qlcnic_destip_supported(adapter)) if (!adapter)
goto done; goto done;
if (adapter->is_up != QLCNIC_ADAPTER_UP_MAGIC) if (adapter->is_up != QLCNIC_ADAPTER_UP_MAGIC)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册