Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2776402pxb; Tue, 24 Aug 2021 07:22:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUk7LXDTWx7SGaRhgM1i7w1SmkaiSbP0OLASks7OiKUyupntvTJPoPd9MY17A19NrkvBAW X-Received: by 2002:a5d:8245:: with SMTP id n5mr31951169ioo.145.1629814950163; Tue, 24 Aug 2021 07:22:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629814950; cv=none; d=google.com; s=arc-20160816; b=mIppkkBAZZ0vna7AUvJZh/kp614IuTWpqqM8GhUo8RbYQf5FbYV295OY8uC70Yg1Nq hWpd0lV5jQbyB3qkyVIHUh38lgPTESPPfogpQTCos1BpAMJOaul4fGped/m4GVTnhgj9 M3XV/P6OgicslW2FvsM4exRLKX6Q3Gct2MKdDZmQr8tQxEPMsHh15UsbGdczmKcJH+G7 YfQ9Y9D2vz1+UO48QJwhVwp1E7IBHkyFdGANN8BCB9PC7v1SisSI6YXrraui8xs3tTqC +A+VvcTaHIbnW74Cu4XYh7IruDLoee1Zg6INXWz201NgyMb/Df3wEuwtUxLXgiP+6iQP DDqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=YlIj6k7TRkYBorPkRt4x0vq69FZ1sSA4wS4oCmRmAmY=; b=vW1YGt+Uo9CCMsm4n456Evbs/5B7J0BeNa4ZJPGLRU2/pU1t1d7bsF2/vnoS+NpBQ3 FaQnGrUknudoMrBJ7dCMgbVViE1Wi2iieWwNVpAGp19VNp5OKFxGZvKRE3VCPe+IAsFl uBEfJByB9aAgapxyha+8tn7SwJ4BrPz5Cjd+y63iSqIJ/dT0zIBekiPo79+y8aJHaQ+3 insYRpjJ8E4W4u0x4tlrzXnS9Mzesxtsh8kukTzaiEU3HG++n4jrX+6NSA7MGE80NVkr NnB95GOSmzzQ7NJqsIZ7ICYvNQSpDQvvwvW6fMYOm6pUYnp1hte/IcGs5ppbpPnsAW3J nCCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DUYI5+eA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si16611397ioj.7.2021.08.24.07.22.12; Tue, 24 Aug 2021 07:22:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DUYI5+eA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237698AbhHXOVf (ORCPT + 99 others); Tue, 24 Aug 2021 10:21:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:36090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237629AbhHXOVe (ORCPT ); Tue, 24 Aug 2021 10:21:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E4AA3611EF; Tue, 24 Aug 2021 14:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629814850; bh=Vqxn9Pp2lymDhFqYmDN38oKpw1DF8fgwY36r0tJnI4k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DUYI5+eAnGsGPwfI6lc9pgui0ozgRu3RfoRFSo2Gs1fjIo2cksIb8eG29Bp8hfrH1 aoh+kUUaDyLBSIRlFrN/lwJPVYPMCZDifzXkb8L+CPfOer1wdVORIkpAs2WezzSolk +XXwxlw2Ov+IqdOdoCYtYXBcEVqoDDiUfarOYLTfd9ZlQSlF137aDAkWy22mbvAEoP qv0iPtd459s7K8qY7BOjlAuQfSBY7Y7kO+GCC45QnJCI7bo28bUipPNJUaMZ84PMHn OWVckqCTQfLBJp3b4dSWt9r3VIhJyXLBkKnPuw2/hFK7Hi4VZCrVCaOOtkiZ3Xcp9I mnQ1QKPwL7CxA== Date: Tue, 24 Aug 2021 07:20:49 -0700 From: Jakub Kicinski To: Zhongya Yan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, edumazet@google.com, rostedt@goodmis.org, mingo@redhat.com, davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org, hengqi.chen@gmail.com, yhs@fb.com Subject: Re: [PATCH] net: tcp_drop adds `reason` parameter for tracing Message-ID: <20210824072049.76789bba@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20210824125140.190253-1-yan2228598786@gmail.com> References: <20210824125140.190253-1-yan2228598786@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Aug 2021 05:51:40 -0700 Zhongya Yan wrote: > +enum tcp_drop_reason { > + TCP_OFO_QUEUE = 1, > + TCP_DATA_QUEUE_OFO = 2, > + TCP_DATA_QUEUE = 3, > + TCP_PRUNE_OFO_QUEUE = 4, > + TCP_VALIDATE_INCOMING = 5, > + TCP_RCV_ESTABLISHED = 6, > + TCP_RCV_SYNSENT_STATE_PROCESS = 7, > + TCP_RCV_STATE_PROCESS = 8 > +}; This is basically tracking the caller, each may have multiple reasons for dropping. Is tracking the caller sufficient? Should we at least make this a bitmask so we can set multiple bits (caller and more precise reason)? Or are we going to add another field in that case? > -static void tcp_drop(struct sock *sk, struct sk_buff *skb) > +static void __tcp_drop(struct sock *sk, > + struct sk_buff *skb) > { > sk_drops_add(sk, skb); > __kfree_skb(skb); > } Why keep this function if there is only one caller? > +/* tcp_drop whit reason,for epbf trace > + */ This comment is (a) misspelled, (b) doesn't add much value. > +static void tcp_drop(struct sock *sk, struct sk_buff *skb, > + enum tcp_drop_reason reason) > +{ > + trace_tcp_drop(sk, skb, reason); > + __tcp_drop(sk, skb); > +}