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 D0ABD43380; Mon, 20 Nov 2023 17:25:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD7DA42E1B; Mon, 20 Nov 2023 17:24:58 +0100 (CET) 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 7E60542DD2 for ; Mon, 20 Nov 2023 17:24:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700497496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PmH1XFF6Uknse6BlsKujx37NOzDriwAFZBeeZKf4kSU=; b=RiaK/soMQ94tzVxNfTmLXYgZF4+K5f5J3fYLI2V1Gq9aZpEqG92OS2JazkNyPWCmyhi+BL MtWkhP1BIbXgBRtLaOlHG+N/lcpodIavAvkg9JJ+p14EIAVqRMhb2GVszo4Ak59Q763r6g AdjfixaWcUG/9vuWXLIsdqT6J0tS1WU= 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-28-u0mPgMcENkKpcfYh_uLK-g-1; Mon, 20 Nov 2023 11:24:54 -0500 X-MC-Unique: u0mPgMcENkKpcfYh_uLK-g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 83C9C811E86 for ; Mon, 20 Nov 2023 16:24:54 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.208.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1230C2166B26 for ; Mon, 20 Nov 2023 16:24:53 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org Subject: [PATCH v2 2/3] usertools/rss: add --info flag Date: Mon, 20 Nov 2023 17:22:58 +0100 Message-ID: <20231120162256.74399-5-rjarry@redhat.com> In-Reply-To: <20231120162256.74399-4-rjarry@redhat.com> References: <20231023080710.240402-3-rjarry@redhat.com> <20231120162256.74399-4-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 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 -i 4 1.0.0.0 2.2.0.0/24 -k mlx 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 241ee4fe28c6..fd225a697f08 100755 --- a/usertools/dpdk-rss-flows.py +++ b/usertools/dpdk-rss-flows.py @@ -352,6 +352,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() @@ -360,6 +368,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: @@ -442,6 +453,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.42.0