netpoll: slight optimization for netpoll_neigh_reply
Subsystems (2)
PATCH 1/1 netpoll: slight optimization for netpoll_neigh_reply
From: Li RongQing <[email protected]>
'hits' is used to check If there is a device who is interested in this skb, not care the device number, so stop the loop once a device is found
Signed-off-by Li RongQing <[email protected]>
--- net/core/netpoll.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/core/netpoll.c +3 -1
@@ -545,8 +545,10 @@ static void netpoll_neigh_reply(struct sk_buff *skb, struct netpoll_info *npinfoinspection whether this is interesting at all */ spin_lock_irqsave (&npinfo->rx_lock, flags);list_for_each_entry_safe (np, tmp, &npinfo->rx_np, rx) { -if (np->dev == skb->dev) +if (np->dev == skb->dev) { hits++; +break ; + } }spin_unlock_irqrestore (&npinfo->rx_lock, flags);
Signature · 1 line
1.7.10.4
this patch can be dropped since other patch has been merged into net-next[netpoll: Remove dead packet receive code (CONFIG_NETPOLL_TRAP)]
Quoted 30 lines · On Mon, Mar 17, 2014 at 3:09 PM, <[email protected]> wrote:
From: Li RongQing <[email protected]>
'hits' is used to check If there is a device who is interested in this skb, not care the device number, so stop the loop once a device is found
Signed-off-by Li RongQing <[email protected]>--- net/core/netpoll.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)net/core/netpoll.c +3
-2@@ -545,8 +545,10 @@ static void netpoll_neigh_reply(struct sk_buff *skb, struct netpoll_info *npinfoinspection whether this is interesting at all */ spin_lock_irqsave (&npinfo->rx_lock, flags);list_for_each_entry_safe (np, tmp, &npinfo->rx_np, rx) { -if (np->dev == skb->dev) +if (np->dev == skb->dev) { hits++; +break ; + } }spin_unlock_irqrestore (&npinfo->rx_lock, flags); --1.7.10.4