diff options
author | Vlad Yasevich <vyasevic@redhat.com> | 2012-11-15 03:49:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-15 17:39:23 -0500 |
commit | 808a8f884554f93315f663b2694addb4a177c578 (patch) | |
tree | c07a0f42320db2d39b33cfd071c9f0f255253cb7 /net/ipv4/af_inet.c | |
parent | 3c73a0368e995f047c14388a05dcfba599053bef (diff) |
ipv4: Pull GSO registration out of inet_init()
Since GSO/GRO support is now separated, make IPv4 GSO a
stand-alone init call and not part of inet_init().
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 66f63ce07ac8..9f2e7fd8bea8 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1665,11 +1665,6 @@ static int ipv4_proc_init(void); | |||
1665 | * IP protocol layer initialiser | 1665 | * IP protocol layer initialiser |
1666 | */ | 1666 | */ |
1667 | 1667 | ||
1668 | static struct packet_type ip_packet_type __read_mostly = { | ||
1669 | .type = cpu_to_be16(ETH_P_IP), | ||
1670 | .func = ip_rcv, | ||
1671 | }; | ||
1672 | |||
1673 | static struct packet_offload ip_packet_offload __read_mostly = { | 1668 | static struct packet_offload ip_packet_offload __read_mostly = { |
1674 | .type = cpu_to_be16(ETH_P_IP), | 1669 | .type = cpu_to_be16(ETH_P_IP), |
1675 | .gso_send_check = inet_gso_send_check, | 1670 | .gso_send_check = inet_gso_send_check, |
@@ -1678,6 +1673,27 @@ static struct packet_offload ip_packet_offload __read_mostly = { | |||
1678 | .gro_complete = inet_gro_complete, | 1673 | .gro_complete = inet_gro_complete, |
1679 | }; | 1674 | }; |
1680 | 1675 | ||
1676 | static int __init ipv4_offload_init(void) | ||
1677 | { | ||
1678 | /* | ||
1679 | * Add offloads | ||
1680 | */ | ||
1681 | if (inet_add_offload(&udp_offload, IPPROTO_UDP) < 0) | ||
1682 | pr_crit("%s: Cannot add UDP protocol offload\n", __func__); | ||
1683 | if (inet_add_offload(&tcp_offload, IPPROTO_TCP) < 0) | ||
1684 | pr_crit("%s: Cannot add TCP protocol offlaod\n", __func__); | ||
1685 | |||
1686 | dev_add_offload(&ip_packet_offload); | ||
1687 | return 0; | ||
1688 | } | ||
1689 | |||
1690 | fs_initcall(ipv4_offload_init); | ||
1691 | |||
1692 | static struct packet_type ip_packet_type __read_mostly = { | ||
1693 | .type = cpu_to_be16(ETH_P_IP), | ||
1694 | .func = ip_rcv, | ||
1695 | }; | ||
1696 | |||
1681 | static int __init inet_init(void) | 1697 | static int __init inet_init(void) |
1682 | { | 1698 | { |
1683 | struct sk_buff *dummy_skb; | 1699 | struct sk_buff *dummy_skb; |
@@ -1720,14 +1736,6 @@ static int __init inet_init(void) | |||
1720 | tcp_prot.sysctl_mem = init_net.ipv4.sysctl_tcp_mem; | 1736 | tcp_prot.sysctl_mem = init_net.ipv4.sysctl_tcp_mem; |
1721 | 1737 | ||
1722 | /* | 1738 | /* |
1723 | * Add offloads | ||
1724 | */ | ||
1725 | if (inet_add_offload(&udp_offload, IPPROTO_UDP) < 0) | ||
1726 | pr_crit("%s: Cannot add UDP protocol offload\n", __func__); | ||
1727 | if (inet_add_offload(&tcp_offload, IPPROTO_TCP) < 0) | ||
1728 | pr_crit("%s: Cannot add TCP protocol offlaod\n", __func__); | ||
1729 | |||
1730 | /* | ||
1731 | * Add all the base protocols. | 1739 | * Add all the base protocols. |
1732 | */ | 1740 | */ |
1733 | 1741 | ||
@@ -1799,7 +1807,6 @@ static int __init inet_init(void) | |||
1799 | 1807 | ||
1800 | ipfrag_init(); | 1808 | ipfrag_init(); |
1801 | 1809 | ||
1802 | dev_add_offload(&ip_packet_offload); | ||
1803 | dev_add_pack(&ip_packet_type); | 1810 | dev_add_pack(&ip_packet_type); |
1804 | 1811 | ||
1805 | rc = 0; | 1812 | rc = 0; |