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 0AB8A4233F; Mon, 9 Oct 2023 18:30:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF0074068E; Mon, 9 Oct 2023 18:30:42 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 6CBCE402B1 for ; Mon, 9 Oct 2023 18:30:41 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 399D8eGP026659 for ; Mon, 9 Oct 2023 09:30:40 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=f4CUMOWxGyKMkHa7Ov8ThkFZkE9bnzGtldpsYiP1Jbk=; b=aTJpcC4IOoYYE3BxCz+D8X86wb6wPTr8ES5iHM3z3GWiazqcdspjFvG4m37fARg5Kj35 TCbfocnpiGHaUK8oFAsl+CAJhtZwiK0Z4oiUJ4pN7piUkYS0C9zB6yAn/7uQ0Fm3RIqP X2v2pG2+eoKmxsgz5eYSwnwqNQwWURmew9wJCWKJ2s6aGSB36et4eLpr5EmRaYWukkTu 3RIvUf2vwAtOKKWsKpkICecZSU5GDS8/8sGIitNcqu3vf1J92VT+isqkPciIZksjCcuO FmT4MhmkO6ByCsnUT+CEcgWfMjehoqrbuqcVMn8iSsM1SsFQ6tOlwTCgMKQSOT1mRo3j hA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3tkh9smy5c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 09 Oct 2023 09:30:40 -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; Mon, 9 Oct 2023 09:30:38 -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; Mon, 9 Oct 2023 09:30:38 -0700 Received: from localhost.localdomain (unknown [10.28.34.25]) by maili.marvell.com (Postfix) with ESMTP id 84E9C3F70A3; Mon, 9 Oct 2023 09:30:37 -0700 (PDT) From: To: CC: , Sunil Kumar Kori Subject: [PATCH] usertools/rss: add CNXK RSS key Date: Mon, 9 Oct 2023 22:00:33 +0530 Message-ID: <20231009163033.1095213-1-skori@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: RbQlYZcc8y2rIk0mYlkViyTmEuLLMkSs X-Proofpoint-ORIG-GUID: RbQlYZcc8y2rIk0mYlkViyTmEuLLMkSs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-09_14,2023-10-09_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 Change-Id: I631639d74c0bf91759f8aa188836019b4990caf2 --- usertools/dpdk-rss-flows.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/usertools/dpdk-rss-flows.py b/usertools/dpdk-rss-flows.py index 73821eb471..b6edd7a2e0 100755 --- a/usertools/dpdk-rss-flows.py +++ b/usertools/dpdk-rss-flows.py @@ -188,11 +188,24 @@ def balanced_traffic( 0x81, 0x15, 0x03, 0x66, ) ) +# rss_key_default, see drivers/net/cnxk/cnxk_flow.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, } @@ -202,7 +215,7 @@ def rss_key(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") + 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