diff options
author | Thomas Graf <tgraf@suug.ch> | 2013-07-25 12:12:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-28 01:16:36 -0400 |
commit | c26bf4a51308c85a6f97628253b99767a84ff90a (patch) | |
tree | 5c59f55f34fe58225fd37789ce14689d2c4005b9 /net/ipv4 | |
parent | 82a54d0ebbee03a8dcf4e1e4016a53fed4d6c933 (diff) |
pktgen: Add UDPCSUM flag to support UDP checksums
UDP checksums are optional, hence pktgen has been omitting them in
favour of performance. The optional flag UDPCSUM enables UDP
checksumming. If the output device supports hardware checksumming
the skb is prepared and marked CHECKSUM_PARTIAL, otherwise the
checksum is generated in software.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Ben Greear <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/udp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 766e6bab9113..9e88af0e8ab0 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -704,7 +704,7 @@ EXPORT_SYMBOL(udp_flush_pending_frames); | |||
704 | * @src: source IP address | 704 | * @src: source IP address |
705 | * @dst: destination IP address | 705 | * @dst: destination IP address |
706 | */ | 706 | */ |
707 | static void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst) | 707 | void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst) |
708 | { | 708 | { |
709 | struct udphdr *uh = udp_hdr(skb); | 709 | struct udphdr *uh = udp_hdr(skb); |
710 | struct sk_buff *frags = skb_shinfo(skb)->frag_list; | 710 | struct sk_buff *frags = skb_shinfo(skb)->frag_list; |
@@ -740,6 +740,7 @@ static void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst) | |||
740 | uh->check = CSUM_MANGLED_0; | 740 | uh->check = CSUM_MANGLED_0; |
741 | } | 741 | } |
742 | } | 742 | } |
743 | EXPORT_SYMBOL_GPL(udp4_hwcsum); | ||
743 | 744 | ||
744 | static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4) | 745 | static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4) |
745 | { | 746 | { |