aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
authorAjit Khaparde <ajitkhaparde@gmail.com>2010-02-08 20:34:21 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-12 15:27:58 -0500
commit205859a2ff922d0587a819b08007398cbd0a6a30 (patch)
tree922a58c16639df6e5c8eb14b05258fabeecbc8a0 /drivers/net/benet
parent34a89b8c75abe2873a95524552cc266fdd3b6a85 (diff)
be2net: minor code optimizations
Couple of code optimizations in the Rx path (to avoid a memset). From: Sathya P <sathyap@serverengines.com> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index c65c63427d41..1951d7620a88 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -636,9 +636,11 @@ get_rx_page_info(struct be_adapter *adapter, u16 frag_idx)
636 rx_page_info = &adapter->rx_obj.page_info_tbl[frag_idx]; 636 rx_page_info = &adapter->rx_obj.page_info_tbl[frag_idx];
637 BUG_ON(!rx_page_info->page); 637 BUG_ON(!rx_page_info->page);
638 638
639 if (rx_page_info->last_page_user) 639 if (rx_page_info->last_page_user) {
640 pci_unmap_page(adapter->pdev, pci_unmap_addr(rx_page_info, bus), 640 pci_unmap_page(adapter->pdev, pci_unmap_addr(rx_page_info, bus),
641 adapter->big_page_size, PCI_DMA_FROMDEVICE); 641 adapter->big_page_size, PCI_DMA_FROMDEVICE);
642 rx_page_info->last_page_user = false;
643 }
642 644
643 atomic_dec(&rxq->used); 645 atomic_dec(&rxq->used);
644 return rx_page_info; 646 return rx_page_info;
@@ -706,7 +708,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
706 skb->data_len = curr_frag_len - hdr_len; 708 skb->data_len = curr_frag_len - hdr_len;
707 skb->tail += hdr_len; 709 skb->tail += hdr_len;
708 } 710 }
709 memset(page_info, 0, sizeof(*page_info)); 711 page_info->page = NULL;
710 712
711 if (pktsize <= rx_frag_size) { 713 if (pktsize <= rx_frag_size) {
712 BUG_ON(num_rcvd != 1); 714 BUG_ON(num_rcvd != 1);
@@ -739,7 +741,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
739 skb->len += curr_frag_len; 741 skb->len += curr_frag_len;
740 skb->data_len += curr_frag_len; 742 skb->data_len += curr_frag_len;
741 743
742 memset(page_info, 0, sizeof(*page_info)); 744 page_info->page = NULL;
743 } 745 }
744 BUG_ON(j > MAX_SKB_FRAGS); 746 BUG_ON(j > MAX_SKB_FRAGS);
745 747