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 9B4D843196; Wed, 18 Oct 2023 09:29:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 88B9240648; Wed, 18 Oct 2023 09:29:58 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 627424025F for ; Wed, 18 Oct 2023 09:29:57 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39I3uqau018813 for ; Wed, 18 Oct 2023 00:29:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=avztEMBViumxmfB93XE+icq48t4F0TZcIomj3euxMGM=; b=HY6coolxKXzOTQwGa31mK4KJOdsGYZXuogCAU1U/zP0Iw76eBCte8gOZ/+zKTJD7beh7 C54FwKBES7xVZiQlih618Yg7gOjAo82jBFo5taaKVj0LSJDzr2lTOaLTBY8Ob6l84hCd cUNUpcjPd0y9H9e0Ql6IzO40dgS52LBTlgDlcsaeUGjo0o4tsmvOQHoM8uLPC1ETHoNH d+7N48XB2JSFCwl/3RRaIoRKUJjf7cFYimCZcTIJ6ixh6TAJnb4tXYD48TGNxFUBluOp Em93Li6MS7/7kL3Fu5CZc6ZVEDBeby0qLJM/QAE8E2tdTRW+gUUoRnIdOxU1fTwTY9+h cQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3tstb3uvwj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 18 Oct 2023 00:29:56 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 18 Oct 2023 00:29:54 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 18 Oct 2023 00:29:54 -0700 Received: from localhost.localdomain (unknown [10.28.34.25]) by maili.marvell.com (Postfix) with ESMTP id 689203F7060; Wed, 18 Oct 2023 00:29:53 -0700 (PDT) From: To: CC: , Sunil Kumar Kori , Jerin Jacob Subject: [PATCH v3 1/1] usertools/rss: add CNXK RSS key Date: Wed, 18 Oct 2023 12:59:49 +0530 Message-ID: <20231018072949.69094-1-skori@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231009163610.1096092-1-skori@marvell.com> References: <20231009163610.1096092-1-skori@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: ChiiEf1eK24tEM4eU6y7FIBswpEIVF4H X-Proofpoint-GUID: ChiiEf1eK24tEM4eU6y7FIBswpEIVF4H X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-18_05,2023-10-17_01,2023-05-22_02 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 From: Sunil Kumar Kori This patch adds RSS key for CNXK platforms. CNXK platform uses 48 bytes long key for hash calculations. For the same patch also updates help mesaages to provide range information for supporting NICs/platforms. Also CNXK uses reta size as 64 so to get correct offset to retrieve queue index, user must pass reta_size option as 64 i.e. -t 64. Examples: $ ./dpdk-rss-flows.py -k cnxk 8 28.0.0.0/24 40.0.0.0/24 -t 64 SRC_IP DST_IP QUEUE 28.0.0.1 40.0.0.1 7 28.0.0.1 40.0.0.2 2 28.0.0.1 40.0.0.3 4 28.0.0.1 40.0.0.7 1 28.0.0.1 40.0.0.8 3 28.0.0.1 40.0.0.9 5 28.0.0.1 40.0.0.10 0 28.0.0.1 40.0.0.11 6 Signed-off-by: Sunil Kumar Kori Acked-by: Jerin Jacob --- v2..v3: - Fix key size range check. - Fix default key size file name. v1..v2: - Fix checkpatch errors. usertools/dpdk-rss-flows.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/usertools/dpdk-rss-flows.py b/usertools/dpdk-rss-flows.py index 73821eb471..937f9e1927 100755 --- a/usertools/dpdk-rss-flows.py +++ b/usertools/dpdk-rss-flows.py @@ -188,11 +188,24 @@ def balanced_traffic( 0x81, 0x15, 0x03, 0x66, ) ) +# default_key, see drivers/common/cnxk/roc_nix_rss.c +# Marvell's cnxk NICs take 48 bytes keys +RSS_KEY_CNXK = bytes( + ( + 0xfe, 0xed, 0x0b, 0xad, 0xfe, 0xed, 0x0b, 0xad, + 0xfe, 0xed, 0x0b, 0xad, 0xfe, 0xed, 0x0b, 0xad, + 0xfe, 0xed, 0x0b, 0xad, 0xfe, 0xed, 0x0b, 0xad, + 0xfe, 0xed, 0x0b, 0xad, 0xfe, 0xed, 0x0b, 0xad, + 0xfe, 0xed, 0x0b, 0xad, 0xfe, 0xed, 0x0b, 0xad, + 0xfe, 0xed, 0x0b, 0xad, 0xfe, 0xed, 0x0b, 0xad, + ) +) # fmt: on DEFAULT_DRIVER_KEYS = { "intel": RSS_KEY_INTEL, "mlx": RSS_KEY_MLX, "i40e": RSS_KEY_I40E, + "cnxk": RSS_KEY_CNXK, } @@ -201,8 +214,8 @@ def rss_key(value): return DEFAULT_DRIVER_KEYS[value] try: key = binascii.unhexlify(value) - if len(key) not in (40, 52): - raise argparse.ArgumentTypeError("The key must be 40 or 52 bytes long") + if len(key) not in range(40, 52): + raise argparse.ArgumentTypeError("The key must be 40 to 52 bytes long") return key except (TypeError, ValueError) as e: raise argparse.ArgumentTypeError(str(e)) from e @@ -299,7 +312,7 @@ def parse_args(): default=RSS_KEY_INTEL, type=rss_key, help=""" - The random 40-bytes key used to compute the RSS hash. This option + The random 40 to 52 bytes key used to compute the RSS hash. This option supports either a well-known name or the hex value of the key (well-known names: "intel", "mlx", default: "intel"). """, -- 2.25.1