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 62989C38142 for ; Tue, 31 Jan 2023 22:16:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231130AbjAaWQq (ORCPT ); Tue, 31 Jan 2023 17:16:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjAaWQo (ORCPT ); Tue, 31 Jan 2023 17:16:44 -0500 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B2A746167 for ; Tue, 31 Jan 2023 14:16:42 -0800 (PST) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 2AF6D421FC for ; Tue, 31 Jan 2023 22:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1675203399; bh=3LEsGOPfaWLvr4rWba86yn4WIRMiISgxju1CpktcCjc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=KVXMjjv6Tn6BrWBhdN/0riJ+crbzZZ6I71EWEtw9+4xywkQjMbZGsKdT5IvJ3Htll N5UR9IrSq73zOs7LDIqIdrLKGhAajPN4bTU86LlVysHAsDkaEJjv1/Ikd+X+8GI1DC zAD0NpBZhuApVSH/kQCem4imAwnE3rYT3siM1bTVN3PLMe9NMuh3RJxGh7fbP1xIqL 0WXLVqupAGP8wQWUzUFkoyxxddSZb7YbiCV8V/gbhE1cF/CFYJh1q7ZiUY4Fc14Cwo CP1OkE30pE7rF30hEcaerxrrRk02H+e0bfWwykSjZ0Gm0waDtwCTXoY8lhupkkXNWk t01xL9raESwvA== Received: by mail-wm1-f71.google.com with SMTP id bd21-20020a05600c1f1500b003dc5cb10dcfso3234616wmb.9 for ; Tue, 31 Jan 2023 14:16:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3LEsGOPfaWLvr4rWba86yn4WIRMiISgxju1CpktcCjc=; b=IFaAFN2le2ipKVYFzFat6RN5TNWP+bYImPSC87va1RLoz1+SLxZUsklQYxJKWdK5CF llVbatkP4GPFEs3uXPiU9gjRY4qpfEktLs+4g6yMiqccc/x5ree4KDryWDWvomR+Vq/v uRGn9aNUYNO6kRpqyT9Du4nscv8ZbSEAeM6etDLyiD7Y5J2UwvnhNZNdBBBr91PKPcgu rEU4tkdpPeCPy0jDpCMAahFbY8nZswizlS7Ljzce2QFnOW4SQDBuLWrD6kwFLhaNCL5n SYH81Fs2lX2t0Wwxyg0vc0szNYQSwNcDXeckk40nlkvf/N9TMs6LSYuhi7jhpNYU+snY kKhw== X-Gm-Message-State: AO0yUKWNgKvYsPLX6DTHn/TwXnun93m9MGD99oYADDVmnDgnVDHMWrK8 3+FWjtQ23Jc9iIpf7KMUhqDLK3MKT1NfaeZdDElzvEAfyOakjon18ROhm+6ZdGaHO/Mf9f4M+jS qkM510Vvxnx69KNkfuEt4RZyJ6R+ytoEbpSynUAnLEA== X-Received: by 2002:a05:6000:78e:b0:2bf:bd69:234a with SMTP id bu14-20020a056000078e00b002bfbd69234amr557215wrb.1.1675203398811; Tue, 31 Jan 2023 14:16:38 -0800 (PST) X-Google-Smtp-Source: AK7set/lLbaZ/D3uEBeeWj1ztr3m9PU6oxrO8Aw1mQVoXGJAEXY6mmm1ITFn3HWksaCmXOb8EwiiaA== X-Received: by 2002:a05:6000:78e:b0:2bf:bd69:234a with SMTP id bu14-20020a056000078e00b002bfbd69234amr557209wrb.1.1675203398639; Tue, 31 Jan 2023 14:16:38 -0800 (PST) Received: from qwirkle ([81.2.157.149]) by smtp.gmail.com with ESMTPSA id y8-20020adfdf08000000b002bfb31bda06sm16905072wrl.76.2023.01.31.14.16.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 14:16:38 -0800 (PST) Date: Tue, 31 Jan 2023 22:16:36 +0000 From: Andrei Gherzan To: Willem de Bruijn 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 Subject: Re: [PATCH net-next v3 4/4] selftests: net: udpgso_bench_tx: Cater for pending datagrams zerocopy benchmarking Message-ID: References: <20230131210051.475983-4-andrei.gherzan@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/01/31 04:51PM, Willem de Bruijn wrote: > On Tue, Jan 31, 2023 at 4:01 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 > > --- > > 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..ef887842522a 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) > > nit: his indentation looks off though This one I've missed but I couldn't find any guidelines on it. Could you clarify to me what this should be or point me to soem docs? Happy to fix otherwise. I'm currently using vim smartindent but it is definitely not in line with what is here already. > > > { > > 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)) > > fprintf(stderr, "poll timeout\n"); > > } else if (ret < 0) { > > error(1, errno, "poll"); > > @@ -254,6 +256,20 @@ static void flush_errqueue(int fd, const bool do_poll) > > flush_errqueue_recv(fd); > > } -- Andrei Gherzan