diff options
author | Julian Anastasov <ja@ssi.bg> | 2010-10-17 09:17:20 -0400 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2010-10-21 04:50:02 -0400 |
commit | 8b27b10f5863a5b63e46304a71aa01463d1efac4 (patch) | |
tree | 89f5db8881b0297cda00cad3c2cdedf685e2757f /include/net | |
parent | 5bc9068e9d962ca6b8bec3f0eb6f60ab4dee1d04 (diff) |
ipvs: optimize checksums for apps
Avoid full checksum calculation for apps that can provide
info whether csum was broken after payload mangling. For now only
ip_vs_ftp mangles payload and it updates the csum, so the full
recalculation is avoided for all packets.
Add CHECKSUM_UNNECESSARY for snat_handler (TCP and UDP).
It is needed to support SNAT from local address for the case
when csum is fully recalculated.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ip_vs.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 6e8a6192e574..adcdba9dd183 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -597,11 +597,19 @@ struct ip_vs_app { | |||
597 | __be16 port; /* port number in net order */ | 597 | __be16 port; /* port number in net order */ |
598 | atomic_t usecnt; /* usage counter */ | 598 | atomic_t usecnt; /* usage counter */ |
599 | 599 | ||
600 | /* output hook: return false if can't linearize. diff set for TCP. */ | 600 | /* |
601 | * output hook: Process packet in inout direction, diff set for TCP. | ||
602 | * Return: 0=Error, 1=Payload Not Mangled/Mangled but checksum is ok, | ||
603 | * 2=Mangled but checksum was not updated | ||
604 | */ | ||
601 | int (*pkt_out)(struct ip_vs_app *, struct ip_vs_conn *, | 605 | int (*pkt_out)(struct ip_vs_app *, struct ip_vs_conn *, |
602 | struct sk_buff *, int *diff); | 606 | struct sk_buff *, int *diff); |
603 | 607 | ||
604 | /* input hook: return false if can't linearize. diff set for TCP. */ | 608 | /* |
609 | * input hook: Process packet in outin direction, diff set for TCP. | ||
610 | * Return: 0=Error, 1=Payload Not Mangled/Mangled but checksum is ok, | ||
611 | * 2=Mangled but checksum was not updated | ||
612 | */ | ||
605 | int (*pkt_in)(struct ip_vs_app *, struct ip_vs_conn *, | 613 | int (*pkt_in)(struct ip_vs_app *, struct ip_vs_conn *, |
606 | struct sk_buff *, int *diff); | 614 | struct sk_buff *, int *diff); |
607 | 615 | ||