Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp264410rwe; Fri, 14 Apr 2023 02:22:11 -0700 (PDT) X-Google-Smtp-Source: AKy350YD5yz/kHPCC+LDQUnCNIHLqAPLCCqSJjClhSRKophkq8r8ytTDWyckDaQnBaVO1Zwu3/JD X-Received: by 2002:a05:6a00:1903:b0:625:efa4:4c01 with SMTP id y3-20020a056a00190300b00625efa44c01mr7968701pfi.3.1681464131600; Fri, 14 Apr 2023 02:22:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681464131; cv=none; d=google.com; s=arc-20160816; b=fziVp2rqKhy8V66fxHwmO/kPd+OtzUPmOLSoICInjml2HVERcKt1WPF6w7wI8Tr1qw 5C3q7Hdm9NRGU5wWhs0TyMcq5bmgvOpFqGzLP8JK2/h+yqYz8bvgz4MMXTLvXUehqFcn MgotStxVJg3z/qV8p2d5uBG+TRp9DH75rW0fDr/WyVLaBXgT8PpjlqwK15oUuMPF6aVi Y2u2WnPL7Fy2/rvwmNLvhdy/f5D2nZggl1tYec5LgN0bVgvCLuYN7acC/CyTQax2l/5I E0PXSnVMxUebsUvDiALS5B1UNlOKPOPMaArrflcFIopAmCpIs1o5xMTfguXV01P9qs9j /9DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=BZMgCcf0+fxLcOwKjw3Au4d2n4Vk5uVRWfcU7aLG2ig=; b=OmHN34WCng5M0S8ziR6zLi1fOmgi6fEIWWYQbUqPMrLilfAQLWCcOBXa/01jROzlOH JuhaP9vkrKFNxY+RM6ZjTWfCC8eToZM9Y2/eJbKEasPd8UrTkJNxsTaEVdkp6/aQoQK3 QfyuqFM5leKbUaF2c87aWnlXNf6nDXJF8aneKjUAsTpKAmsE247RCfF656H6ctPtzTrX bKKata7Vg8ywoUVaAH/3sfAxsWp9QFmWdR20ut1veXaimD+GsC4udjZ2ZibuF5dRY+E0 GafuenZyb9r/ZSxmhYNyUhosy/YoPxeeT4iriVqeWGeHLUFbDzgQ89XRL9vVq4d0PXTf CmHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dectris.com header.s=google header.b=Yn1F7CgB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dectris.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w23-20020aa79557000000b0062af960641dsi3986828pfq.255.2023.04.14.02.22.00; Fri, 14 Apr 2023 02:22:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@dectris.com header.s=google header.b=Yn1F7CgB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dectris.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229722AbjDNJEP (ORCPT + 99 others); Fri, 14 Apr 2023 05:04:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbjDNJEO (ORCPT ); Fri, 14 Apr 2023 05:04:14 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6567E525A for ; Fri, 14 Apr 2023 02:04:11 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id qb20so43526205ejc.6 for ; Fri, 14 Apr 2023 02:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dectris.com; s=google; t=1681463050; x=1684055050; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=BZMgCcf0+fxLcOwKjw3Au4d2n4Vk5uVRWfcU7aLG2ig=; b=Yn1F7CgBNrgmAxnsA0PUp8yE8phRcPg60L7TzSsR4ckDpB1PIl0PRtJdYq1TxPrIWb Q9NPnVFJlljDjF4yFpt5sQfTXHOYy4jCqXNqyY+kFNVgFuSyUpReYUnKauUwN46uY2Pu tnMyNY3fzysgj6eUFcjGlm/uMCw3IlpDr4IP4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681463050; x=1684055050; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BZMgCcf0+fxLcOwKjw3Au4d2n4Vk5uVRWfcU7aLG2ig=; b=aeNcebaShhdt+DVgXSJo7bQz+vbG99Cjgk7zlZobXkELlbdlZlKMIT4kdwczwetqzO X+dOqWgx72JOM5zRi8ox5Hmnz5dr1YlZhqUpVJpTnC+pT6CT3S/usBNIgRl+hh2V0uQe BzMXq3BCEolLczhSChYrTuLXxiuTmxi4S+a/l1kW7cWW09gG0CysFHc+yW8owGcLHtaT ZNUyrjjMJvNTjj9ns8vwZgUN9sLpi5DlyJJM6lCTVp7G6fbo8X2ZHJWRnP4lWQOt4rRi xXlluY07kBi6etLbeMHUOHCFMVmDhtWaue73sor4Bf9kySnwcG7NgnLKk6JlhDJs28Bj zZrA== X-Gm-Message-State: AAQBX9eHodFKi5CXLf8pOQ0DRmNyTRGa9cjIocezjrlSyCqNp0I5A6wv A4LsIW6IUYWT8mx+cO7w+lze3/LzIv1gvSGybdv3Mw== X-Received: by 2002:a17:907:3da9:b0:8f1:4cc5:f14c with SMTP id he41-20020a1709073da900b008f14cc5f14cmr2953696ejc.0.1681463049818; Fri, 14 Apr 2023 02:04:09 -0700 (PDT) MIME-Version: 1.0 References: <20230406130205.49996-1-kal.conley@dectris.com> <20230406130205.49996-2-kal.conley@dectris.com> <87sfdckgaa.fsf@toke.dk> <875ya12phx.fsf@toke.dk> <87ile011kz.fsf@toke.dk> <87o7nrzeww.fsf@toke.dk> <87edonzaac.fsf@toke.dk> In-Reply-To: <87edonzaac.fsf@toke.dk> From: Kal Cutter Conley Date: Fri, 14 Apr 2023 11:08:53 +0200 Message-ID: Subject: Re: [PATCH bpf-next v3 1/3] xsk: Support UMEM chunk_size > PAGE_SIZE To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Cc: Maciej Fijalkowski , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Jonathan Lemon , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > >> "More annoying" is not a great argument, though. You're basically saying > >> "please complicate your code so I don't have to complicate mine". And > >> since kernel API is essentially frozen forever, adding more of them > >> carries a pretty high cost, which is why kernel developers tend not to > >> be easily swayed by convenience arguments (if all you want is a more > >> convenient API, just build one on top of the kernel primitives and wrap > >> it into a library). > > > > I was trying to make a fair comparison from the user's perspective > > between having to allocate huge pages and deal with discontiguous > > buffers. That was all. > > > > I think the "your code" distinction is a bit harsh. The kernel is a > > community project. Why isn't it "our" code? I am trying to add a > > feature that I think is generally useful to people. The kernel only > > exists to serve its users. > > Oh, I'm sorry if that came across as harsh, that was not my intention! I > was certainly not trying to make a "you vs us" distinction; I was just > trying to explain why making changes on the kernel side carries a higher > cost than an equivalent (or even slightly more complex) change on the > userspace side, because of the UAPI consideration. No problem! I agree. I am just somewhat confused by the "slightly more complex" view of the situation. Currently, packets > 4K are not supported _at all_ with AF_XDP. So this patchset adds something that is not possible _at all_ today. We have been patiently waiting since 2018 for AF_XDP jumbo packet support. It seems that interest in this feature from maintainers has been... lacking. :-) Now, if I understand the situation correctly, you are asking for benchmarks to compare this implementation with AF_XDP multi-buffer which doesn't exist yet? I am glad it's being worked on but until there is a patchset, AF_XDP multi-buffer is still VAPORWARE. :-) Now in our case, we are primarily interested in throughput and reducing total system load (so we have more compute budget for other tasks). The faster we can receive packets the better. The packets we need to receive are (almost) all 8000-9000 bytes... Using AF_XDP multi-buffer would mean either (1) allocating extra space per packet and copying the data to linearize it or (2) rewriting a significant amount of code to handle segmented packets efficiently. If you want benchmarks for (1) just use xdpsock and compare -z with -c. I think that is a good approximation... Hopefully, the HFT crowd can save this patchset in the end. :-) -Kal