aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_main.c
diff options
context:
space:
mode:
authorSathya Perla <sathyap@serverengines.com>2010-02-16 20:34:22 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-17 16:35:38 -0500
commita058a632747dd0f1799b12f4ecd54e43f5b5f10d (patch)
tree6a397196c62a0703756c8bd24cb1e964ba8bffac /drivers/net/benet/be_main.c
parentaa13bd6ef4ddd81080f972220fae30eb28f65b17 (diff)
be2net: a mini optimization in rx_compl_process() code
Introduce unlikely() for skb alloc failure and vlanf checks... Signed-off-by: Sathya Perla <sathyap@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.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index cbfaa3feb7c4..7bf1900df665 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -768,16 +768,8 @@ static void be_rx_compl_process(struct be_adapter *adapter,
768 u32 vlanf, vid; 768 u32 vlanf, vid;
769 u8 vtm; 769 u8 vtm;
770 770
771 vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
772 vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp);
773
774 /* vlanf could be wrongly set in some cards.
775 * ignore if vtm is not set */
776 if ((adapter->cap & 0x400) && !vtm)
777 vlanf = 0;
778
779 skb = netdev_alloc_skb_ip_align(adapter->netdev, BE_HDR_LEN); 771 skb = netdev_alloc_skb_ip_align(adapter->netdev, BE_HDR_LEN);
780 if (!skb) { 772 if (unlikely(!skb)) {
781 if (net_ratelimit()) 773 if (net_ratelimit())
782 dev_warn(&adapter->pdev->dev, "skb alloc failed\n"); 774 dev_warn(&adapter->pdev->dev, "skb alloc failed\n");
783 be_rx_compl_discard(adapter, rxcp); 775 be_rx_compl_discard(adapter, rxcp);
@@ -795,7 +787,15 @@ static void be_rx_compl_process(struct be_adapter *adapter,
795 skb->protocol = eth_type_trans(skb, adapter->netdev); 787 skb->protocol = eth_type_trans(skb, adapter->netdev);
796 skb->dev = adapter->netdev; 788 skb->dev = adapter->netdev;
797 789
798 if (vlanf) { 790 vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
791 vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp);
792
793 /* vlanf could be wrongly set in some cards.
794 * ignore if vtm is not set */
795 if ((adapter->cap & 0x400) && !vtm)
796 vlanf = 0;
797
798 if (unlikely(vlanf)) {
799 if (!adapter->vlan_grp || adapter->vlans_added == 0) { 799 if (!adapter->vlan_grp || adapter->vlans_added == 0) {
800 kfree_skb(skb); 800 kfree_skb(skb);
801 return; 801 return;