Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp118112imn; Wed, 27 Jul 2022 01:09:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1smZe3pp867vajIG4QfKGkE5LMa4YAJZe/KkYeYQkZe16obQ9BeghQbRsjD8QeXYeHNVFzp X-Received: by 2002:a17:902:8e89:b0:16d:69b7:49b4 with SMTP id bg9-20020a1709028e8900b0016d69b749b4mr15137987plb.167.1658909363670; Wed, 27 Jul 2022 01:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658909363; cv=none; d=google.com; s=arc-20160816; b=T+0ql08X10lvDRyVy2Ei9Djz9MY7Q8dm2JPt0/7bIB+BIAyzweUjxu/PJBSsvHcjPs mNcVGxsMT0JV7G5Hjn+MuwodAa+8ZvOpRlnRcZMtLXY0dxTOkqvicrnjRqJrvaKzShWP jO0WCZtagNf+sh5/84rLqZ3UrvIp+biVt3K9/11TkqoekD24UrDK5NEVzHhJ2+gnRq8t KYnypfAc4cQjy64vMPJUY7kqAqeVu41ax//+Sk9wKISwEZ46nQF/DzdFxP0gUYoaAhnB dXIeE/ONjfMaCVdpr/j3vKxUmXykKQBIiDWY47htyHI6fDkc88UrhonKZ82kC+ia1Yfd BgDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date; bh=EwmvjEAIEUVvQMiufqJcQGqguJyolEDOKC3Zwey4t50=; b=mqsPu7QIhLixVliIKUCezYhtnLT3q7S78cun/eXqKcNPbEIWn0ppBuvrwtTrOiDZ4y aHtaIFrGsJe9CilcsGOJXuBHqot43VxfLN8+o0vkRnGf+ehqtxqelomwFL4XbQDKwPxw X6IBoSJlrvP6DHFXgn05qH1w4Vx9wf6GxnSwnShqwizpwnN9BLh+4Tli+n5dcc7sE96k 8+wRGrHJSuUciGAbNgOqzb6luRZaqPW7orjgpknBVdSQ6GMYgodrUooYMniklZ+pzAAe 8/Qx3hrAV82QW/bqrKs/RRYzku9oaI7HF70ZR+7ii9I+iJnmuQmkt3pmvN/GcZvjKUWD nfvA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f184-20020a636ac1000000b0041a626b7157si20097931pgc.832.2022.07.27.01.09.07; Wed, 27 Jul 2022 01:09:23 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230372AbiG0IBQ (ORCPT + 99 others); Wed, 27 Jul 2022 04:01:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbiG0IBO (ORCPT ); Wed, 27 Jul 2022 04:01:14 -0400 Received: from out30-42.freemail.mail.aliyun.com (out30-42.freemail.mail.aliyun.com [115.124.30.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C1A9422E8; Wed, 27 Jul 2022 01:01:09 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=dust.li@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0VKa60au_1658908862; Received: from localhost(mailfrom:dust.li@linux.alibaba.com fp:SMTPD_---0VKa60au_1658908862) by smtp.aliyun-inc.com; Wed, 27 Jul 2022 16:01:02 +0800 Date: Wed, 27 Jul 2022 16:01:01 +0800 From: "dust.li" To: Pavel Begunkov , io-uring@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "David S . Miller" , Jakub Kicinski , Jonathan Lemon , Willem de Bruijn , Jens Axboe , David Ahern , kernel-team@fb.com Subject: Re: [PATCH net-next v5 27/27] selftests/io_uring: test zerocopy send Message-ID: <20220727080101.GA14576@linux.alibaba.com> Reply-To: dust.li@linux.alibaba.com References: <03d5ec78061cf52db420f88ed0b48eb8f47ce9f7.1657643355.git.asml.silence@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <03d5ec78061cf52db420f88ed0b48eb8f47ce9f7.1657643355.git.asml.silence@gmail.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham 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 On Tue, Jul 12, 2022 at 09:52:51PM +0100, Pavel Begunkov wrote: >Add selftests for io_uring zerocopy sends and io_uring's notification >infrastructure. It's largely influenced by msg_zerocopy and uses it on >the receive side. > >Signed-off-by: Pavel Begunkov >--- > tools/testing/selftests/net/Makefile | 1 + > .../selftests/net/io_uring_zerocopy_tx.c | 605 ++++++++++++++++++ > .../selftests/net/io_uring_zerocopy_tx.sh | 131 ++++ > 3 files changed, 737 insertions(+) > create mode 100644 tools/testing/selftests/net/io_uring_zerocopy_tx.c > create mode 100755 tools/testing/selftests/net/io_uring_zerocopy_tx.sh > >diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile >index 7ea54af55490..51261483744e 100644 >--- a/tools/testing/selftests/net/Makefile >+++ b/tools/testing/selftests/net/Makefile >@@ -59,6 +59,7 @@ TEST_GEN_FILES += toeplitz > TEST_GEN_FILES += cmsg_sender > TEST_GEN_FILES += stress_reuseport_listen > TEST_PROGS += test_vxlan_vnifiltering.sh >+TEST_GEN_FILES += io_uring_zerocopy_tx > > TEST_FILES := settings > >diff --git a/tools/testing/selftests/net/io_uring_zerocopy_tx.c b/tools/testing/selftests/net/io_uring_zerocopy_tx.c >new file mode 100644 >index 000000000000..9d64c560a2d6 >--- /dev/null >+++ b/tools/testing/selftests/net/io_uring_zerocopy_tx.c >@@ -0,0 +1,605 @@ >+/* SPDX-License-Identifier: MIT */ >+/* based on linux-kernel/tools/testing/selftests/net/msg_zerocopy.c */ >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+ >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+ >+#define NOTIF_TAG 0xfffffffULL >+#define NONZC_TAG 0 >+#define ZC_TAG 1 >+ <...> >+static void do_test(int domain, int type, int protocol) >+{ >+ int i; >+ >+ for (i = 0; i < IP_MAXPACKET; i++) >+ payload[i] = 'a' + (i % 26); >+ do_tx(domain, type, protocol); >+} >+ >+static void usage(const char *filepath) >+{ >+ error(1, 0, "Usage: %s [-f] [-n] [-z0] [-s] " >+ "(-4|-6) [-t