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 53154C05027 for ; Wed, 1 Feb 2023 14:55:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232195AbjBAOzM (ORCPT ); Wed, 1 Feb 2023 09:55:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231863AbjBAOzI (ORCPT ); Wed, 1 Feb 2023 09:55:08 -0500 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACE2D66015 for ; Wed, 1 Feb 2023 06:55:07 -0800 (PST) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-4b718cab0e4so249010757b3.9 for ; Wed, 01 Feb 2023 06:55:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4kUhgzVLbq5TTqoBaW+IZPj4jPZOzB9NcxbeByCDCyg=; b=KDdI4VU92boIqg2QbRBokocVoXYQOFdLbGrtPmL3QxFfxyXRbQLv8NrBxGQckL4/IF YktxUdYNAodd6AX/6XImbtGXLJhz5/VxvKZgJBIcaBquB71sWBSGGq9gAvln4eLhK0Tr DmocZbUeeG1I+iBqsstoHwTZZcJkQrkQbhLeOHwnpoHVKKux42krZMM4ihegUWgWF2Ek e9BXtCGlPN45AOQDtM+mdWpaTHZkw3LDcA0M2mD9x+QhcQWWn2GO7tbLvBLBRqZkwquC KfNMCYP7t8QlApvkILx3XMNAE2w7DXf59mM4fXKdlBwMB0BQiLSA4wUHKMN6e5qgHxYW gzNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=4kUhgzVLbq5TTqoBaW+IZPj4jPZOzB9NcxbeByCDCyg=; b=2DQUcRaAZvTBgFSK0AQJ6BpVZGepd3rE7f8AJ2wftreaDjKXEl4510+VEeHTX19/JB 5ckheMgik/xgT8EBI4fMpKcKpC42SZ6vKxJ//SKB10l8Z5Ig5iZ1jhleiAGgHKDiPcPv Po1arlCtCWtOL57RV9Q49ZPl3UK2F0UqQhHr3e+JDdSQKB9vgP7pdWZD/uR2++4zaztk pGwhgWXB2u3j3hBF6j+FFfePXHDi8MKCdVZWtupjfGKuLsIHKQYXoZfQ3mhZ/sDokhZu YJIOTAdMTPapD0grQehEffEJWbqKO+k2y+LFi/4M+fQ3/UzE/5CblVsPSYF+z/203UQE +CRA== X-Gm-Message-State: AO0yUKVsSUjl4QhHniPMai0GQZ5qxHoJmu2JCeBQr+3I54o8p56xS+iO t4CV040VMfcOt25rGsBpO6kngxE2cApWX4w7PW39/Q== X-Google-Smtp-Source: AK7set8BkTA6xt1F9+12u+EWNEk+E1PMAcxDO5AX2ydNT9vjP9578y5fPLvRaHtqZ0jsF+m7Z4l7+3556NiyRZdQX3s= X-Received: by 2002:a81:92c6:0:b0:506:3a02:ccfe with SMTP id j189-20020a8192c6000000b005063a02ccfemr261363ywg.385.1675263306804; Wed, 01 Feb 2023 06:55:06 -0800 (PST) MIME-Version: 1.0 References: <20230201001612.515730-1-andrei.gherzan@canonical.com> <20230201001612.515730-4-andrei.gherzan@canonical.com> In-Reply-To: <20230201001612.515730-4-andrei.gherzan@canonical.com> From: Willem de Bruijn Date: Wed, 1 Feb 2023 09:54:30 -0500 Message-ID: Subject: Re: [PATCH net v4 4/4] selftests: net: udpgso_bench_tx: Cater for pending datagrams zerocopy benchmarking To: Andrei Gherzan Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Fred Klassen , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 31, 2023 at 7:19 PM Andrei Gherzan wrote: > > The test tool can check that the zerocopy number of completions value is > valid taking into consideration the number of datagram send calls. This can > catch the system into a state where the datagrams are still in the system > (for example in a qdisk, waiting for the network interface to return a > completion notification, etc). > > This change adds a retry logic of computing the number of completions up to > a configurable (via CLI) timeout (default: 2 seconds). > > Fixes: 79ebc3c26010 ("net/udpgso_bench_tx: options to exercise TX CMSG") > Signed-off-by: Andrei Gherzan > Cc: Willem de Bruijn > Cc: Paolo Abeni Reviewed-by: Willem de Bruijn > --- > tools/testing/selftests/net/udpgso_bench_tx.c | 34 +++++++++++++++---- > 1 file changed, 27 insertions(+), 7 deletions(-) > > diff --git a/tools/testing/selftests/net/udpgso_bench_tx.c b/tools/testing/selftests/net/udpgso_bench_tx.c > index b47b5c32039f..477392715a9a 100644 > --- a/tools/testing/selftests/net/udpgso_bench_tx.c > +++ b/tools/testing/selftests/net/udpgso_bench_tx.c > @@ -62,6 +62,7 @@ static int cfg_payload_len = (1472 * 42); > static int cfg_port = 8000; > static int cfg_runtime_ms = -1; > static bool cfg_poll; > +static int cfg_poll_loop_timeout_ms = 2000; > static bool cfg_segment; > static bool cfg_sendmmsg; > static bool cfg_tcp; > @@ -235,16 +236,17 @@ static void flush_errqueue_recv(int fd) > } > } > > -static void flush_errqueue(int fd, const bool do_poll) > +static void flush_errqueue(int fd, const bool do_poll, > + unsigned long poll_timeout, const bool poll_err) > { > if (do_poll) { > struct pollfd fds = {0}; > int ret; > > fds.fd = fd; > - ret = poll(&fds, 1, 500); > + ret = poll(&fds, 1, poll_timeout); > if (ret == 0) { > - if (cfg_verbose) > + if ((cfg_verbose) && (poll_err)) small nit: unnecessary parentheses