diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2008-09-11 23:03:23 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-24 18:55:02 -0400 |
commit | 74ce8dd29be934c30d7874276cdb3dfffbf2bc80 (patch) | |
tree | dc264b2a556b0cc5ad0876e62cfb3968bf93fd94 | |
parent | 2adc0511a3126e392aa390cd203e8c3d4603e2c6 (diff) |
ixgbe: lower stack space usage
some functions were un-necessarily using local variables.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 257866b06f62..a215350c1969 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -482,7 +482,6 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, | |||
482 | struct ixgbe_ring *rx_ring, | 482 | struct ixgbe_ring *rx_ring, |
483 | int cleaned_count) | 483 | int cleaned_count) |
484 | { | 484 | { |
485 | struct net_device *netdev = adapter->netdev; | ||
486 | struct pci_dev *pdev = adapter->pdev; | 485 | struct pci_dev *pdev = adapter->pdev; |
487 | union ixgbe_adv_rx_desc *rx_desc; | 486 | union ixgbe_adv_rx_desc *rx_desc; |
488 | struct ixgbe_rx_buffer *bi; | 487 | struct ixgbe_rx_buffer *bi; |
@@ -516,7 +515,8 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter, | |||
516 | } | 515 | } |
517 | 516 | ||
518 | if (!bi->skb) { | 517 | if (!bi->skb) { |
519 | struct sk_buff *skb = netdev_alloc_skb(netdev, bufsz); | 518 | struct sk_buff *skb = netdev_alloc_skb(adapter->netdev, |
519 | bufsz); | ||
520 | 520 | ||
521 | if (!skb) { | 521 | if (!skb) { |
522 | adapter->alloc_rx_buff_failed++; | 522 | adapter->alloc_rx_buff_failed++; |
@@ -580,7 +580,6 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_adapter *adapter, | |||
580 | struct ixgbe_ring *rx_ring, | 580 | struct ixgbe_ring *rx_ring, |
581 | int *work_done, int work_to_do) | 581 | int *work_done, int work_to_do) |
582 | { | 582 | { |
583 | struct net_device *netdev = adapter->netdev; | ||
584 | struct pci_dev *pdev = adapter->pdev; | 583 | struct pci_dev *pdev = adapter->pdev; |
585 | union ixgbe_adv_rx_desc *rx_desc, *next_rxd; | 584 | union ixgbe_adv_rx_desc *rx_desc, *next_rxd; |
586 | struct ixgbe_rx_buffer *rx_buffer_info, *next_buffer; | 585 | struct ixgbe_rx_buffer *rx_buffer_info, *next_buffer; |
@@ -680,9 +679,9 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_adapter *adapter, | |||
680 | total_rx_bytes += skb->len; | 679 | total_rx_bytes += skb->len; |
681 | total_rx_packets++; | 680 | total_rx_packets++; |
682 | 681 | ||
683 | skb->protocol = eth_type_trans(skb, netdev); | 682 | skb->protocol = eth_type_trans(skb, adapter->netdev); |
684 | ixgbe_receive_skb(adapter, skb, staterr, rx_ring, rx_desc); | 683 | ixgbe_receive_skb(adapter, skb, staterr, rx_ring, rx_desc); |
685 | netdev->last_rx = jiffies; | 684 | adapter->netdev->last_rx = jiffies; |
686 | 685 | ||
687 | next_desc: | 686 | next_desc: |
688 | rx_desc->wb.upper.status_error = 0; | 687 | rx_desc->wb.upper.status_error = 0; |
@@ -1070,7 +1069,6 @@ static int ixgbe_clean_rxonly_many(struct napi_struct *napi, int budget) | |||
1070 | struct ixgbe_q_vector *q_vector = | 1069 | struct ixgbe_q_vector *q_vector = |
1071 | container_of(napi, struct ixgbe_q_vector, napi); | 1070 | container_of(napi, struct ixgbe_q_vector, napi); |
1072 | struct ixgbe_adapter *adapter = q_vector->adapter; | 1071 | struct ixgbe_adapter *adapter = q_vector->adapter; |
1073 | struct net_device *netdev = adapter->netdev; | ||
1074 | struct ixgbe_ring *rx_ring = NULL; | 1072 | struct ixgbe_ring *rx_ring = NULL; |
1075 | int work_done = 0, i; | 1073 | int work_done = 0, i; |
1076 | long r_idx; | 1074 | long r_idx; |
@@ -1097,7 +1095,7 @@ static int ixgbe_clean_rxonly_many(struct napi_struct *napi, int budget) | |||
1097 | rx_ring = &(adapter->rx_ring[r_idx]); | 1095 | rx_ring = &(adapter->rx_ring[r_idx]); |
1098 | /* If all Rx work done, exit the polling mode */ | 1096 | /* If all Rx work done, exit the polling mode */ |
1099 | if (work_done < budget) { | 1097 | if (work_done < budget) { |
1100 | netif_rx_complete(netdev, napi); | 1098 | netif_rx_complete(adapter->netdev, napi); |
1101 | if (adapter->itr_setting & 3) | 1099 | if (adapter->itr_setting & 3) |
1102 | ixgbe_set_itr_msix(q_vector); | 1100 | ixgbe_set_itr_msix(q_vector); |
1103 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | 1101 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) |
@@ -2284,7 +2282,7 @@ static int ixgbe_poll(struct napi_struct *napi, int budget) | |||
2284 | struct ixgbe_q_vector *q_vector = container_of(napi, | 2282 | struct ixgbe_q_vector *q_vector = container_of(napi, |
2285 | struct ixgbe_q_vector, napi); | 2283 | struct ixgbe_q_vector, napi); |
2286 | struct ixgbe_adapter *adapter = q_vector->adapter; | 2284 | struct ixgbe_adapter *adapter = q_vector->adapter; |
2287 | int tx_cleaned = 0, work_done = 0; | 2285 | int tx_cleaned, work_done = 0; |
2288 | 2286 | ||
2289 | #if defined(CONFIG_DCA) || defined(CONFIG_DCA_MODULE) | 2287 | #if defined(CONFIG_DCA) || defined(CONFIG_DCA_MODULE) |
2290 | if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) { | 2288 | if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) { |
@@ -2307,7 +2305,6 @@ static int ixgbe_poll(struct napi_struct *napi, int budget) | |||
2307 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | 2305 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) |
2308 | ixgbe_irq_enable(adapter); | 2306 | ixgbe_irq_enable(adapter); |
2309 | } | 2307 | } |
2310 | |||
2311 | return work_done; | 2308 | return work_done; |
2312 | } | 2309 | } |
2313 | 2310 | ||