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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 616E9C19F29 for ; Wed, 27 Jul 2022 08:01:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230161AbiG0IBP (ORCPT ); Wed, 27 Jul 2022 04:01:15 -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> Precedence: bulk List-ID: X-Mailing-List: io-uring@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