diff mbox series

[net-next,v1] net: af_unix: clean up spurious drop reasons

Message ID 20241116094236.28786-1-donald.hunter@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v1] net: af_unix: clean up spurious drop reasons | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-17--12-00 (tests: 789)

Commit Message

Donald Hunter Nov. 16, 2024, 9:42 a.m. UTC
Use consume_skb() instead of kfree_skb() in the happy paths to clean up
spurious NOT_SPECIFIED drop reasons.

Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
---
 net/unix/af_unix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kuniyuki Iwashima Nov. 18, 2024, 6:01 p.m. UTC | #1
From: Donald Hunter <donald.hunter@gmail.com>
Date: Sat, 16 Nov 2024 09:42:36 +0000
> Use consume_skb() instead of kfree_skb() in the happy paths to clean up

Both are the unhappy paths and kfree_skb() should be used.

I have some local patches for drop reasons for AF_UNIX and
can post them after net-next is open if needed.


> spurious NOT_SPECIFIED drop reasons.
> 
> Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
> ---
>  net/unix/af_unix.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 001ccc55ef0f..90bb8556ea04 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -1705,7 +1705,7 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
>  		unix_state_unlock(other);
>  
>  out:
> -	kfree_skb(skb);
> +	consume_skb(skb);
>  	if (newsk)
>  		unix_release_sock(newsk, 0);
>  	if (other)
> @@ -2174,7 +2174,7 @@ static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
>  		unix_state_unlock(sk);
>  	unix_state_unlock(other);
>  out_free:
> -	kfree_skb(skb);
> +	consume_skb(skb);
>  out:
>  	if (other)
>  		sock_put(other);
> -- 
> 2.47.0
Donald Hunter Nov. 18, 2024, 10:46 p.m. UTC | #2
On Mon, 18 Nov 2024 at 18:03, Kuniyuki Iwashima <kuniyu@amazon.com> wrote:
>
> From: Donald Hunter <donald.hunter@gmail.com>
> Date: Sat, 16 Nov 2024 09:42:36 +0000
> > Use consume_skb() instead of kfree_skb() in the happy paths to clean up
>
> Both are the unhappy paths and kfree_skb() should be used.
>
> I have some local patches for drop reasons for AF_UNIX and
> can post them after net-next is open if needed.

It would be really helpful if you could share the drop reasons you
have assigned to these. I am seeing ~100/s coming from containerd
which I will need to investigate if it is any kind of error condition.

Thanks,
Donald.
diff mbox series

Patch

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 001ccc55ef0f..90bb8556ea04 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1705,7 +1705,7 @@  static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
 		unix_state_unlock(other);
 
 out:
-	kfree_skb(skb);
+	consume_skb(skb);
 	if (newsk)
 		unix_release_sock(newsk, 0);
 	if (other)
@@ -2174,7 +2174,7 @@  static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
 		unix_state_unlock(sk);
 	unix_state_unlock(other);
 out_free:
-	kfree_skb(skb);
+	consume_skb(skb);
 out:
 	if (other)
 		sock_put(other);