aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLucas Nussbaum <lucas.nussbaum@ens-lyon.fr>2009-02-13 03:33:41 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-16 03:03:09 -0500
commit06e868066e3b5828383eb40ff4d1c0029100b0b5 (patch)
tree5fb84de9aff8a0b5d225a4c1137000ef6cc00dd5 /net
parent85e8d004ecbc51ead6ae926e15973b42cf07b36e (diff)
sctp: Allow to disable SCTP checksums via module parameter
This is a new version of my patch, now using a module parameter instead of a sysctl, so that the option is harder to find. Please note that, once the module is loaded, it is still possible to change the value of the parameter in /sys/module/sctp/parameters/, which is useful if you want to do performance comparisons without rebooting. Computation of SCTP checksums significantly affects the performance of SCTP. For example, using two dual-Opteron 246 connected using a Gbe network, it was not possible to achieve more than ~730 Mbps, compared to 941 Mbps after disabling SCTP checksums. Unfortunately, SCTP checksum offloading in NICs is not commonly available (yet). By default, checksums are still enabled, of course. Signed-off-by: Lucas Nussbaum <lucas.nussbaum@ens-lyon.fr> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/sctp/input.c3
-rw-r--r--net/sctp/output.c2
-rw-r--r--net/sctp/protocol.c2
3 files changed, 5 insertions, 2 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 2e4a8646dbc3..693fd0804810 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -142,7 +142,8 @@ int sctp_rcv(struct sk_buff *skb)
142 __skb_pull(skb, skb_transport_offset(skb)); 142 __skb_pull(skb, skb_transport_offset(skb));
143 if (skb->len < sizeof(struct sctphdr)) 143 if (skb->len < sizeof(struct sctphdr))
144 goto discard_it; 144 goto discard_it;
145 if (!skb_csum_unnecessary(skb) && sctp_rcv_checksum(skb) < 0) 145 if (!sctp_checksum_disable && !skb_csum_unnecessary(skb) &&
146 sctp_rcv_checksum(skb) < 0)
146 goto discard_it; 147 goto discard_it;
147 148
148 skb_pull(skb, sizeof(struct sctphdr)); 149 skb_pull(skb, sizeof(struct sctphdr));
diff --git a/net/sctp/output.c b/net/sctp/output.c
index 47bfba6c03ec..2d65b7a7330b 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -531,7 +531,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
531 * Note: Adler-32 is no longer applicable, as has been replaced 531 * Note: Adler-32 is no longer applicable, as has been replaced
532 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. 532 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
533 */ 533 */
534 if (!(dst->dev->features & NETIF_F_NO_CSUM)) { 534 if (!sctp_checksum_disable && !(dst->dev->features & NETIF_F_NO_CSUM)) {
535 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); 535 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
536 crc32 = sctp_end_cksum(crc32); 536 crc32 = sctp_end_cksum(crc32);
537 } else 537 } else
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index b78e3be69013..cc0b592698f9 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1411,4 +1411,6 @@ MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-132");
1411MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132"); 1411MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-132");
1412MODULE_AUTHOR("Linux Kernel SCTP developers <lksctp-developers@lists.sourceforge.net>"); 1412MODULE_AUTHOR("Linux Kernel SCTP developers <lksctp-developers@lists.sourceforge.net>");
1413MODULE_DESCRIPTION("Support for the SCTP protocol (RFC2960)"); 1413MODULE_DESCRIPTION("Support for the SCTP protocol (RFC2960)");
1414module_param_named(no_checksums, sctp_checksum_disable, bool, 0644);
1415MODULE_PARM_DESC(no_checksums, "Disable checksums computing and verification");
1414MODULE_LICENSE("GPL"); 1416MODULE_LICENSE("GPL");