提交 808a8f88 编写于 作者: V Vlad Yasevich 提交者: David S. Miller

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: NVlad Yasevich <vyasevic@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3c73a036
...@@ -1665,11 +1665,6 @@ static int ipv4_proc_init(void); ...@@ -1665,11 +1665,6 @@ static int ipv4_proc_init(void);
* IP protocol layer initialiser * IP protocol layer initialiser
*/ */
static struct packet_type ip_packet_type __read_mostly = {
.type = cpu_to_be16(ETH_P_IP),
.func = ip_rcv,
};
static struct packet_offload ip_packet_offload __read_mostly = { static struct packet_offload ip_packet_offload __read_mostly = {
.type = cpu_to_be16(ETH_P_IP), .type = cpu_to_be16(ETH_P_IP),
.gso_send_check = inet_gso_send_check, .gso_send_check = inet_gso_send_check,
...@@ -1678,6 +1673,27 @@ static struct packet_offload ip_packet_offload __read_mostly = { ...@@ -1678,6 +1673,27 @@ static struct packet_offload ip_packet_offload __read_mostly = {
.gro_complete = inet_gro_complete, .gro_complete = inet_gro_complete,
}; };
static int __init ipv4_offload_init(void)
{
/*
* Add offloads
*/
if (inet_add_offload(&udp_offload, IPPROTO_UDP) < 0)
pr_crit("%s: Cannot add UDP protocol offload\n", __func__);
if (inet_add_offload(&tcp_offload, IPPROTO_TCP) < 0)
pr_crit("%s: Cannot add TCP protocol offlaod\n", __func__);
dev_add_offload(&ip_packet_offload);
return 0;
}
fs_initcall(ipv4_offload_init);
static struct packet_type ip_packet_type __read_mostly = {
.type = cpu_to_be16(ETH_P_IP),
.func = ip_rcv,
};
static int __init inet_init(void) static int __init inet_init(void)
{ {
struct sk_buff *dummy_skb; struct sk_buff *dummy_skb;
...@@ -1719,14 +1735,6 @@ static int __init inet_init(void) ...@@ -1719,14 +1735,6 @@ static int __init inet_init(void)
tcp_prot.sysctl_mem = init_net.ipv4.sysctl_tcp_mem; tcp_prot.sysctl_mem = init_net.ipv4.sysctl_tcp_mem;
/*
* Add offloads
*/
if (inet_add_offload(&udp_offload, IPPROTO_UDP) < 0)
pr_crit("%s: Cannot add UDP protocol offload\n", __func__);
if (inet_add_offload(&tcp_offload, IPPROTO_TCP) < 0)
pr_crit("%s: Cannot add TCP protocol offlaod\n", __func__);
/* /*
* Add all the base protocols. * Add all the base protocols.
*/ */
...@@ -1799,7 +1807,6 @@ static int __init inet_init(void) ...@@ -1799,7 +1807,6 @@ static int __init inet_init(void)
ipfrag_init(); ipfrag_init();
dev_add_offload(&ip_packet_offload);
dev_add_pack(&ip_packet_type); dev_add_pack(&ip_packet_type);
rc = 0; rc = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册