mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
gro: optimize skb_gro_postpull_rcsum()
We can leverage third argument to csum_partial(): X = csum_sub(X, csum_partial(start, len, 0)); --> X = csum_add(X, ~csum_partial(start, len, 0)); --> X = ~csum_partial(start, len, ~X); This removes one add/adc pair and its dependency against the carry flag. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
703319094c
commit
0bd28476f6
1 changed files with 2 additions and 2 deletions
|
@ -173,8 +173,8 @@ static inline void skb_gro_postpull_rcsum(struct sk_buff *skb,
|
||||||
const void *start, unsigned int len)
|
const void *start, unsigned int len)
|
||||||
{
|
{
|
||||||
if (NAPI_GRO_CB(skb)->csum_valid)
|
if (NAPI_GRO_CB(skb)->csum_valid)
|
||||||
NAPI_GRO_CB(skb)->csum = csum_sub(NAPI_GRO_CB(skb)->csum,
|
NAPI_GRO_CB(skb)->csum = ~csum_partial(start, len,
|
||||||
csum_partial(start, len, 0));
|
~NAPI_GRO_CB(skb)->csum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GRO checksum functions. These are logical equivalents of the normal
|
/* GRO checksum functions. These are logical equivalents of the normal
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue