diff options
author | Ajit Khaparde <ajitkhaparde@gmail.com> | 2010-02-09 01:34:21 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-12 12:27:58 -0800 |
commit | 205859a2ff922d0587a819b08007398cbd0a6a30 (patch) | |
tree | 922a58c16639df6e5c8eb14b05258fabeecbc8a0 /drivers/net/benet/be_main.c | |
parent | 34a89b8c75abe2873a95524552cc266fdd3b6a85 (diff) | |
download | linux-205859a2ff922d0587a819b08007398cbd0a6a30.tar.bz2 |
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/be_main.c')
-rw-r--r-- | drivers/net/benet/be_main.c | 8 |
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) rx_page_info = &adapter->rx_obj.page_info_tbl[frag_idx]; BUG_ON(!rx_page_info->page); - if (rx_page_info->last_page_user) + if (rx_page_info->last_page_user) { pci_unmap_page(adapter->pdev, pci_unmap_addr(rx_page_info, bus), adapter->big_page_size, PCI_DMA_FROMDEVICE); + rx_page_info->last_page_user = false; + } atomic_dec(&rxq->used); return rx_page_info; @@ -706,7 +708,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter, skb->data_len = curr_frag_len - hdr_len; skb->tail += hdr_len; } - memset(page_info, 0, sizeof(*page_info)); + page_info->page = NULL; if (pktsize <= rx_frag_size) { BUG_ON(num_rcvd != 1); @@ -739,7 +741,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter, skb->len += curr_frag_len; skb->data_len += curr_frag_len; - memset(page_info, 0, sizeof(*page_info)); + page_info->page = NULL; } BUG_ON(j > MAX_SKB_FRAGS); |