diff options
| author | Stephen Hemminger <shemminger@vyatta.com> | 2009-03-09 04:18:29 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2009-03-10 08:22:43 -0400 |
| commit | 7546dd97d27306d939c13e03318aae695badaa88 (patch) | |
| tree | ced310466fd679ceae4e676ae8c31fd78b7bd72f | |
| parent | 3f612132c7164d5cc9ed677a2fdf8950222d2170 (diff) | |
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>
| -rw-r--r-- | drivers/block/aoe/aoenet.c | 2 | ||||
| -rw-r--r-- | drivers/net/hamradio/bpqether.c | 2 | ||||
| -rw-r--r-- | drivers/net/pppoe.c | 6 | ||||
| -rw-r--r-- | drivers/net/wan/hdlc.c | 2 | ||||
| -rw-r--r-- | drivers/net/wan/lapbether.c | 2 | ||||
| -rw-r--r-- | net/8021q/vlan.c | 2 | ||||
| -rw-r--r-- | net/appletalk/ddp.c | 4 | ||||
| -rw-r--r-- | net/ax25/af_ax25.c | 3 | ||||
| -rw-r--r-- | net/decnet/af_decnet.c | 3 | ||||
| -rw-r--r-- | net/dsa/tag_dsa.c | 2 | ||||
| -rw-r--r-- | net/dsa/tag_edsa.c | 2 | ||||
| -rw-r--r-- | net/dsa/tag_trailer.c | 2 | ||||
| -rw-r--r-- | net/econet/af_econet.c | 2 | ||||
| -rw-r--r-- | net/ipv4/af_inet.c | 2 | ||||
| -rw-r--r-- | net/ipv4/arp.c | 2 | ||||
| -rw-r--r-- | net/ipv6/af_inet6.c | 2 | ||||
| -rw-r--r-- | net/ipx/af_ipx.c | 4 | ||||
| -rw-r--r-- | net/irda/irmod.c | 2 | ||||
| -rw-r--r-- | net/llc/llc_core.c | 4 | ||||
| -rw-r--r-- | net/phonet/af_phonet.c | 3 | ||||
| -rw-r--r-- | net/x25/af_x25.c | 2 |
21 files changed, 26 insertions, 29 deletions
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c index c6099ba9a4b8..ce0d62cd71b2 100644 --- a/drivers/block/aoe/aoenet.c +++ b/drivers/block/aoe/aoenet.c | |||
| @@ -151,7 +151,7 @@ exit: | |||
| 151 | return 0; | 151 | return 0; |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | static struct packet_type aoe_pt = { | 154 | static struct packet_type aoe_pt __read_mostly = { |
| 155 | .type = __constant_htons(ETH_P_AOE), | 155 | .type = __constant_htons(ETH_P_AOE), |
| 156 | .func = aoenet_rcv, | 156 | .func = aoenet_rcv, |
| 157 | }; | 157 | }; |
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index 44b183b58f50..d509b371a562 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
| @@ -97,7 +97,7 @@ static char bpq_eth_addr[6]; | |||
| 97 | static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); | 97 | static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); |
| 98 | static int bpq_device_event(struct notifier_block *, unsigned long, void *); | 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 | .type = cpu_to_be16(ETH_P_BPQ), | 101 | .type = cpu_to_be16(ETH_P_BPQ), |
| 102 | .func = bpq_rcv, | 102 | .func = bpq_rcv, |
| 103 | }; | 103 | }; |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index e2968f084439..f0031f1f97e5 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
| @@ -513,17 +513,17 @@ out: | |||
| 513 | return NET_RX_SUCCESS; /* Lies... :-) */ | 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 | .type = cpu_to_be16(ETH_P_PPP_SES), | 517 | .type = cpu_to_be16(ETH_P_PPP_SES), |
| 518 | .func = pppoe_rcv, | 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 | .type = cpu_to_be16(ETH_P_PPP_DISC), | 522 | .type = cpu_to_be16(ETH_P_PPP_DISC), |
| 523 | .func = pppoe_disc_rcv, | 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 | .name = "PPPOE", | 527 | .name = "PPPOE", |
| 528 | .owner = THIS_MODULE, | 528 | .owner = THIS_MODULE, |
| 529 | .obj_size = sizeof(struct pppox_sock), | 529 | .obj_size = sizeof(struct pppox_sock), |
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c index 5ce437205558..7596eae1b35c 100644 --- a/drivers/net/wan/hdlc.c +++ b/drivers/net/wan/hdlc.c | |||
| @@ -348,7 +348,7 @@ EXPORT_SYMBOL(unregister_hdlc_protocol); | |||
| 348 | EXPORT_SYMBOL(attach_hdlc_protocol); | 348 | EXPORT_SYMBOL(attach_hdlc_protocol); |
| 349 | EXPORT_SYMBOL(detach_hdlc_protocol); | 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 | .type = cpu_to_be16(ETH_P_HDLC), | 352 | .type = cpu_to_be16(ETH_P_HDLC), |
| 353 | .func = hdlc_rcv, | 353 | .func = hdlc_rcv, |
| 354 | }; | 354 | }; |
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 96d9eda40894..f85ca1b27f9a 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c | |||
| @@ -421,7 +421,7 @@ static int lapbeth_device_event(struct notifier_block *this, | |||
| 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 | .type = cpu_to_be16(ETH_P_DEC), | 425 | .type = cpu_to_be16(ETH_P_DEC), |
| 426 | .func = lapbeth_rcv, | 426 | .func = lapbeth_rcv, |
| 427 | }; | 427 | }; |
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 4163ea65bf41..2b7390e377b3 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
| @@ -51,7 +51,7 @@ const char vlan_version[] = DRV_VERSION; | |||
| 51 | static const char vlan_copyright[] = "Ben Greear <greearb@candelatech.com>"; | 51 | static const char vlan_copyright[] = "Ben Greear <greearb@candelatech.com>"; |
| 52 | static const char vlan_buggyright[] = "David S. Miller <davem@redhat.com>"; | 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 | .type = cpu_to_be16(ETH_P_8021Q), | 55 | .type = cpu_to_be16(ETH_P_8021Q), |
| 56 | .func = vlan_skb_recv, /* VLAN receive method */ | 56 | .func = vlan_skb_recv, /* VLAN receive method */ |
| 57 | }; | 57 | }; |
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index cf05c43cba52..3e0671df3a3f 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c | |||
| @@ -1860,12 +1860,12 @@ static struct notifier_block ddp_notifier = { | |||
| 1860 | .notifier_call = ddp_device_event, | 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 | .type = cpu_to_be16(ETH_P_LOCALTALK), | 1864 | .type = cpu_to_be16(ETH_P_LOCALTALK), |
| 1865 | .func = ltalk_rcv, | 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 | .type = cpu_to_be16(ETH_P_PPPTALK), | 1869 | .type = cpu_to_be16(ETH_P_PPPTALK), |
| 1870 | .func = atalk_rcv, | 1870 | .func = atalk_rcv, |
| 1871 | }; | 1871 | }; |
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index d127fd3ba5c6..8f8f63ff6566 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
| @@ -1985,9 +1985,8 @@ static const struct proto_ops ax25_proto_ops = { | |||
| 1985 | /* | 1985 | /* |
| 1986 | * Called by socket.c on kernel start up | 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 | .type = cpu_to_be16(ETH_P_AX25), | 1989 | .type = cpu_to_be16(ETH_P_AX25), |
| 1990 | .dev = NULL, /* All devices */ | ||
| 1991 | .func = ax25_kiss_rcv, | 1990 | .func = ax25_kiss_rcv, |
| 1992 | }; | 1991 | }; |
| 1993 | 1992 | ||
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index ec233b64f853..9647d911f916 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c | |||
| @@ -2112,9 +2112,8 @@ static struct notifier_block dn_dev_notifier = { | |||
| 2112 | 2112 | ||
| 2113 | extern int dn_route_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); | 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 | .type = cpu_to_be16(ETH_P_DNA_RT), | 2116 | .type = cpu_to_be16(ETH_P_DNA_RT), |
| 2117 | .dev = NULL, /* All devices */ | ||
| 2118 | .func = dn_route_rcv, | 2117 | .func = dn_route_rcv, |
| 2119 | }; | 2118 | }; |
| 2120 | 2119 | ||
diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c index 63e532a69fdb..0b8a91ddff44 100644 --- a/net/dsa/tag_dsa.c +++ b/net/dsa/tag_dsa.c | |||
| @@ -175,7 +175,7 @@ out: | |||
| 175 | return 0; | 175 | return 0; |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | static struct packet_type dsa_packet_type = { | 178 | static struct packet_type dsa_packet_type __read_mostly = { |
| 179 | .type = cpu_to_be16(ETH_P_DSA), | 179 | .type = cpu_to_be16(ETH_P_DSA), |
| 180 | .func = dsa_rcv, | 180 | .func = dsa_rcv, |
| 181 | }; | 181 | }; |
diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c index 6197f9a7ef42..16fcb6d196d4 100644 --- a/net/dsa/tag_edsa.c +++ b/net/dsa/tag_edsa.c | |||
| @@ -194,7 +194,7 @@ out: | |||
| 194 | return 0; | 194 | return 0; |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | static struct packet_type edsa_packet_type = { | 197 | static struct packet_type edsa_packet_type __read_mostly = { |
| 198 | .type = cpu_to_be16(ETH_P_EDSA), | 198 | .type = cpu_to_be16(ETH_P_EDSA), |
| 199 | .func = edsa_rcv, | 199 | .func = edsa_rcv, |
| 200 | }; | 200 | }; |
diff --git a/net/dsa/tag_trailer.c b/net/dsa/tag_trailer.c index d7e7f424ff0c..a6d959da6784 100644 --- a/net/dsa/tag_trailer.c +++ b/net/dsa/tag_trailer.c | |||
| @@ -111,7 +111,7 @@ out: | |||
| 111 | return 0; | 111 | return 0; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | static struct packet_type trailer_packet_type = { | 114 | static struct packet_type trailer_packet_type __read_mostly = { |
| 115 | .type = cpu_to_be16(ETH_P_TRAILER), | 115 | .type = cpu_to_be16(ETH_P_TRAILER), |
| 116 | .func = trailer_rcv, | 116 | .func = trailer_rcv, |
| 117 | }; | 117 | }; |
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index 7bf35582f656..6f479fa522c3 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c | |||
| @@ -1102,7 +1102,7 @@ drop: | |||
| 1102 | return NET_RX_DROP; | 1102 | return NET_RX_DROP; |
| 1103 | } | 1103 | } |
| 1104 | 1104 | ||
| 1105 | static struct packet_type econet_packet_type = { | 1105 | static struct packet_type econet_packet_type __read_mostly = { |
| 1106 | .type = cpu_to_be16(ETH_P_ECONET), | 1106 | .type = cpu_to_be16(ETH_P_ECONET), |
| 1107 | .func = econet_rcv, | 1107 | .func = econet_rcv, |
| 1108 | }; | 1108 | }; |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 627be4dc7fb0..d5aaabbb7cb3 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
| @@ -1500,7 +1500,7 @@ static int ipv4_proc_init(void); | |||
| 1500 | * IP protocol layer initialiser | 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 | .type = cpu_to_be16(ETH_P_IP), | 1504 | .type = cpu_to_be16(ETH_P_IP), |
| 1505 | .func = ip_rcv, | 1505 | .func = ip_rcv, |
| 1506 | .gso_send_check = inet_gso_send_check, | 1506 | .gso_send_check = inet_gso_send_check, |
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 3f6b7354699b..3d67d1ffed77 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
| @@ -1225,7 +1225,7 @@ void arp_ifdown(struct net_device *dev) | |||
| 1225 | * Called once on startup. | 1225 | * Called once on startup. |
| 1226 | */ | 1226 | */ |
| 1227 | 1227 | ||
| 1228 | static struct packet_type arp_packet_type = { | 1228 | static struct packet_type arp_packet_type __read_mostly = { |
| 1229 | .type = cpu_to_be16(ETH_P_ARP), | 1229 | .type = cpu_to_be16(ETH_P_ARP), |
| 1230 | .func = arp_rcv, | 1230 | .func = arp_rcv, |
| 1231 | }; | 1231 | }; |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 57b07da1212a..3e2ddfaee81a 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
| @@ -893,7 +893,7 @@ out_unlock: | |||
| 893 | return err; | 893 | return err; |
| 894 | } | 894 | } |
| 895 | 895 | ||
| 896 | static struct packet_type ipv6_packet_type = { | 896 | static struct packet_type ipv6_packet_type __read_mostly = { |
| 897 | .type = cpu_to_be16(ETH_P_IPV6), | 897 | .type = cpu_to_be16(ETH_P_IPV6), |
| 898 | .func = ipv6_rcv, | 898 | .func = ipv6_rcv, |
| 899 | .gso_send_check = ipv6_gso_send_check, | 899 | .gso_send_check = ipv6_gso_send_check, |
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index 43d0ffc6d565..30bd322b7985 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c | |||
| @@ -1958,12 +1958,12 @@ static const struct proto_ops SOCKOPS_WRAPPED(ipx_dgram_ops) = { | |||
| 1958 | 1958 | ||
| 1959 | SOCKOPS_WRAP(ipx_dgram, PF_IPX); | 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 | .type = cpu_to_be16(ETH_P_802_3), | 1962 | .type = cpu_to_be16(ETH_P_802_3), |
| 1963 | .func = ipx_rcv, | 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 | .type = cpu_to_be16(ETH_P_IPX), | 1967 | .type = cpu_to_be16(ETH_P_IPX), |
| 1968 | .func = ipx_rcv, | 1968 | .func = ipx_rcv, |
| 1969 | }; | 1969 | }; |
diff --git a/net/irda/irmod.c b/net/irda/irmod.c index 1bb607f2f5c7..303a68d92731 100644 --- a/net/irda/irmod.c +++ b/net/irda/irmod.c | |||
| @@ -55,7 +55,7 @@ EXPORT_SYMBOL(irda_debug); | |||
| 55 | /* Packet type handler. | 55 | /* Packet type handler. |
| 56 | * Tell the kernel how IrDA packets should be handled. | 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 | .type = cpu_to_be16(ETH_P_IRDA), | 59 | .type = cpu_to_be16(ETH_P_IRDA), |
| 60 | .func = irlap_driver_rcv, /* Packet type handler irlap_frame.c */ | 60 | .func = irlap_driver_rcv, /* Packet type handler irlap_frame.c */ |
| 61 | }; | 61 | }; |
diff --git a/net/llc/llc_core.c b/net/llc/llc_core.c index a7fe1adc378d..ff4c0ab96a69 100644 --- a/net/llc/llc_core.c +++ b/net/llc/llc_core.c | |||
| @@ -147,12 +147,12 @@ void llc_sap_close(struct llc_sap *sap) | |||
| 147 | kfree(sap); | 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 | .type = cpu_to_be16(ETH_P_802_2), | 151 | .type = cpu_to_be16(ETH_P_802_2), |
| 152 | .func = llc_rcv, | 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 | .type = cpu_to_be16(ETH_P_TR_802_2), | 156 | .type = cpu_to_be16(ETH_P_TR_802_2), |
| 157 | .func = llc_rcv, | 157 | .func = llc_rcv, |
| 158 | }; | 158 | }; |
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index 81795ea87794..a662e62a99cf 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c | |||
| @@ -382,9 +382,8 @@ out: | |||
| 382 | return NET_RX_DROP; | 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 | .type = cpu_to_be16(ETH_P_PHONET), | 386 | .type = cpu_to_be16(ETH_P_PHONET), |
| 387 | .dev = NULL, | ||
| 388 | .func = phonet_rcv, | 387 | .func = phonet_rcv, |
| 389 | }; | 388 | }; |
| 390 | 389 | ||
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 8f76f4009c24..1000e9a26fdb 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
| @@ -1608,7 +1608,7 @@ static const struct proto_ops SOCKOPS_WRAPPED(x25_proto_ops) = { | |||
| 1608 | 1608 | ||
| 1609 | SOCKOPS_WRAP(x25_proto, AF_X25); | 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 | .type = cpu_to_be16(ETH_P_X25), | 1612 | .type = cpu_to_be16(ETH_P_X25), |
| 1613 | .func = x25_lapb_receive_frame, | 1613 | .func = x25_lapb_receive_frame, |
| 1614 | }; | 1614 | }; |
