All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladislav Yasevich <vyasevich@gmail.com>
To: netdev@vger.kernel.org
Cc: virtio-dev@lists.oasis-open.org, marcelo.leitner@gmail.com,
	nhorman@tuxdriver.com, mst@redhat.com,
	virtualization@lists.linux-foundation.org,
	linux-sctp@vger.kernel.org
Subject: [PATCH V2 net-next 3/6] sctp: Build sctp offload support into the base kernel
Date: Tue,  1 May 2018 22:07:36 -0400	[thread overview]
Message-ID: <20180502020739.19239-4-vyasevic@redhat.com> (raw)
In-Reply-To: <20180502020739.19239-1-vyasevic@redhat.com>

With the SCTP checksum offload support added to virtio, it is
now possible to get into a situation where SCTP not present
in the kernel, but the feature is negotiated.  Handle this just
like we do IPv6 and other modular offloads.
Move the sctp offload out of the sctp module and into the base
kernel.

Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
 include/net/sctp/sctp.h | 5 -----
 net/Kconfig             | 1 +
 net/sctp/Kconfig        | 1 -
 net/sctp/Makefile       | 3 ++-
 net/sctp/offload.c      | 4 +++-
 net/sctp/protocol.c     | 3 ---
 6 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 72c5b8f..625b45f 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -183,11 +183,6 @@ struct sctp_transport *sctp_epaddr_lookup_transport(
 int __net_init sctp_proc_init(struct net *net);
 
 /*
- * sctp/offload.c
- */
-int sctp_offload_init(void);
-
-/*
  * sctp/stream_sched.c
  */
 void sctp_sched_ops_init(void);
diff --git a/net/Kconfig b/net/Kconfig
index 0428f12..2773f98 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -64,6 +64,7 @@ config INET
 	bool "TCP/IP networking"
 	select CRYPTO
 	select CRYPTO_AES
+	select LIBCRC32C
 	---help---
 	  These are the protocols used on the Internet and on most local
 	  Ethernets. It is highly recommended to say Y here (this will enlarge
diff --git a/net/sctp/Kconfig b/net/sctp/Kconfig
index c740b18..d07477a 100644
--- a/net/sctp/Kconfig
+++ b/net/sctp/Kconfig
@@ -9,7 +9,6 @@ menuconfig IP_SCTP
 	select CRYPTO
 	select CRYPTO_HMAC
 	select CRYPTO_SHA1
-	select LIBCRC32C
 	---help---
 	  Stream Control Transmission Protocol
 
diff --git a/net/sctp/Makefile b/net/sctp/Makefile
index e845e45..ee206ca 100644
--- a/net/sctp/Makefile
+++ b/net/sctp/Makefile
@@ -5,6 +5,7 @@
 
 obj-$(CONFIG_IP_SCTP) += sctp.o
 obj-$(CONFIG_INET_SCTP_DIAG) += sctp_diag.o
+obj-$(CONFIG_INET) += offload.o
 
 sctp-y := sm_statetable.o sm_statefuns.o sm_sideeffect.o \
 	  protocol.o endpointola.o associola.o \
@@ -12,7 +13,7 @@ sctp-y := sm_statetable.o sm_statefuns.o sm_sideeffect.o \
 	  inqueue.o outqueue.o ulpqueue.o \
 	  tsnmap.o bind_addr.o socket.o primitive.o \
 	  output.o input.o debug.o stream.o auth.o \
-	  offload.o stream_sched.o stream_sched_prio.o \
+	  stream_sched.o stream_sched_prio.o \
 	  stream_sched_rr.o stream_interleave.o
 
 sctp_diag-y := diag.o
diff --git a/net/sctp/offload.c b/net/sctp/offload.c
index 123e9f2..c61cbde 100644
--- a/net/sctp/offload.c
+++ b/net/sctp/offload.c
@@ -107,7 +107,7 @@ static const struct skb_checksum_ops crc32c_csum_ops = {
 	.combine = sctp_csum_combine,
 };
 
-int __init sctp_offload_init(void)
+static int __init sctp_offload_init(void)
 {
 	int ret;
 
@@ -127,3 +127,5 @@ int __init sctp_offload_init(void)
 out:
 	return ret;
 }
+
+fs_initcall(sctp_offload_init);
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index a24cde2..46d2b63 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1479,9 +1479,6 @@ static __init int sctp_init(void)
 	if (status)
 		goto err_v6_add_protocol;
 
-	if (sctp_offload_init() < 0)
-		pr_crit("%s: Cannot add SCTP protocol offload\n", __func__);
-
 out:
 	return status;
 err_v6_add_protocol:
-- 
2.9.5

WARNING: multiple messages have this Message-ID (diff)
From: Vladislav Yasevich <vyasevich@gmail.com>
To: netdev@vger.kernel.org
Cc: virtio-dev@lists.oasis-open.org, marcelo.leitner@gmail.com,
	nhorman@tuxdriver.com, mst@redhat.com,
	virtualization@lists.linux-foundation.org,
	linux-sctp@vger.kernel.org
Subject: [PATCH V2 net-next 3/6] sctp: Build sctp offload support into the base kernel
Date: Wed, 02 May 2018 02:07:36 +0000	[thread overview]
Message-ID: <20180502020739.19239-4-vyasevic@redhat.com> (raw)
In-Reply-To: <20180502020739.19239-1-vyasevic@redhat.com>

With the SCTP checksum offload support added to virtio, it is
now possible to get into a situation where SCTP not present
in the kernel, but the feature is negotiated.  Handle this just
like we do IPv6 and other modular offloads.
Move the sctp offload out of the sctp module and into the base
kernel.

Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
 include/net/sctp/sctp.h | 5 -----
 net/Kconfig             | 1 +
 net/sctp/Kconfig        | 1 -
 net/sctp/Makefile       | 3 ++-
 net/sctp/offload.c      | 4 +++-
 net/sctp/protocol.c     | 3 ---
 6 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 72c5b8f..625b45f 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -183,11 +183,6 @@ struct sctp_transport *sctp_epaddr_lookup_transport(
 int __net_init sctp_proc_init(struct net *net);
 
 /*
- * sctp/offload.c
- */
-int sctp_offload_init(void);
-
-/*
  * sctp/stream_sched.c
  */
 void sctp_sched_ops_init(void);
diff --git a/net/Kconfig b/net/Kconfig
index 0428f12..2773f98 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -64,6 +64,7 @@ config INET
 	bool "TCP/IP networking"
 	select CRYPTO
 	select CRYPTO_AES
+	select LIBCRC32C
 	---help---
 	  These are the protocols used on the Internet and on most local
 	  Ethernets. It is highly recommended to say Y here (this will enlarge
diff --git a/net/sctp/Kconfig b/net/sctp/Kconfig
index c740b18..d07477a 100644
--- a/net/sctp/Kconfig
+++ b/net/sctp/Kconfig
@@ -9,7 +9,6 @@ menuconfig IP_SCTP
 	select CRYPTO
 	select CRYPTO_HMAC
 	select CRYPTO_SHA1
-	select LIBCRC32C
 	---help---
 	  Stream Control Transmission Protocol
 
diff --git a/net/sctp/Makefile b/net/sctp/Makefile
index e845e45..ee206ca 100644
--- a/net/sctp/Makefile
+++ b/net/sctp/Makefile
@@ -5,6 +5,7 @@
 
 obj-$(CONFIG_IP_SCTP) += sctp.o
 obj-$(CONFIG_INET_SCTP_DIAG) += sctp_diag.o
+obj-$(CONFIG_INET) += offload.o
 
 sctp-y := sm_statetable.o sm_statefuns.o sm_sideeffect.o \
 	  protocol.o endpointola.o associola.o \
@@ -12,7 +13,7 @@ sctp-y := sm_statetable.o sm_statefuns.o sm_sideeffect.o \
 	  inqueue.o outqueue.o ulpqueue.o \
 	  tsnmap.o bind_addr.o socket.o primitive.o \
 	  output.o input.o debug.o stream.o auth.o \
-	  offload.o stream_sched.o stream_sched_prio.o \
+	  stream_sched.o stream_sched_prio.o \
 	  stream_sched_rr.o stream_interleave.o
 
 sctp_diag-y := diag.o
diff --git a/net/sctp/offload.c b/net/sctp/offload.c
index 123e9f2..c61cbde 100644
--- a/net/sctp/offload.c
+++ b/net/sctp/offload.c
@@ -107,7 +107,7 @@ static const struct skb_checksum_ops crc32c_csum_ops = {
 	.combine = sctp_csum_combine,
 };
 
-int __init sctp_offload_init(void)
+static int __init sctp_offload_init(void)
 {
 	int ret;
 
@@ -127,3 +127,5 @@ int __init sctp_offload_init(void)
 out:
 	return ret;
 }
+
+fs_initcall(sctp_offload_init);
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index a24cde2..46d2b63 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1479,9 +1479,6 @@ static __init int sctp_init(void)
 	if (status)
 		goto err_v6_add_protocol;
 
-	if (sctp_offload_init() < 0)
-		pr_crit("%s: Cannot add SCTP protocol offload\n", __func__);
-
 out:
 	return status;
 err_v6_add_protocol:
-- 
2.9.5


  parent reply	other threads:[~2018-05-02  2:07 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02  2:07 [PATCH V2 net-next 0/6] virtio-net: Add SCTP checksum offload support Vladislav Yasevich
2018-05-02  2:07 ` Vladislav Yasevich
2018-05-02  2:07 ` [PATCH V2 net-next 1/6] virtio: Add support for SCTP checksum offloading Vladislav Yasevich
2018-05-02  2:07   ` Vladislav Yasevich
2018-05-02  3:16   ` Michael S. Tsirkin
2018-05-02  3:16     ` [virtio-dev] " Michael S. Tsirkin
2018-05-02  3:16     ` Michael S. Tsirkin
2018-05-02 13:00     ` [virtio-dev] " Vlad Yasevich
2018-05-02 14:14     ` Marcelo Ricardo Leitner
2018-05-02 14:14       ` Marcelo Ricardo Leitner
2018-05-02 14:21       ` Michael S. Tsirkin
2018-05-02 14:21       ` Michael S. Tsirkin
2018-05-02 14:21         ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 14:21         ` Michael S. Tsirkin
2018-05-02 14:34         ` Marcelo Ricardo Leitner
2018-05-02 14:34           ` Marcelo Ricardo Leitner
2018-05-02  2:07 ` Vladislav Yasevich
2018-05-02  2:07 ` [PATCH V2 net-next 2/6] sctp: Handle sctp packets with CHECKSUM_PARTIAL Vladislav Yasevich
2018-05-02  2:07 ` Vladislav Yasevich
2018-05-02  2:07   ` Vladislav Yasevich
2018-05-02 14:38   ` Marcelo Ricardo Leitner
2018-05-02 14:38     ` Marcelo Ricardo Leitner
2018-08-20 14:54     ` Marcelo Ricardo Leitner
2018-08-20 14:54       ` Marcelo Ricardo Leitner
2018-08-20 15:39       ` David Laight
2018-08-20 15:39       ` David Laight
2018-08-20 15:39         ` David Laight
2018-05-02  2:07 ` Vladislav Yasevich [this message]
2018-05-02  2:07   ` [PATCH V2 net-next 3/6] sctp: Build sctp offload support into the base kernel Vladislav Yasevich
2018-05-02  2:07 ` [PATCH V2 net-next 4/6] tun: Add support for SCTP checksum offload Vladislav Yasevich
2018-05-02  2:07   ` Vladislav Yasevich
2018-05-02 14:53   ` Marcelo Ricardo Leitner
2018-05-02 14:53     ` Marcelo Ricardo Leitner
2018-05-02 14:56     ` Marcelo Ricardo Leitner
2018-05-02 14:56       ` Marcelo Ricardo Leitner
2018-05-02 17:17       ` Vlad Yasevich
2018-05-02 17:17       ` Vlad Yasevich
2018-05-02 17:17         ` [virtio-dev] " Vlad Yasevich
2018-05-02 17:17         ` Vlad Yasevich
2018-05-02  2:07 ` Vladislav Yasevich
2018-05-02  2:07 ` [PATCH V2 net-next 5/6] macvlan/macvtap: " Vladislav Yasevich
2018-05-02  2:07   ` Vladislav Yasevich
2018-05-02  3:24   ` Michael S. Tsirkin
2018-05-02  3:24   ` Michael S. Tsirkin
2018-05-02  3:24     ` [virtio-dev] " Michael S. Tsirkin
2018-05-02  3:24     ` Michael S. Tsirkin
2018-05-02 13:27     ` Vlad Yasevich
2018-05-02 13:27     ` Vlad Yasevich
2018-05-02 13:27       ` [virtio-dev] " Vlad Yasevich
2018-05-02 13:27       ` Vlad Yasevich
2018-05-02 13:46       ` Michael S. Tsirkin
2018-05-02 13:46       ` Michael S. Tsirkin
2018-05-02 13:46         ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 13:46         ` Michael S. Tsirkin
2018-05-02 14:00         ` Vlad Yasevich
2018-05-02 14:00           ` [virtio-dev] " Vlad Yasevich
2018-05-02 14:00           ` Vlad Yasevich
2018-05-02 14:17           ` Michael S. Tsirkin
2018-05-02 14:17             ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 14:17             ` Michael S. Tsirkin
2018-05-02 14:25             ` Vlad Yasevich
2018-05-02 14:25             ` Vlad Yasevich
2018-05-02 14:25               ` [virtio-dev] " Vlad Yasevich
2018-05-02 14:25               ` Vlad Yasevich
2018-05-02 14:00         ` Vlad Yasevich
2018-05-02  2:07 ` Vladislav Yasevich
2018-05-02  2:07 ` [PATCH V2 net-next 6/6] ipvlan: " Vladislav Yasevich
2018-05-02  2:07   ` Vladislav Yasevich
2018-05-02  8:12   ` Davide Caratti
2018-05-02  8:12     ` Davide Caratti
2018-05-02  2:07 ` Vladislav Yasevich
2018-05-02 21:57 ` [PATCH V2 net-next 0/6] virtio-net: Add SCTP checksum offload support Marcelo Ricardo Leitner
2018-05-02 21:57   ` Marcelo Ricardo Leitner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180502020739.19239-4-vyasevic@redhat.com \
    --to=vyasevich@gmail.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.