diff options
author | Vlad Yasevich <vyasevic@redhat.com> | 2012-11-15 03:49:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-15 17:36:17 -0500 |
commit | 3336288a9feaa809839adbaf05778dc2f16665dc (patch) | |
tree | f536f807902ea4268cc211054a1b234776f5f858 /net/ipv6/exthdrs.c | |
parent | bca49f843eac59cbb1ddd1f4a5d65fcc23b62efd (diff) |
ipv6: Switch to using new offload infrastructure.
Switch IPv6 protocol to using the new GRO/GSO calls and data.
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/exthdrs.c')
-rw-r--r-- | net/ipv6/exthdrs.c | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index cb6f0828ca44..de6559e3aa0a 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c | |||
@@ -549,14 +549,44 @@ static const struct inet6_protocol nodata_protocol = { | |||
549 | .flags = INET6_PROTO_NOPOLICY, | 549 | .flags = INET6_PROTO_NOPOLICY, |
550 | }; | 550 | }; |
551 | 551 | ||
552 | static int ipv6_exthdrs_offload_init(void) | ||
553 | { | ||
554 | int ret; | ||
555 | |||
556 | ret = inet6_add_offload(&rthdr_offload, IPPROTO_ROUTING); | ||
557 | if (!ret) | ||
558 | goto out; | ||
559 | |||
560 | ret = inet6_add_offload(&dstopt_offload, IPPROTO_DSTOPTS); | ||
561 | if (!ret) | ||
562 | goto out_rt; | ||
563 | |||
564 | out: | ||
565 | return ret; | ||
566 | |||
567 | out_rt: | ||
568 | inet_del_offload(&rthdr_offload, IPPROTO_ROUTING); | ||
569 | goto out; | ||
570 | } | ||
571 | |||
572 | static void ipv6_exthdrs_offload_exit(void) | ||
573 | { | ||
574 | inet_del_offload(&rthdr_offload, IPPROTO_ROUTING); | ||
575 | inet_del_offload(&rthdr_offload, IPPROTO_DSTOPTS); | ||
576 | } | ||
577 | |||
552 | int __init ipv6_exthdrs_init(void) | 578 | int __init ipv6_exthdrs_init(void) |
553 | { | 579 | { |
554 | int ret; | 580 | int ret; |
555 | 581 | ||
556 | ret = inet6_add_protocol(&rthdr_protocol, IPPROTO_ROUTING); | 582 | ret = ipv6_exthdrs_offload_init(); |
557 | if (ret) | 583 | if (ret) |
558 | goto out; | 584 | goto out; |
559 | 585 | ||
586 | ret = inet6_add_protocol(&rthdr_protocol, IPPROTO_ROUTING); | ||
587 | if (ret) | ||
588 | goto out_offload; | ||
589 | |||
560 | ret = inet6_add_protocol(&destopt_protocol, IPPROTO_DSTOPTS); | 590 | ret = inet6_add_protocol(&destopt_protocol, IPPROTO_DSTOPTS); |
561 | if (ret) | 591 | if (ret) |
562 | goto out_rthdr; | 592 | goto out_rthdr; |
@@ -567,10 +597,12 @@ int __init ipv6_exthdrs_init(void) | |||
567 | 597 | ||
568 | out: | 598 | out: |
569 | return ret; | 599 | return ret; |
570 | out_rthdr: | ||
571 | inet6_del_protocol(&rthdr_protocol, IPPROTO_ROUTING); | ||
572 | out_destopt: | 600 | out_destopt: |
573 | inet6_del_protocol(&destopt_protocol, IPPROTO_DSTOPTS); | 601 | inet6_del_protocol(&destopt_protocol, IPPROTO_DSTOPTS); |
602 | out_rthdr: | ||
603 | inet6_del_protocol(&rthdr_protocol, IPPROTO_ROUTING); | ||
604 | out_offload: | ||
605 | ipv6_exthdrs_offload_exit(); | ||
574 | goto out; | 606 | goto out; |
575 | }; | 607 | }; |
576 | 608 | ||