From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 59C69431E0; Mon, 23 Oct 2023 10:08:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4AF68406A2; Mon, 23 Oct 2023 10:08:49 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id A5015406A2 for ; Mon, 23 Oct 2023 10:08:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698048527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LaWW/kamWKVcXBodWTtBCxlvjgQ2ctgeZ8Rs1r5rWLk=; b=Kv3bb5gE65p6gGCMNJWX7uw+2wRhhkm+S3f56TmEsLOm4RBTIwdUSatNd3mi4J8pqnsOcS vipxAQbnPOuK6Exl4S1BtjjVd1M4Hqrg7ofXvkgg5EU/9Jhs/6R44nDWRM8Qcp1OpjFIbP 3J/X1MEqt0X0khiyUKE40Vdkz64DAMo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-642-JCLjLH7PPja_3sltIR-JtA-1; Mon, 23 Oct 2023 04:08:22 -0400 X-MC-Unique: JCLjLH7PPja_3sltIR-JtA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id A0254857CFA; Mon, 23 Oct 2023 08:08:21 +0000 (UTC) Received: from ringo.redhat.com (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B8A1492BFB; Mon, 23 Oct 2023 08:08:20 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org Cc: skori@marvell.com, thomas@monjalon.net, jerinjacobk@gmail.com, Robin Jarry Subject: [PATCH 2/2] usertools/rss: add --info flag Date: Mon, 23 Oct 2023 10:07:12 +0200 Message-ID: <20231023080710.240402-4-rjarry@redhat.com> In-Reply-To: <20231023080710.240402-3-rjarry@redhat.com> References: <20231023080710.240402-3-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add a flag to print the RSS key and RETA size that are used to compute balanced traffic. Example: $ usertools/dpdk-rss-flows.py 4 1.0.0.0 2.2.0.0/24 -k mlx --info RSS key: 2cc681d15bdbf4f7fca28319db1a3e946b9e38d92c9c03d1ad9944a7d… RETA size: 4 SRC_IP DST_IP QUEUE 1.0.0.0 2.2.0.1 2 1.0.0.0 2.2.0.2 0 1.0.0.0 2.2.0.4 1 1.0.0.0 2.2.0.6 3 The flag is only available with the default text output. Signed-off-by: Robin Jarry --- usertools/dpdk-rss-flows.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/usertools/dpdk-rss-flows.py b/usertools/dpdk-rss-flows.py index dfdad33dde8a..cc5d4d22096f 100755 --- a/usertools/dpdk-rss-flows.py +++ b/usertools/dpdk-rss-flows.py @@ -351,6 +351,14 @@ def parse_args(): Output in parseable JSON format. """, ) + parser.add_argument( + "-i", + "--info", + action="store_true", + help=""" + Print RETA size and RSS key above the results. Not available with --json. + """, + ) args = parser.parse_args() @@ -359,6 +367,9 @@ def parse_args(): f"{args.ip_src} and {args.ip_dst} don't have the same protocol version" ) + if args.json and args.info: + parser.error("--json and --info are mutually exclusive") + if args.rss_key in DEFAULT_DRIVERS: driver_info = DEFAULT_DRIVERS[args.rss_key] else: @@ -441,6 +452,11 @@ def main(): cells.append(r) rows.append(tuple(cells)) + if args.info: + print(f"RSS key: {binascii.hexlify(args.rss_key).decode()}") + print(f"RETA size: {args.reta_size}") + print() + fmt = [f"%-{w}s" for w in widths] fmt[-1] = "%s" # avoid trailing whitespace fmt = " ".join(fmt) -- 2.41.0