Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3718133imj; Tue, 12 Feb 2019 03:33:14 -0800 (PST) X-Google-Smtp-Source: AHgI3IYzhfuUz/lrLLsbEqty0HWTkSh6eck3BCa/cq+2GS5MOkNT99z7QPgbWf+RczGheGvVrEQG X-Received: by 2002:a17:902:6a4:: with SMTP id 33mr3506177plh.99.1549971194208; Tue, 12 Feb 2019 03:33:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549971194; cv=none; d=google.com; s=arc-20160816; b=vU3O41odcQf2mR+fGiUqHirLN/d9npVNvYbRjZU82tG6jjMZos5lv6wFKd3RFx0u+I luI6Xf4cMhFCrdEmRXOvyfwjfu5YFgiSHs2tZcF9Ot8RM9BrHn4rc42SPHhCWlOlBi1n Xn7DZFzHpBeq7BsN/7eua0r0c98yqcf2KSiGgjPqAaXMXuaufCc20+bOIlLFniRsXbSe dT54rCvxq1By3kSv6mF58vvW4EmRf4/I3bpxDIlnOGNe0u+JFYmSyVsOars0lXuukYTr a5YlfhMNBA3O3pbHSwFVQM9u+7D/l+a1U41PzKi2tIq4VSw/tOgPoT+qmEASAZBq8GC4 y0og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=bpbMC4OTSFMZoTtlLgYtSVJtAS0x+r3cgSCpKmv618g=; b=bQ9WgCAot/P/8qFnc84c8ngX+4BvVUIiDDoRuNkfaKWVvpy0SOOqfIVOP2RRsY2Cik 2/R4bR/JRFB3RArl5CgurJbU2CKDglMaFGpOGQNz6KLReRMI3xKIBbMYpqUqXkexgtqf lkcQcKZppgtW8Ks2z19ogncaU1CVwVPHB0ysFfd78F5lUi+00f+A8jhYPdCj2BFs03tw /clFNWtP7c2QCQUaLGYDqLlpXKRkyzqbrW68NFPQamfMuB5Qm1l14N0zlS7dCGxzPsAn 8SG8ylith+uzxEejwzBmFCRCPjl1ME1xjiFTEv57kjZMaUMZuTcE6PYUDM+ho9zH0uVC k42A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lIeRmYoy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e67si15015040pfh.212.2019.02.12.03.32.57; Tue, 12 Feb 2019 03:33:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lIeRmYoy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728825AbfBLLcc (ORCPT + 99 others); Tue, 12 Feb 2019 06:32:32 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:35549 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbfBLLcc (ORCPT ); Tue, 12 Feb 2019 06:32:32 -0500 Received: by mail-pf1-f195.google.com with SMTP id z15so423144pfa.2; Tue, 12 Feb 2019 03:32:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=bpbMC4OTSFMZoTtlLgYtSVJtAS0x+r3cgSCpKmv618g=; b=lIeRmYoyS0iHyylExh+qYevCyVHA1IL6Z7NlqRydTtR0XYX474nmEva0l3G6vEmMnL /TEmRnGCU57BafkIyn/vZ0lm2lzWrAK8Mr6U8e3A9LyCbcpq2DKbBYsORnaW9isXyPpi YXGwnzQNd51r9W+jzYqc8d1PupCv4rPHI2Lw23OluAqIZCp/mjD9x+ziAA+PE+hLSUnM PCNKSeqGgimEGm/dkOh24FFNanmlInCpNFT+j1wRzU6mtqxDx6rLczrqn1/ZLKooio8r RKypyxtUCJpMGgtmWPFqio/Q5oqBjYoBMlG7mL3o5Svqx5IHrmppT2yfWQWCidLGrRiW UTBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bpbMC4OTSFMZoTtlLgYtSVJtAS0x+r3cgSCpKmv618g=; b=QZjCrI5Muvf+gV7Tam/Cw5+4543ACP5rBOvSywEMGbcsvJrEp+65TefPH7tUaZ0cq7 EvDHX4ubusfMe0oINUyQcdDdnxim/scZGuJlBAgs5zLz9oVVovW01ZKnFn0m7o096IS9 kMuw1rkdkJlBlaUM1WUr7+FxBFAFUovmaoI0gNBMZsLkdNnWJeS9rAh8q8baWWpdgEr7 afpHbzLJqa2WYMn12K0PIZW6KZ2P7GtWDQfV+7UCBGu+wsx32wE9k158oXPzrPxHe3bO suIFElu8cu+KhTYjFJyQneuELcs7k0DLT0upFkhTY48vPQ0sUE1K7w6KTWUWb5aQUNi8 B/4g== X-Gm-Message-State: AHQUAua3Gdc0vzt+j1yw2lZEjmz8ny0UymwRpi2/VgnXyrTf1q3LazcS bMnRwMxJi6AJyLdyKKMZQdI= X-Received: by 2002:a63:2d5:: with SMTP id 204mr1562585pgc.407.1549971151902; Tue, 12 Feb 2019 03:32:31 -0800 (PST) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id q21sm28701034pfq.138.2019.02.12.03.32.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 03:32:31 -0800 (PST) From: Yafang Shao To: daniel@iogearbox.net, ast@kernel.org Cc: yhs@fb.com, brakmo@fb.com, edumazet@google.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, shaoyafang@didiglobal.com, Yafang Shao Subject: [bpf-next 0/2] cleanup SOCK_DEBUG() and introduce BPF_SOCK_OPS_STATS_CB Date: Tue, 12 Feb 2019 19:31:35 +0800 Message-Id: <1549971097-12627-1-git-send-email-laoar.shao@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SOCK_DEBUG is a very ancient debugging interface, and it's not very useful for debugging. This pacthset cleanups SOCK_DEBUG() and replace it with a new methord based on BPF. I cleanup SOCK_DEBUG() only for TCP, and other protocols are kept as is. After this patchset, the SO_DEBUG interface will not take any effect for TCP, but I still keep it in sock_{s,g}etsockopt() for TCP to avoid breaking applications. In the future we may extend tcp_stats() as bellow or something else to cover all the LINUX_MIB_* and TCP_MIB_* proposaled[0] in the netconf2018. now: tcp_stats(struct sock *sk, int mib_idx) future: tcp_stats(struct sock *sk, int mib_idx, int packets) The argument packets can be 1 to indicates this is a event only; and skb_shinfo(skb)->gso_segs to indicates the number of packets are also concerned. [0] page 14, http://vger.kernel.org/netconf2018_files/BrendanGregg_netconf2018.pdf Yafang Shao (2): tcp: replace SOCK_DEBUG() with tcp_stats() bpf: add BPF_SOCK_OPS_STATS_CB for tcp_stats() include/uapi/linux/bpf.h | 5 +++++ include/uapi/linux/snmp.h | 3 +++ net/ipv4/proc.c | 3 +++ net/ipv4/tcp_input.c | 27 ++++++++++++--------------- net/ipv6/tcp_ipv6.c | 2 -- 5 files changed, 23 insertions(+), 17 deletions(-) -- 1.8.3.1