diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-06-07 01:11:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-07 17:39:05 -0400 |
commit | 28850dc7c71da9d0c0e39246e9ff6913f41f8d0a (patch) | |
tree | 1ff43aef62041c487d4175af44e73da90bb70ce9 /net/ipv4/af_inet.c | |
parent | 5ee98591577aa63dbb9e78a0d142abc86b9063d0 (diff) |
net: tcp: move GRO/GSO functions to tcp_offload
Would be good to make things explicit and move those functions to
a new file called tcp_offload.c, thus make this similar to tcpv6_offload.c.
While moving all related functions into tcp_offload.c, we can also
make some of them static, since they are only used there. Also, add
an explicit registration function.
Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.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 | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 9c090c7daea1..7b514290efc6 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1559,15 +1559,6 @@ static const struct net_protocol tcp_protocol = { | |||
1559 | .netns_ok = 1, | 1559 | .netns_ok = 1, |
1560 | }; | 1560 | }; |
1561 | 1561 | ||
1562 | static const struct net_offload tcp_offload = { | ||
1563 | .callbacks = { | ||
1564 | .gso_send_check = tcp_v4_gso_send_check, | ||
1565 | .gso_segment = tcp_tso_segment, | ||
1566 | .gro_receive = tcp4_gro_receive, | ||
1567 | .gro_complete = tcp4_gro_complete, | ||
1568 | }, | ||
1569 | }; | ||
1570 | |||
1571 | static const struct net_protocol udp_protocol = { | 1562 | static const struct net_protocol udp_protocol = { |
1572 | .handler = udp_rcv, | 1563 | .handler = udp_rcv, |
1573 | .err_handler = udp_err, | 1564 | .err_handler = udp_err, |
@@ -1683,8 +1674,8 @@ static int __init ipv4_offload_init(void) | |||
1683 | */ | 1674 | */ |
1684 | if (inet_add_offload(&udp_offload, IPPROTO_UDP) < 0) | 1675 | if (inet_add_offload(&udp_offload, IPPROTO_UDP) < 0) |
1685 | pr_crit("%s: Cannot add UDP protocol offload\n", __func__); | 1676 | pr_crit("%s: Cannot add UDP protocol offload\n", __func__); |
1686 | if (inet_add_offload(&tcp_offload, IPPROTO_TCP) < 0) | 1677 | if (tcpv4_offload_init() < 0) |
1687 | pr_crit("%s: Cannot add TCP protocol offlaod\n", __func__); | 1678 | pr_crit("%s: Cannot add TCP protocol offload\n", __func__); |
1688 | 1679 | ||
1689 | dev_add_offload(&ip_packet_offload); | 1680 | dev_add_offload(&ip_packet_offload); |
1690 | return 0; | 1681 | return 0; |