]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: optimize tcf_match_indev()
authorWANG Cong <xiyou.wangcong@gmail.com>
Fri, 10 Jan 2014 00:14:02 +0000 (16:14 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Jan 2014 19:50:15 +0000 (11:50 -0800)
commit23c43b3ddbb5ab01611356a90814739a4df21d9f
treefcfbf3b98b6e186ea042d8167ddbde5b4fff63f2
parent84b668fc50d2c58006e0b200d2515b7e2eb92ec3
net_sched: optimize tcf_match_indev()

tcf_match_indev() is called in fast path, it is not wise to
search for a netdev by ifindex and then compare by its name,
just compare the ifindex.

Also, dev->name could be changed by user-space, therefore
the match would be always fail, but dev->ifindex could
be consistent.

BTW, this will also save some bytes from the core struct of u32.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/pkt_cls.h
net/sched/cls_fw.c
net/sched/cls_u32.c