Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp79770lqh; Thu, 30 May 2024 14:51:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzCCthbkPfRG7rzGQp9xY2CTt17bhpZRU1Nrk38uJzNkXJLqncqVejijVpm4Q6IxH2atMWL5oCjf8c3Wbmh/UHuhOd88p6ItOScd67Xg== X-Google-Smtp-Source: AGHT+IHn/+SxSZ6DZEu4W3HmtdqRje0/UjQTfMyclnUH2GwF0i3RRck7zWpJ7WuNaWB27QUxbk6l X-Received: by 2002:a05:6e02:2194:b0:374:7f1c:c3f5 with SMTP id e9e14a558f8ab-3748b8f3ac1mr2313665ab.0.1717105886558; Thu, 30 May 2024 14:51:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717105886; cv=pass; d=google.com; s=arc-20160816; b=lxQpLZClmZPz88EyzRQzmMKR2JDJ7weSxGVEqIkQDw0Pl6AoGIACPsnkr1N2R5GEPG A9r5qrnA2bfHqUniSSsjdnHZ/Rwml915PzV+Raq7hJCfN6RnOLKk6o3He3+y5QhP7P1r ogCQfQzD2qbWRXvml2Wywy+y7nWgs0JJxqgDdjnbIT4xfQjRg/lpdKYg6iDqxh7n7qjL yLqcNXfm25UM/XrwgIcoDe6RsLLSEokq00pMw7gGXWxbV+cW0A3cA1oP5yZIL7AwZVpo k7QVnGAWZgcbhzLVbuZhnXs7i+G+fCZQnJwcUTdnmmnaknD8ixOB0zx2IZM2kfc540cY 9q8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=27TjARiWthXWjefcQW0222UB7xMw3bcD7v/H3qDKiuE=; fh=SQc2Rz97ZtCwsNmLqUh/C3uG/GIifNNiHZ5RLsy3IKg=; b=XpOdBYMUkBVOqT6sN0UAdv6pSa8riAKvGcrJHIrJuMutCvuidcXhO81IybOn0tw2fc /IUL31POjWHfTT7gKS/6+V8Ujn7i1pSkRBkCMOyML7hnhctYB1NNnkPJxi8A2Lq8+nvL eyQg2XXoIYZqTirMlOFBQNGMTrRrg2BjbN1/m1c+FvIH1h5rbV2l5eDRubInP/2tOsMB 5FepsGob2ZTLsLcyBUTBHs/cUkU9Dcdr+LQ7LOu22hJYGXZp/dbSugR9ngFWeWAl0fEf NJNZ9R0M4wg7YpgOyjNjuhEus2Yi9kHCUYRcF6SUd0Dz/IGkESxghvJwH3bllodJC4L2 U5uw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=KFMlbyfE; arc=pass (i=1 spf=pass spfdomain=cloudflare.com dkim=pass dkdomain=cloudflare.com dmarc=pass fromdomain=cloudflare.com); spf=pass (google.com: domain of linux-kernel+bounces-195953-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195953-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c359e0714bsi324256a12.277.2024.05.30.14.51.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 14:51:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195953-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=KFMlbyfE; arc=pass (i=1 spf=pass spfdomain=cloudflare.com dkim=pass dkdomain=cloudflare.com dmarc=pass fromdomain=cloudflare.com); spf=pass (google.com: domain of linux-kernel+bounces-195953-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195953-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0FC2AB255D9 for ; Thu, 30 May 2024 21:48:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FA68194C64; Thu, 30 May 2024 21:47:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b="KFMlbyfE" Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D26C1190674 for ; Thu, 30 May 2024 21:47:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717105632; cv=none; b=CAeY65eFUAVkKkXJhXC4aft0jK6Cpo7s6JAnhywZLuIM/ILW3wiN3LxXr4rFXAC/KQbBNQ79gTo4fs5FufaiMALFieqe8cL0E2oVx7YmSWfwX0vzRacVtx65JYbucPwPxfqkAl4G4/jUEFQKmYVJnZSJbfaiv+TvaojOrYKziew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717105632; c=relaxed/simple; bh=6dowC/Uwf26NiZaIg168nDsdSN0aKz+6tZkvOLAwGnQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XwIGmfA+6nQxsECJK+JnYVjdSxwUe+O3ICLrMmDV36J9xuerrJAJ+lKxF/MIHe7ak3OYqg9X5qSeWajXAeQFZPKKrLnPwqMWxIwLKV8NIBZWlAo9K4XPmK95rPM8zMNp4gwnTJt3WYuf/AOq7IiE+L5G/h8P7XTFrGyy35xEMZg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cloudflare.com; spf=pass smtp.mailfrom=cloudflare.com; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b=KFMlbyfE; arc=none smtp.client-ip=209.85.210.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cloudflare.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cloudflare.com Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-6f12eda7c7fso724956a34.2 for ; Thu, 30 May 2024 14:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google09082023; t=1717105630; x=1717710430; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=27TjARiWthXWjefcQW0222UB7xMw3bcD7v/H3qDKiuE=; b=KFMlbyfELd+IMDBFEv5TVqpkYAIFrnadoOkHZntt+LWWH5Lyvbt/DCUuIzSgcEJyw1 jThW9oHKYeY+NY4aOwCCj9kYiDcpRCLRQOR3w4wV7rq8auNss+wFYeHVovWx9wWPbDub LW5C8L8KXNXc8KXUmI8a/rQMFRQ+YvkhMD+DfJr+ezRo9xkkYGs6V7wy+DOapKKeFHAJ fQ4IvRgfrNgqTzSOmi+j/oy0AddmU7pH3ja8xlu0soA40jA9MzxdOz8GFxoLLP2Mc88I jDuPxmj5VH1Pf/JETPXZ62xAmTMkYRzi2UNFSrI7V1mMYdhMSjuMdWN7ZEppnUlupffu Jq3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717105630; x=1717710430; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=27TjARiWthXWjefcQW0222UB7xMw3bcD7v/H3qDKiuE=; b=mK2j92KFoAvxCfKam6OA4xvKj/GdedevtL5Inuwj1R0GC7Pfv5WY6pYonQMTwYa0zm P//0tWL01/HDfjLCiAd0DvSaA6ZQ4Epanz2Mgs+gkfFO1RMuMxIyryanVIKI54rAFIZZ 062ecFNF+wFrKW4kI2IhWE7aVdhFr9djddtmrucVdFjNWSLSWbpjyuSwXSopcuRFAcqG uNBcia5Cw8T6fawkcIM2pD6KVrDQTmNlN+UYPvyjLpe1g2ZqYncs3EOgZx/scT23ZQSf o+CqjtT/KoPuyNVly9oVLeicwjyL4JPldy4D7JCK5myDH0+JylWmOAxEiKUS1Be5vlHS 0inQ== X-Forwarded-Encrypted: i=1; AJvYcCUrPK54eZ3gWFAbMeeuyWHpi+xGVVrFpDlRdnWN4IddClt4iOht5EW/wXML1mDoecsgIiQxpgvGBOx3pEsmzFA0VmoCnmp8kKZdAWha X-Gm-Message-State: AOJu0YyQyzAhN2enhLjVRB/1iCSvz8fJS1Xong/d6VWJ5eMXlbwzb29T Yc/jyzpLvflvF1tMxA6pOkiMMQjygpUMXzZYgnNl4d06gvQBLQLBW5WU45b4PqM= X-Received: by 2002:a05:6830:1e15:b0:6ef:9ec1:2bf8 with SMTP id 46e09a7af769-6f911f9fc2bmr93153a34.23.1717105629904; Thu, 30 May 2024 14:47:09 -0700 (PDT) Received: from debian.debian ([2a09:bac5:7a49:f9b::18e:1c]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-43ff23a42bcsm2009991cf.16.2024.05.30.14.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 14:47:09 -0700 (PDT) Date: Thu, 30 May 2024 14:47:07 -0700 From: Yan Zhai To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , David Ahern , Abhishek Chauhan , Mina Almasry , Florian Westphal , Alexander Lobakin , David Howells , Jiri Pirko , Daniel Borkmann , Sebastian Andrzej Siewior , Lorenzo Bianconi , Pavel Begunkov , linux-kernel@vger.kernel.org, kernel-team@cloudflare.com, Jesper Dangaard Brouer Subject: [RFC net-next 5/6] udp: pass rx socket on rcv drops Message-ID: <64c8339aa96232b5d36738162e7bf58412bf6682.1717105215.git.yan@cloudflare.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Use kfree_skb_for_sk call to pass on the rx socket Signed-off-by: Yan Zhai --- net/ipv4/udp.c | 6 +++--- net/ipv6/udp.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 189c9113fe9a..e5dbd1cbad50 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -2074,7 +2074,7 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) } UDP_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, is_udplite); trace_udp_fail_queue_rcv_skb(rc, sk, skb); - kfree_skb_reason(skb, drop_reason); + kfree_skb_for_sk(skb, sk, drop_reason); return -1; } @@ -2196,7 +2196,7 @@ static int udp_queue_rcv_one_skb(struct sock *sk, struct sk_buff *skb) drop: __UDP_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, is_udplite); atomic_inc(&sk->sk_drops); - kfree_skb_reason(skb, drop_reason); + kfree_skb_for_sk(skb, sk, drop_reason); return -1; } @@ -2485,7 +2485,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, __UDP_INC_STATS(net, UDP_MIB_CSUMERRORS, proto == IPPROTO_UDPLITE); drop: __UDP_INC_STATS(net, UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE); - kfree_skb_reason(skb, drop_reason); + kfree_skb_for_sk(skb, sk, drop_reason); return 0; } diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index c81a07ac0463..97a327c759b8 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -673,7 +673,7 @@ static int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) } UDP6_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, is_udplite); trace_udp_fail_queue_rcv_skb(rc, sk, skb); - kfree_skb_reason(skb, drop_reason); + kfree_skb_for_sk(skb, sk, drop_reason); return -1; } @@ -776,7 +776,7 @@ static int udpv6_queue_rcv_one_skb(struct sock *sk, struct sk_buff *skb) drop: __UDP6_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, is_udplite); atomic_inc(&sk->sk_drops); - kfree_skb_reason(skb, drop_reason); + kfree_skb_for_sk(skb, sk, drop_reason); return -1; } @@ -1054,7 +1054,7 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, __UDP6_INC_STATS(net, UDP_MIB_CSUMERRORS, proto == IPPROTO_UDPLITE); discard: __UDP6_INC_STATS(net, UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE); - kfree_skb_reason(skb, reason); + kfree_skb_for_sk(skb, sk, reason); return 0; } -- 2.30.2