Message ID | 20250307102002.2095238-1-edumazet@google.com (mailing list archive) |
---|---|
State | Accepted |
Commit | b3aaf3c13baab4c6f024f0852ae970c75ca3b98f |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [v2,net-next] udp: expand SKB_DROP_REASON_UDP_CSUM use | expand |
Eric Dumazet wrote: > SKB_DROP_REASON_UDP_CSUM can be used in four locations > when dropping a packet because of a wrong UDP checksum. > > Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Willem de Bruijn <willemb@google.com>
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Fri, 7 Mar 2025 10:20:02 +0000 you wrote: > SKB_DROP_REASON_UDP_CSUM can be used in four locations > when dropping a packet because of a wrong UDP checksum. > > Signed-off-by: Eric Dumazet <edumazet@google.com> > --- > v2: add two more call sites. (Willem feedback) > v1: https://lore.kernel.org/netdev/20250306183101.817063-1-edumazet@google.com/#r > > [...] Here is the summary with links: - [v2,net-next] udp: expand SKB_DROP_REASON_UDP_CSUM use https://git.kernel.org/netdev/net-next/c/b3aaf3c13baa You are awesome, thank you!
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 17c7736d8349433ad2d4cbcc9414b2f8112610af..d0bffcfa56d8deb14f38cc48a4a2b1d899ad6af4 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1848,7 +1848,7 @@ static struct sk_buff *__first_packet_length(struct sock *sk, atomic_inc(&sk->sk_drops); __skb_unlink(skb, rcvq); *total += skb->truesize; - kfree_skb(skb); + kfree_skb_reason(skb, SKB_DROP_REASON_UDP_CSUM); } else { udp_skb_csum_unnecessary_set(skb); break; @@ -2002,7 +2002,7 @@ int udp_read_skb(struct sock *sk, skb_read_actor_t recv_actor) __UDP_INC_STATS(net, UDP_MIB_CSUMERRORS, is_udplite); __UDP_INC_STATS(net, UDP_MIB_INERRORS, is_udplite); atomic_inc(&sk->sk_drops); - kfree_skb(skb); + kfree_skb_reason(skb, SKB_DROP_REASON_UDP_CSUM); goto try_again; } @@ -2117,7 +2117,7 @@ int udp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int flags, UDP_INC_STATS(sock_net(sk), UDP_MIB_CSUMERRORS, is_udplite); UDP_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, is_udplite); } - kfree_skb(skb); + kfree_skb_reason(skb, SKB_DROP_REASON_UDP_CSUM); /* starting over for a new packet, but check if we need to yield */ cond_resched(); diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 3a0d6c5a8286b1685e8a1dec50365fe392ab9a87..024458ef163c9e24dfb37aea2690b2030f6a0fbc 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -586,7 +586,7 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, SNMP_INC_STATS(mib, UDP_MIB_CSUMERRORS); SNMP_INC_STATS(mib, UDP_MIB_INERRORS); } - kfree_skb(skb); + kfree_skb_reason(skb, SKB_DROP_REASON_UDP_CSUM); /* starting over for a new packet, but check if we need to yield */ cond_resched();
SKB_DROP_REASON_UDP_CSUM can be used in four locations when dropping a packet because of a wrong UDP checksum. Signed-off-by: Eric Dumazet <edumazet@google.com> --- v2: add two more call sites. (Willem feedback) v1: https://lore.kernel.org/netdev/20250306183101.817063-1-edumazet@google.com/#r net/ipv4/udp.c | 6 +++--- net/ipv6/udp.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)