Skip to contentSkip to conversation

net: af_unix: clean up spurious drop reasons

PATCH In review Donald Hunter 3 participants 3 messages Nov 16, 2024 – Nov 18, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: af_unix: clean up spurious drop reasons

Use consume_skb() instead of kfree_skb() in the happy paths to clean up spurious NOT_SPECIFIED drop reasons.

---
 net/unix/af_unix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/unix/af_unix.c +2 -2
index 001ccc55ef0f..90bb8556ea04 100644
@@ -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);
Signature · 1 line
2.47.0
#1 lore raw

From: Donald Hunter <[email protected]>
Date: Sat, 16 Nov 2024 09:42:36 +0000

Quoted 1 line

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.

Quoted 31 lines

spurious NOT_SPECIFIED drop reasons.

---
 net/unix/af_unix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/unix/af_unix.c +2 -2
index 001ccc55ef0f..90bb8556ea04 100644
@@ -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);
Signature · 1 line
2.47.0
#2 lore raw
Quoted 9 lines · Kuniyuki Iwashima

From: Donald Hunter <[email protected]>
Date: Sat, 16 Nov 2024 09:42:36 +0000

Quoted 1 line

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.