* [PATCH net-next-2.6 1/4] be2net: a mini optimization in rx_compl_process() code
@ 2010-02-17 11:34 Sathya Perla
2010-02-17 21:49 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Sathya Perla @ 2010-02-17 11:34 UTC (permalink / raw)
To: netdev
Introduce unlikely() for skb alloc failure and vlanf checks...
Signed-off-by: Sathya Perla <sathyap@serverengines.com>
---
drivers/net/benet/be_main.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index cbfaa3f..7bf1900 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,
u32 vlanf, vid;
u8 vtm;
- vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
- vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp);
-
- /* vlanf could be wrongly set in some cards.
- * ignore if vtm is not set */
- if ((adapter->cap & 0x400) && !vtm)
- vlanf = 0;
-
skb = netdev_alloc_skb_ip_align(adapter->netdev, BE_HDR_LEN);
- if (!skb) {
+ if (unlikely(!skb)) {
if (net_ratelimit())
dev_warn(&adapter->pdev->dev, "skb alloc failed\n");
be_rx_compl_discard(adapter, rxcp);
@@ -795,7 +787,15 @@ static void be_rx_compl_process(struct be_adapter *adapter,
skb->protocol = eth_type_trans(skb, adapter->netdev);
skb->dev = adapter->netdev;
- if (vlanf) {
+ vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
+ vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp);
+
+ /* vlanf could be wrongly set in some cards.
+ * ignore if vtm is not set */
+ if ((adapter->cap & 0x400) && !vtm)
+ vlanf = 0;
+
+ if (unlikely(vlanf)) {
if (!adapter->vlan_grp || adapter->vlans_added == 0) {
kfree_skb(skb);
return;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next-2.6 1/4] be2net: a mini optimization in rx_compl_process() code
2010-02-17 11:34 [PATCH net-next-2.6 1/4] be2net: a mini optimization in rx_compl_process() code Sathya Perla
@ 2010-02-17 21:49 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-02-17 21:49 UTC (permalink / raw)
To: sathyap; +Cc: netdev
From: Sathya Perla <sathyap@serverengines.com>
Date: Wed, 17 Feb 2010 17:04:22 +0530
> Introduce unlikely() for skb alloc failure and vlanf checks...
>
> Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-17 21:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-17 11:34 [PATCH net-next-2.6 1/4] be2net: a mini optimization in rx_compl_process() code Sathya Perla
2010-02-17 21:49 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.