From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73F38C4708C for ; Fri, 28 May 2021 09:45:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 442EE613BA for ; Fri, 28 May 2021 09:45:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234456AbhE1Jqy (ORCPT ); Fri, 28 May 2021 05:46:54 -0400 Received: from mga03.intel.com ([134.134.136.65]:64277 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233627AbhE1Jqw (ORCPT ); Fri, 28 May 2021 05:46:52 -0400 IronPort-SDR: HBTuBQHQ/0t2y5zunYjqNRqYSXRHMjW8OMNMOz5trSJD+HwtWPZtcO45HZutHdik0DUfvipjVR gQhhFs8IoWHA== X-IronPort-AV: E=McAfee;i="6200,9189,9997"; a="202964727" X-IronPort-AV: E=Sophos;i="5.83,229,1616482800"; d="scan'208";a="202964727" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2021 02:45:18 -0700 IronPort-SDR: WE4PVVAbBZlVB5NlbLi6QHRXSH3Smvo5TU3dhnTl/PW347qWoMt8wZdrrO3tRKMmWUJtV+y6wq ttRWH4xJpHfA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,229,1616482800"; d="scan'208";a="548533848" Received: from ranger.igk.intel.com ([10.102.21.164]) by fmsmga001.fm.intel.com with ESMTP; 28 May 2021 02:45:13 -0700 Date: Fri, 28 May 2021 11:32:13 +0200 From: Maciej Fijalkowski To: Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= Cc: Xuan Zhuo , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Magnus Karlsson , Jonathan Lemon , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Willem de Bruijn , Xie He , Eric Dumazet , John Ogness , Wang Hai , Tanner Love , Eyal Birger , Menglong Dong , netdev@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH bpf-next] xsk: support AF_PACKET Message-ID: <20210528093213.GB46923@ranger.igk.intel.com> References: <1622192521.5931044-1-xuanzhuo@linux.alibaba.com> <87cztbgqfv.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87cztbgqfv.fsf@toke.dk> User-Agent: Mutt/1.12.1 (2019-06-15) Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Fri, May 28, 2021 at 11:25:56AM +0200, Toke Høiland-Jørgensen wrote: > Xuan Zhuo writes: > > > On Fri, 28 May 2021 10:55:58 +0200, Toke Høiland-Jørgensen wrote: > >> Xuan Zhuo writes: > >> > >> > In xsk mode, users cannot use AF_PACKET(tcpdump) to observe the current > >> > rx/tx data packets. This feature is very important in many cases. So > >> > this patch allows AF_PACKET to obtain xsk packages. > >> > >> You can use xdpdump to dump the packets from the XDP program before it > >> gets redirected into the XSK: > >> https://github.com/xdp-project/xdp-tools/tree/master/xdp-dump > > > > Wow, this is a good idea. > > > >> > >> Doens't currently work on egress, but if/when we get a proper TX hook > >> that should be doable as well. > >> > >> Wiring up XSK to AF_PACKET sounds a bit nonsensical: XSK is already a > >> transport to userspace, why would you need a second one? > > > > I have some different ideas. In my opinion, just like AF_PACKET can monitor > > tcp/udp packets, AF_PACKET monitors xsk packets is the same. > > But you're adding code in the fast path to do this, in a code path where > others have been working quite hard to squeeze out every drop of > performance (literally chasing single nanoseconds). So I'm sorry, but > this approach is just not going to fly. +1. Probably would be better for everyone if Xuan started a thread on list what is his need. > > What is your use case anyway? Yes, being able to run tcpdump and see the > packets is nice and convenient, but what do you actually want to use > this for? Just for debugging your application? System monitoring? > Something else? > > -Toke >