Skip to content

Commit 1933a78

Browse files
Tom Herbertdavem330
authored andcommitted
net: add gro_compute_pseudo functions
Add inet_gro_compute_pseudo and ip6_gro_compute_pseudo. These are the logical equivalents of inet_compute_pseudo and ip6_compute_pseudo for GRO path. The IP header is taken from skb_gro_network_header. Signed-off-by: Tom Herbert <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 573e8fc commit 1933a78

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

include/net/ip.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,14 @@ static inline void inet_set_txhash(struct sock *sk)
364364
sk->sk_txhash = flow_hash_from_keys(&keys);
365365
}
366366

367+
static inline __wsum inet_gro_compute_pseudo(struct sk_buff *skb, int proto)
368+
{
369+
const struct iphdr *iph = skb_gro_network_header(skb);
370+
371+
return csum_tcpudp_nofold(iph->saddr, iph->daddr,
372+
skb_gro_len(skb), proto, 0);
373+
}
374+
367375
/*
368376
* Map a multicast IP onto multicast MAC for type ethernet.
369377
*/

include/net/ip6_checksum.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ static inline __wsum ip6_compute_pseudo(struct sk_buff *skb, int proto)
4848
skb->len, proto, 0));
4949
}
5050

51+
static inline __wsum ip6_gro_compute_pseudo(struct sk_buff *skb, int proto)
52+
{
53+
const struct ipv6hdr *iph = skb_gro_network_header(skb);
54+
55+
return ~csum_unfold(csum_ipv6_magic(&iph->saddr, &iph->daddr,
56+
skb_gro_len(skb), proto, 0));
57+
}
58+
5159
static __inline__ __sum16 tcp_v6_check(int len,
5260
const struct in6_addr *saddr,
5361
const struct in6_addr *daddr,

0 commit comments

Comments
 (0)