inet: add indirect call wrapper for getfrag() calls
Subsystems (3)
PATCH 1/1 inet: add indirect call wrapper for getfrag() calls
UDP send path suffers from one indirect call to ip_generic_getfrag()
We can use INDIRECT_CALL_1() to avoid it.
---
Cc: Willem de Bruijn <[email protected]>
Cc: Brian Vazquez <[email protected]>
--- net/ipv4/ip_output.c | 13 +++++++++---- net/ipv6/ip6_output.c | 13 ++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-)
net/ipv4/ip_output.c +9 -4
@@ -1169,7 +1169,10 @@ static int __ip_append_data(struct sock *sk,/* [!] NOTE: copy will be negative if pagedlen>0 * because then the equation reduces to -fraggap. */ -if (copy >0 &&getfrag (from, data + transhdrlen, offset, copy, fraggap, skb) <0 ) { +if (copy >0 && +INDIRECT_CALL_1 (getfrag, ip_generic_getfrag, + from, data + transhdrlen, offset, + copy, fraggap, skb) <0 ) { err = -EFAULT ;kfree_skb (skb); goto error;
@@ -1213,8 +1216,9 @@ static int __ip_append_data(struct sock *sk,unsigned int off; off = skb->len; -if (getfrag (from,skb_put (skb, copy), - offset, copy, off, skb) <0 ) { +if (INDIRECT_CALL_1 (getfrag, ip_generic_getfrag, + from,skb_put (skb, copy), + offset, copy, off, skb) <0 ) {__skb_trim (skb, off); err = -EFAULT ; goto error;
@@ -1252,7 +1256,8 @@ static int __ip_append_data(struct sock *sk,get_page (pfrag->page); } copy =min_t (int, copy, pfrag->size - pfrag->offset); -if (getfrag (from, +if (INDIRECT_CALL_1 (getfrag, ip_generic_getfrag, + from,page_address (pfrag->page) + pfrag->offset, offset, copy, skb->len, skb) <0 ) goto error_efault;
net/ipv6/ip6_output.c +8 -5
@@ -1697,8 +1697,9 @@ static int __ip6_append_data(struct sock *sk,pskb_trim_unique (skb_prev, maxfraglen); }if (copy >0 && -getfrag (from, data + transhdrlen, offset, - copy, fraggap, skb) <0 ) { +INDIRECT_CALL_1 (getfrag, ip_generic_getfrag, + from, data + transhdrlen, offset, + copy, fraggap, skb) <0 ) { err = -EFAULT ;kfree_skb (skb); goto error;
@@ -1742,8 +1743,9 @@ static int __ip6_append_data(struct sock *sk,unsigned int off; off = skb->len; -if (getfrag (from,skb_put (skb, copy), - offset, copy, off, skb) <0 ) { +if (INDIRECT_CALL_1 (getfrag, ip_generic_getfrag, + from,skb_put (skb, copy), + offset, copy, off, skb) <0 ) {__skb_trim (skb, off); err = -EFAULT ; goto error;
@@ -1781,7 +1783,8 @@ static int __ip6_append_data(struct sock *sk,get_page (pfrag->page); } copy =min_t (int, copy, pfrag->size - pfrag->offset); -if (getfrag (from, +if (INDIRECT_CALL_1 (getfrag, ip_generic_getfrag, + from,page_address (pfrag->page) + pfrag->offset, offset, copy, skb->len, skb) <0 ) goto error_efault;
Signature · 1 line
2.47.0.338.g60cca15819-goog
Quoted 5 lines · Eric Dumazet
UDP send path suffers from one indirect call to
ip_generic_getfrag()We can use
INDIRECT_CALL_1()to avoid it.Signed-off-by Eric Dumazet <[email protected]>
Quoted 6 lines · Eric Dumazet
UDP send path suffers from one indirect call to
ip_generic_getfrag()We can use
INDIRECT_CALL_1()to avoid it.Signed-off-by Eric Dumazet <[email protected]>
Quoted 87 lines
---
Cc: Willem de Bruijn <[email protected]>
Cc: Brian Vazquez <[email protected]>--- net/ipv4/ip_output.c | 13 +++++++++---- net/ipv6/ip6_output.c | 13 ++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-)net/ipv4/ip_output.c +9
-4@@ -1169,7 +1169,10 @@ static int __ip_append_data(struct sock *sk,/* [!] NOTE: copy will be negative if pagedlen>0 * because then the equation reduces to -fraggap. */ -if (copy >0 &&getfrag (from, data + transhdrlen, offset, copy, fraggap, skb) <0 ) { +if (copy >0 && +INDIRECT_CALL_1 (getfrag, ip_generic_getfrag, + from, data + transhdrlen, offset, + copy, fraggap, skb) <0 ) { err = -EFAULT ;kfree_skb (skb); goto error;@@ -1213,8 +1216,9 @@ static int __ip_append_data(struct sock *sk,unsigned int off; off = skb->len; -if (getfrag (from,skb_put (skb, copy), - offset, copy, off, skb) <0 ) { +if (INDIRECT_CALL_1 (getfrag, ip_generic_getfrag, + from,skb_put (skb, copy), + offset, copy, off, skb) <0 ) {__skb_trim (skb, off); err = -EFAULT ; goto error;@@ -1252,7 +1256,8 @@ static int __ip_append_data(struct sock *sk,get_page (pfrag->page); } copy =min_t (int, copy, pfrag->size - pfrag->offset); -if (getfrag (from, +if (INDIRECT_CALL_1 (getfrag, ip_generic_getfrag, + from,page_address (pfrag->page) + pfrag->offset, offset, copy, skb->len, skb) <0 ) goto error_efault;net/ipv6/ip6_output.c +8
-6@@ -1697,8 +1697,9 @@ static int __ip6_append_data(struct sock *sk,pskb_trim_unique (skb_prev, maxfraglen); }if (copy >0 && -getfrag (from, data + transhdrlen, offset, - copy, fraggap, skb) <0 ) { +INDIRECT_CALL_1 (getfrag, ip_generic_getfrag, + from, data + transhdrlen, offset, + copy, fraggap, skb) <0 ) { err = -EFAULT ;kfree_skb (skb); goto error;@@ -1742,8 +1743,9 @@ static int __ip6_append_data(struct sock *sk,unsigned int off; off = skb->len; -if (getfrag (from,skb_put (skb, copy), - offset, copy, off, skb) <0 ) { +if (INDIRECT_CALL_1 (getfrag, ip_generic_getfrag, + from,skb_put (skb, copy), + offset, copy, off, skb) <0 ) {__skb_trim (skb, off); err = -EFAULT ; goto error;@@ -1781,7 +1783,8 @@ static int __ip6_append_data(struct sock *sk,get_page (pfrag->page); } copy =min_t (int, copy, pfrag->size - pfrag->offset); -if (getfrag (from, +if (INDIRECT_CALL_1 (getfrag, ip_generic_getfrag, + from,page_address (pfrag->page) + pfrag->offset, offset, copy, skb->len, skb) <0 ) goto error_efault; --2.47.0.338.g60cca15819-goog
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Tue, 3 Dec 2024 17:36:17 +0000 you wrote:
UDP send path suffers from one indirect call to
ip_generic_getfrag()We can use
INDIRECT_CALL_1()to avoid it.Signed-off-by Eric Dumazet <[email protected]>---
Cc: Willem de Bruijn <[email protected]>
Cc: Brian Vazquez <[email protected]>[...]
Here is the summary with links:
- [net-next] inet: add indirect call wrapper for getfrag() calls
https://git.kernel.org/netdev/net-next/c/5204ccbfa223
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html