summaryrefslogtreecommitdiffstats
path: root/net/ipv6/exthdrs.c
diff options
context:
space:
mode:
authorVlad Yasevich <vyasevic@redhat.com>2012-11-15 03:49:15 -0500
committerDavid S. Miller <davem@davemloft.net>2012-11-15 17:36:17 -0500
commit3336288a9feaa809839adbaf05778dc2f16665dc (patch)
treef536f807902ea4268cc211054a1b234776f5f858 /net/ipv6/exthdrs.c
parentbca49f843eac59cbb1ddd1f4a5d65fcc23b62efd (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.c38
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
552static 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
564out:
565 return ret;
566
567out_rt:
568 inet_del_offload(&rthdr_offload, IPPROTO_ROUTING);
569 goto out;
570}
571
572static 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
552int __init ipv6_exthdrs_init(void) 578int __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
568out: 598out:
569 return ret; 599 return ret;
570out_rthdr:
571 inet6_del_protocol(&rthdr_protocol, IPPROTO_ROUTING);
572out_destopt: 600out_destopt:
573 inet6_del_protocol(&destopt_protocol, IPPROTO_DSTOPTS); 601 inet6_del_protocol(&destopt_protocol, IPPROTO_DSTOPTS);
602out_rthdr:
603 inet6_del_protocol(&rthdr_protocol, IPPROTO_ROUTING);
604out_offload:
605 ipv6_exthdrs_offload_exit();
574 goto out; 606 goto out;
575}; 607};
576 608