]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
net: convert usage of packet_type to read_mostly
authorStephen Hemminger <shemminger@vyatta.com>
Mon, 9 Mar 2009 08:18:29 +0000 (08:18 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 Mar 2009 12:22:43 +0000 (05:22 -0700)
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>
21 files changed:
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

index c6099ba9a4b895ebabb5905255fd5a3f589145a8..ce0d62cd71b265de46e12447b3a665b10c479131 100644 (file)
@@ -151,7 +151,7 @@ exit:
        return 0;
 }
 
-static struct packet_type aoe_pt = {
+static struct packet_type aoe_pt __read_mostly = {
        .type = __constant_htons(ETH_P_AOE),
        .func = aoenet_rcv,
 };
index 44b183b58f50282dc226eb8641690dd649e72b5c..d509b371a562165bc22cfd086fae186b7130ef2b 100644 (file)
@@ -97,7 +97,7 @@ static char bpq_eth_addr[6];
 static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
 static int bpq_device_event(struct notifier_block *, unsigned long, void *);
 
-static struct packet_type bpq_packet_type = {
+static struct packet_type bpq_packet_type __read_mostly = {
        .type   = cpu_to_be16(ETH_P_BPQ),
        .func   = bpq_rcv,
 };
index e2968f0844394d9674540332885cc2edfd3a687d..f0031f1f97e5e1b7bd52d825021fa3783c93885a 100644 (file)
@@ -513,17 +513,17 @@ out:
        return NET_RX_SUCCESS; /* Lies... :-) */
 }
 
-static struct packet_type pppoes_ptype = {
+static struct packet_type pppoes_ptype __read_mostly = {
        .type   = cpu_to_be16(ETH_P_PPP_SES),
        .func   = pppoe_rcv,
 };
 
-static struct packet_type pppoed_ptype = {
+static struct packet_type pppoed_ptype __read_mostly = {
        .type   = cpu_to_be16(ETH_P_PPP_DISC),
        .func   = pppoe_disc_rcv,
 };
 
-static struct proto pppoe_sk_proto = {
+static struct proto pppoe_sk_proto __read_mostly = {
        .name     = "PPPOE",
        .owner    = THIS_MODULE,
        .obj_size = sizeof(struct pppox_sock),
index 5ce4372055582bcb652a3aaa14562470bbf2c6c1..7596eae1b35cbb424fbb382214179fb519086369 100644 (file)
@@ -348,7 +348,7 @@ EXPORT_SYMBOL(unregister_hdlc_protocol);
 EXPORT_SYMBOL(attach_hdlc_protocol);
 EXPORT_SYMBOL(detach_hdlc_protocol);
 
-static struct packet_type hdlc_packet_type = {
+static struct packet_type hdlc_packet_type __read_mostly = {
        .type = cpu_to_be16(ETH_P_HDLC),
        .func = hdlc_rcv,
 };
index 96d9eda4089401ae4a21acff74fc9a0e56ec1dd3..f85ca1b27f9a9bb6bc2a81ab9ee6c91cfad5224c 100644 (file)
@@ -421,7 +421,7 @@ static int lapbeth_device_event(struct notifier_block *this,
 
 /* ------------------------------------------------------------------------ */
 
-static struct packet_type lapbeth_packet_type = {
+static struct packet_type lapbeth_packet_type __read_mostly = {
        .type = cpu_to_be16(ETH_P_DEC),
        .func = lapbeth_rcv,
 };
index 4163ea65bf4152c40d29f978f4e75f7fbe6e10dc..2b7390e377b3f3a7d6a9e92fb2cbea73d8b6d401 100644 (file)
@@ -51,7 +51,7 @@ const char vlan_version[] = DRV_VERSION;
 static const char vlan_copyright[] = "Ben Greear <greearb@candelatech.com>";
 static const char vlan_buggyright[] = "David S. Miller <davem@redhat.com>";
 
-static struct packet_type vlan_packet_type = {
+static struct packet_type vlan_packet_type __read_mostly = {
        .type = cpu_to_be16(ETH_P_8021Q),
        .func = vlan_skb_recv, /* VLAN receive method */
 };
index cf05c43cba52cf31f660b9353cb5228c603ad817..3e0671df3a3f4e0acca576ac223fd5983c8cd63c 100644 (file)
@@ -1860,12 +1860,12 @@ static struct notifier_block ddp_notifier = {
        .notifier_call  = ddp_device_event,
 };
 
-static struct packet_type ltalk_packet_type = {
+static struct packet_type ltalk_packet_type __read_mostly = {
        .type           = cpu_to_be16(ETH_P_LOCALTALK),
        .func           = ltalk_rcv,
 };
 
-static struct packet_type ppptalk_packet_type = {
+static struct packet_type ppptalk_packet_type __read_mostly = {
        .type           = cpu_to_be16(ETH_P_PPPTALK),
        .func           = atalk_rcv,
 };
index d127fd3ba5c6acd8a7c3ce0f6b4ea5ee8b25f47b..8f8f63ff65661150410a9020dd555dd7d59cdbc3 100644 (file)
@@ -1985,9 +1985,8 @@ static const struct proto_ops ax25_proto_ops = {
 /*
  *     Called by socket.c on kernel start up
  */
-static struct packet_type ax25_packet_type = {
+static struct packet_type ax25_packet_type __read_mostly = {
        .type   =       cpu_to_be16(ETH_P_AX25),
-       .dev    =       NULL,                           /* All devices */
        .func   =       ax25_kiss_rcv,
 };
 
index ec233b64f853a2dbc5c201ec3b0ea0e6a3032d07..9647d911f916c792a3c0e7c4a6b01f2715fd2aa7 100644 (file)
@@ -2112,9 +2112,8 @@ static struct notifier_block dn_dev_notifier = {
 
 extern int dn_route_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
 
-static struct packet_type dn_dix_packet_type = {
+static struct packet_type dn_dix_packet_type __read_mostly = {
        .type =         cpu_to_be16(ETH_P_DNA_RT),
-       .dev =          NULL,           /* All devices */
        .func =         dn_route_rcv,
 };
 
index 63e532a69fdb1186077d0cc6dd658f276ec59565..0b8a91ddff44d82fbac9c7b9a5996b5aaf9b1750 100644 (file)
@@ -175,7 +175,7 @@ out:
        return 0;
 }
 
-static struct packet_type dsa_packet_type = {
+static struct packet_type dsa_packet_type __read_mostly = {
        .type   = cpu_to_be16(ETH_P_DSA),
        .func   = dsa_rcv,
 };
index 6197f9a7ef421f7eec701f8a61defdbb11bcbbdb..16fcb6d196d431f1ab044c887135af3c7af67e7e 100644 (file)
@@ -194,7 +194,7 @@ out:
        return 0;
 }
 
-static struct packet_type edsa_packet_type = {
+static struct packet_type edsa_packet_type __read_mostly = {
        .type   = cpu_to_be16(ETH_P_EDSA),
        .func   = edsa_rcv,
 };
index d7e7f424ff0c4a09c6bccb8cdff5fbbe556e687e..a6d959da678478eda1d888e66b1bf05e258dbc04 100644 (file)
@@ -111,7 +111,7 @@ out:
        return 0;
 }
 
-static struct packet_type trailer_packet_type = {
+static struct packet_type trailer_packet_type __read_mostly = {
        .type   = cpu_to_be16(ETH_P_TRAILER),
        .func   = trailer_rcv,
 };
index 7bf35582f65643f97e959b290a77bc66f2b88538..6f479fa522c30c3651dfab020d10d2b6a501efc5 100644 (file)
@@ -1102,7 +1102,7 @@ drop:
        return NET_RX_DROP;
 }
 
-static struct packet_type econet_packet_type = {
+static struct packet_type econet_packet_type __read_mostly = {
        .type =         cpu_to_be16(ETH_P_ECONET),
        .func =         econet_rcv,
 };
index 627be4dc7fb08e2919c9367e42db7f8c2ea6dae4..d5aaabbb7cb381054df71725d0ca2edc1a8289ff 100644 (file)
@@ -1500,7 +1500,7 @@ static int ipv4_proc_init(void);
  *     IP protocol layer initialiser
  */
 
-static struct packet_type ip_packet_type = {
+static struct packet_type ip_packet_type __read_mostly = {
        .type = cpu_to_be16(ETH_P_IP),
        .func = ip_rcv,
        .gso_send_check = inet_gso_send_check,
index 3f6b7354699bb8fe8df7cb47a1ced87e9816cf06..3d67d1ffed7715f2a90aaf50307bab8a9f078b1c 100644 (file)
@@ -1225,7 +1225,7 @@ void arp_ifdown(struct net_device *dev)
  *     Called once on startup.
  */
 
-static struct packet_type arp_packet_type = {
+static struct packet_type arp_packet_type __read_mostly = {
        .type = cpu_to_be16(ETH_P_ARP),
        .func = arp_rcv,
 };
index 57b07da1212a235762c8cab811707dab42f94efe..3e2ddfaee81a5b1cd2b5f133db31bce0d43528c2 100644 (file)
@@ -893,7 +893,7 @@ out_unlock:
        return err;
 }
 
-static struct packet_type ipv6_packet_type = {
+static struct packet_type ipv6_packet_type __read_mostly = {
        .type = cpu_to_be16(ETH_P_IPV6),
        .func = ipv6_rcv,
        .gso_send_check = ipv6_gso_send_check,
index 43d0ffc6d5655ab2e5b18d77c249e21a2b33e28e..30bd322b7985c143137b481cbf53fdf85e3471ae 100644 (file)
@@ -1958,12 +1958,12 @@ static const struct proto_ops SOCKOPS_WRAPPED(ipx_dgram_ops) = {
 
 SOCKOPS_WRAP(ipx_dgram, PF_IPX);
 
-static struct packet_type ipx_8023_packet_type = {
+static struct packet_type ipx_8023_packet_type __read_mostly = {
        .type           = cpu_to_be16(ETH_P_802_3),
        .func           = ipx_rcv,
 };
 
-static struct packet_type ipx_dix_packet_type = {
+static struct packet_type ipx_dix_packet_type __read_mostly = {
        .type           = cpu_to_be16(ETH_P_IPX),
        .func           = ipx_rcv,
 };
index 1bb607f2f5c7715222ed3f3f0108fca3391bff80..303a68d92731085226366bbd72579ea4c7d97027 100644 (file)
@@ -55,7 +55,7 @@ EXPORT_SYMBOL(irda_debug);
 /* Packet type handler.
  * Tell the kernel how IrDA packets should be handled.
  */
-static struct packet_type irda_packet_type = {
+static struct packet_type irda_packet_type __read_mostly = {
        .type   = cpu_to_be16(ETH_P_IRDA),
        .func   = irlap_driver_rcv,     /* Packet type handler irlap_frame.c */
 };
index a7fe1adc378d68834a70f44739c98f927659d927..ff4c0ab96a69364eaca829618dcf9a66d7c5022e 100644 (file)
@@ -147,12 +147,12 @@ void llc_sap_close(struct llc_sap *sap)
        kfree(sap);
 }
 
-static struct packet_type llc_packet_type = {
+static struct packet_type llc_packet_type __read_mostly = {
        .type = cpu_to_be16(ETH_P_802_2),
        .func = llc_rcv,
 };
 
-static struct packet_type llc_tr_packet_type = {
+static struct packet_type llc_tr_packet_type __read_mostly = {
        .type = cpu_to_be16(ETH_P_TR_802_2),
        .func = llc_rcv,
 };
index 81795ea87794af8b10540451313c5969e0beb4d7..a662e62a99cfa0adcf7589aa457a19bfeb21b48a 100644 (file)
@@ -382,9 +382,8 @@ out:
        return NET_RX_DROP;
 }
 
-static struct packet_type phonet_packet_type = {
+static struct packet_type phonet_packet_type __read_mostly = {
        .type = cpu_to_be16(ETH_P_PHONET),
-       .dev = NULL,
        .func = phonet_rcv,
 };
 
index 8f76f4009c24d3c2c1d596afea65f36317c7d335..1000e9a26fdb5355f0f89f53a65245dd9e6cd548 100644 (file)
@@ -1608,7 +1608,7 @@ static const struct proto_ops SOCKOPS_WRAPPED(x25_proto_ops) = {
 
 SOCKOPS_WRAP(x25_proto, AF_X25);
 
-static struct packet_type x25_packet_type = {
+static struct packet_type x25_packet_type __read_mostly = {
        .type = cpu_to_be16(ETH_P_X25),
        .func = x25_lapb_receive_frame,
 };