Commit 7546dd97d27306d939c13e03318aae695badaa88
Committed by
David S. Miller
1 parent
3f612132c7
Exists in
master
and in
20 other branches
net: convert usage of packet_type to read_mostly
Protocols that use packet_type can be __read_mostly section for better locality. Elminate any unnecessary initializations of NULL. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 21 changed files with 26 additions and 29 deletions Side-by-side Diff
- drivers/block/aoe/aoenet.c
- drivers/net/hamradio/bpqether.c
- drivers/net/pppoe.c
- drivers/net/wan/hdlc.c
- drivers/net/wan/lapbether.c
- net/8021q/vlan.c
- net/appletalk/ddp.c
- net/ax25/af_ax25.c
- net/decnet/af_decnet.c
- net/dsa/tag_dsa.c
- net/dsa/tag_edsa.c
- net/dsa/tag_trailer.c
- net/econet/af_econet.c
- net/ipv4/af_inet.c
- net/ipv4/arp.c
- net/ipv6/af_inet6.c
- net/ipx/af_ipx.c
- net/irda/irmod.c
- net/llc/llc_core.c
- net/phonet/af_phonet.c
- net/x25/af_x25.c
drivers/block/aoe/aoenet.c
drivers/net/hamradio/bpqether.c
... | ... | @@ -97,7 +97,7 @@ |
97 | 97 | static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); |
98 | 98 | static int bpq_device_event(struct notifier_block *, unsigned long, void *); |
99 | 99 | |
100 | -static struct packet_type bpq_packet_type = { | |
100 | +static struct packet_type bpq_packet_type __read_mostly = { | |
101 | 101 | .type = cpu_to_be16(ETH_P_BPQ), |
102 | 102 | .func = bpq_rcv, |
103 | 103 | }; |
drivers/net/pppoe.c
... | ... | @@ -513,17 +513,17 @@ |
513 | 513 | return NET_RX_SUCCESS; /* Lies... :-) */ |
514 | 514 | } |
515 | 515 | |
516 | -static struct packet_type pppoes_ptype = { | |
516 | +static struct packet_type pppoes_ptype __read_mostly = { | |
517 | 517 | .type = cpu_to_be16(ETH_P_PPP_SES), |
518 | 518 | .func = pppoe_rcv, |
519 | 519 | }; |
520 | 520 | |
521 | -static struct packet_type pppoed_ptype = { | |
521 | +static struct packet_type pppoed_ptype __read_mostly = { | |
522 | 522 | .type = cpu_to_be16(ETH_P_PPP_DISC), |
523 | 523 | .func = pppoe_disc_rcv, |
524 | 524 | }; |
525 | 525 | |
526 | -static struct proto pppoe_sk_proto = { | |
526 | +static struct proto pppoe_sk_proto __read_mostly = { | |
527 | 527 | .name = "PPPOE", |
528 | 528 | .owner = THIS_MODULE, |
529 | 529 | .obj_size = sizeof(struct pppox_sock), |
drivers/net/wan/hdlc.c
... | ... | @@ -348,7 +348,7 @@ |
348 | 348 | EXPORT_SYMBOL(attach_hdlc_protocol); |
349 | 349 | EXPORT_SYMBOL(detach_hdlc_protocol); |
350 | 350 | |
351 | -static struct packet_type hdlc_packet_type = { | |
351 | +static struct packet_type hdlc_packet_type __read_mostly = { | |
352 | 352 | .type = cpu_to_be16(ETH_P_HDLC), |
353 | 353 | .func = hdlc_rcv, |
354 | 354 | }; |
drivers/net/wan/lapbether.c
... | ... | @@ -421,7 +421,7 @@ |
421 | 421 | |
422 | 422 | /* ------------------------------------------------------------------------ */ |
423 | 423 | |
424 | -static struct packet_type lapbeth_packet_type = { | |
424 | +static struct packet_type lapbeth_packet_type __read_mostly = { | |
425 | 425 | .type = cpu_to_be16(ETH_P_DEC), |
426 | 426 | .func = lapbeth_rcv, |
427 | 427 | }; |
net/8021q/vlan.c
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | static const char vlan_copyright[] = "Ben Greear <greearb@candelatech.com>"; |
52 | 52 | static const char vlan_buggyright[] = "David S. Miller <davem@redhat.com>"; |
53 | 53 | |
54 | -static struct packet_type vlan_packet_type = { | |
54 | +static struct packet_type vlan_packet_type __read_mostly = { | |
55 | 55 | .type = cpu_to_be16(ETH_P_8021Q), |
56 | 56 | .func = vlan_skb_recv, /* VLAN receive method */ |
57 | 57 | }; |
net/appletalk/ddp.c
... | ... | @@ -1860,12 +1860,12 @@ |
1860 | 1860 | .notifier_call = ddp_device_event, |
1861 | 1861 | }; |
1862 | 1862 | |
1863 | -static struct packet_type ltalk_packet_type = { | |
1863 | +static struct packet_type ltalk_packet_type __read_mostly = { | |
1864 | 1864 | .type = cpu_to_be16(ETH_P_LOCALTALK), |
1865 | 1865 | .func = ltalk_rcv, |
1866 | 1866 | }; |
1867 | 1867 | |
1868 | -static struct packet_type ppptalk_packet_type = { | |
1868 | +static struct packet_type ppptalk_packet_type __read_mostly = { | |
1869 | 1869 | .type = cpu_to_be16(ETH_P_PPPTALK), |
1870 | 1870 | .func = atalk_rcv, |
1871 | 1871 | }; |
net/ax25/af_ax25.c
... | ... | @@ -1985,9 +1985,8 @@ |
1985 | 1985 | /* |
1986 | 1986 | * Called by socket.c on kernel start up |
1987 | 1987 | */ |
1988 | -static struct packet_type ax25_packet_type = { | |
1988 | +static struct packet_type ax25_packet_type __read_mostly = { | |
1989 | 1989 | .type = cpu_to_be16(ETH_P_AX25), |
1990 | - .dev = NULL, /* All devices */ | |
1991 | 1990 | .func = ax25_kiss_rcv, |
1992 | 1991 | }; |
1993 | 1992 |
net/decnet/af_decnet.c
... | ... | @@ -2112,9 +2112,8 @@ |
2112 | 2112 | |
2113 | 2113 | extern int dn_route_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); |
2114 | 2114 | |
2115 | -static struct packet_type dn_dix_packet_type = { | |
2115 | +static struct packet_type dn_dix_packet_type __read_mostly = { | |
2116 | 2116 | .type = cpu_to_be16(ETH_P_DNA_RT), |
2117 | - .dev = NULL, /* All devices */ | |
2118 | 2117 | .func = dn_route_rcv, |
2119 | 2118 | }; |
2120 | 2119 |
net/dsa/tag_dsa.c
net/dsa/tag_edsa.c
net/dsa/tag_trailer.c
net/econet/af_econet.c
net/ipv4/af_inet.c
... | ... | @@ -1500,7 +1500,7 @@ |
1500 | 1500 | * IP protocol layer initialiser |
1501 | 1501 | */ |
1502 | 1502 | |
1503 | -static struct packet_type ip_packet_type = { | |
1503 | +static struct packet_type ip_packet_type __read_mostly = { | |
1504 | 1504 | .type = cpu_to_be16(ETH_P_IP), |
1505 | 1505 | .func = ip_rcv, |
1506 | 1506 | .gso_send_check = inet_gso_send_check, |
net/ipv4/arp.c
net/ipv6/af_inet6.c
net/ipx/af_ipx.c
... | ... | @@ -1958,12 +1958,12 @@ |
1958 | 1958 | |
1959 | 1959 | SOCKOPS_WRAP(ipx_dgram, PF_IPX); |
1960 | 1960 | |
1961 | -static struct packet_type ipx_8023_packet_type = { | |
1961 | +static struct packet_type ipx_8023_packet_type __read_mostly = { | |
1962 | 1962 | .type = cpu_to_be16(ETH_P_802_3), |
1963 | 1963 | .func = ipx_rcv, |
1964 | 1964 | }; |
1965 | 1965 | |
1966 | -static struct packet_type ipx_dix_packet_type = { | |
1966 | +static struct packet_type ipx_dix_packet_type __read_mostly = { | |
1967 | 1967 | .type = cpu_to_be16(ETH_P_IPX), |
1968 | 1968 | .func = ipx_rcv, |
1969 | 1969 | }; |
net/irda/irmod.c
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 | /* Packet type handler. |
56 | 56 | * Tell the kernel how IrDA packets should be handled. |
57 | 57 | */ |
58 | -static struct packet_type irda_packet_type = { | |
58 | +static struct packet_type irda_packet_type __read_mostly = { | |
59 | 59 | .type = cpu_to_be16(ETH_P_IRDA), |
60 | 60 | .func = irlap_driver_rcv, /* Packet type handler irlap_frame.c */ |
61 | 61 | }; |
net/llc/llc_core.c
... | ... | @@ -147,12 +147,12 @@ |
147 | 147 | kfree(sap); |
148 | 148 | } |
149 | 149 | |
150 | -static struct packet_type llc_packet_type = { | |
150 | +static struct packet_type llc_packet_type __read_mostly = { | |
151 | 151 | .type = cpu_to_be16(ETH_P_802_2), |
152 | 152 | .func = llc_rcv, |
153 | 153 | }; |
154 | 154 | |
155 | -static struct packet_type llc_tr_packet_type = { | |
155 | +static struct packet_type llc_tr_packet_type __read_mostly = { | |
156 | 156 | .type = cpu_to_be16(ETH_P_TR_802_2), |
157 | 157 | .func = llc_rcv, |
158 | 158 | }; |
net/phonet/af_phonet.c
... | ... | @@ -382,9 +382,8 @@ |
382 | 382 | return NET_RX_DROP; |
383 | 383 | } |
384 | 384 | |
385 | -static struct packet_type phonet_packet_type = { | |
385 | +static struct packet_type phonet_packet_type __read_mostly = { | |
386 | 386 | .type = cpu_to_be16(ETH_P_PHONET), |
387 | - .dev = NULL, | |
388 | 387 | .func = phonet_rcv, |
389 | 388 | }; |
390 | 389 |
net/x25/af_x25.c
... | ... | @@ -1608,7 +1608,7 @@ |
1608 | 1608 | |
1609 | 1609 | SOCKOPS_WRAP(x25_proto, AF_X25); |
1610 | 1610 | |
1611 | -static struct packet_type x25_packet_type = { | |
1611 | +static struct packet_type x25_packet_type __read_mostly = { | |
1612 | 1612 | .type = cpu_to_be16(ETH_P_X25), |
1613 | 1613 | .func = x25_lapb_receive_frame, |
1614 | 1614 | }; |