From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0049.outbound.protection.outlook.com [104.47.0.49]) by dpdk.org (Postfix) with ESMTP id 631438E71 for ; Tue, 8 May 2018 19:07:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5QJwAQPjRkc4y9hOM4dDIn3R3Ny3pfh9f422md3PN0U=; b=n+Ty19uABRPrUthUnQnjrgPrHPK1MT+8qm0qiff6WYlvBDcCHhhs3CZWQvpKudbq+HMnoLFwM+tTTBvsYATqPL89sZgVmf2t/X90txF5+16y3NdJUA3EJBy5ez3k/0YBoUoBN3wR2K/k0fIY478I1z2gaekZHHKfcTR1sOBnuic= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by DB6PR0501MB2311.eurprd05.prod.outlook.com (2603:10a6:4:4c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Tue, 8 May 2018 17:07:51 +0000 From: Ophir Munk To: dev@dpdk.org, Pascal Mazon Cc: Thomas Monjalon , Olga Shern , Ophir Munk , Shahaf Shuler Date: Tue, 8 May 2018 17:07:35 +0000 Message-Id: <1525799255-31309-1-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1525798311-30253-1-git-send-email-ophirmu@mellanox.com> References: <1525798311-30253-1-git-send-email-ophirmu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR04CA0086.eurprd04.prod.outlook.com (2603:10a6:803:64::21) To DB6PR0501MB2311.eurprd05.prod.outlook.com (2603:10a6:4:4c::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DB6PR0501MB2311; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2311; 3:mRR7fxgz2W3dzISjT3yOUk7cZqYR+nLN9loseQx88zMkMtUH4NQFIwOJ8NI/hlycKWyh26tuR+xIq4axZVPxD9Le6eWYhvD6wVokCH+HZnBr9mIjJHzo+9rK2GPwj0eVq2z3IH/0+L0N3xeb2QsFXWHvEoxw56maGhGXKOFZOsQl1fIZqT2BIMjfEGYRWpyQTclbpyKcAIppGNDsgtp8bAZ8vBLAjDjPSoWGsqKqiy6NZRC7BRCokVL46J+Ugn2i; 25:o8DNZ9slx6EAMfTAcs+VK2aLi8s5yyx0QYfKnrmiPTeXVJv7wzCBYYt7Gfm6nqBkjnyu//gPtsi6R8Fo8XwrNBR+ZIqAZFDuIlALAOrjHiJ3lxku6IdJKV2VP73msRGn50RD42S8RsWIez/L+2PwfEA9e725yKjOOl/vx+sHDZo7cT1HJoC2O1g5wcEehjUMZ1YH25WzzGRL2yAeO7CHSRKSUicQEzJRRyZNcq+4Psuxfyc05INKZo9j77bCxyk2mK8gU0fdfQm9WGFVtqbxiUQFlQnRpBp9XoipEFDNZJiQZKuiTlOhMA+BC1jBGiqn2dCbavPBh4oqzk2RJOCKVw==; 31:lsAAC0m/ZUmM3m8GbnUHsGbNl/VdIUudiENDU8l92LbTsRB0ud+SrYA3oHANBRPtQJKsHVRCvoO/d29V6IominDe4ywlKoBQZPWxK0QQxJk9ZlJhz7/QGAWQxLVlQR823oBZlivNZHqjeZiLC+fUx3cgY+nmb9pywHemzrJFDFzvsVfQyhqPDuDe0IweS9Y9q/49zG3RbZa0N/YSmiPapqAZbqKv+pTaxXRDTd3J5lg= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2311: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2311; 20:j0P3OYrC+z7F7ZkDgZtAa4Dw26jr/ff+QGpoA8vu0XsIdz/f0XFrs5e1GuKHKisJFyTXN1AmLRgg4xsHdPi1tEqUiRnMhRgF3IxL9Df0FVSJ2GaKFWoa2kT3u+WYiKF+CBdWkiIIBzc6Gjv9edpWEkXbHhRe5YdtsHCgVpopAnPUaMlPUax1P50Q/78nCYAK8F14hpxhpWf7Rp61XdpYMW1wXJMG88gd125vDVoyEyMD9UGJqadKch3XjK68dkICcjU7KRrMZn7N3F3cPUMJOIw9XSMd2/6ual9IsNFPRfOVZo6v/2Ov8HtKIuAkx3IZR3c45Hn3LOei0I+lVOMGqAwD0qtRN+y71Gi98lOMa2QUxTrnuAcWcmh4zbEma7Qh50AiUfUxqht9aE+hPhlKR4zrxfl2zq1qZWSrWQGvet0ZDoP3SaYOfYC+/5pshgHv/34ogJhhailIeZAtSqRU0n2QAGQ1xnvBCGnVl+WHhxYlG/eNeFGZU6klUJOdYMgZ; 4:rT8oJ7rLcMDafcd/6idJaQfgl4pXXSJoA+acC9320PxC8O+FcqVIOBlF7vl0avn/YGSdivQS2866TMeV6e3EU/IOcpJmGRVjY/FGwCwkPqnGw/4rejvmx51ElgdvIjKKn8c7uMBop6TMB+iRKjQOmtxz1ylT8Dz7F/JFBctHtOUMN5JrAXkwOfHt0jnsYbW7El4cs3zpK1z59xsYFHYv9et3LBNhhH6DpD6w5o4tNegF2qtkyTkZHEqA+mipnNyO1kpKr1hwCekInLyfWw3KxudHokW5bGAyltscldv0AIzht8/sZ0ZqJMVphKzCRdHF X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(20558992708506); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:DB6PR0501MB2311; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2311; X-Forefront-PRVS: 0666E15D35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(366004)(396003)(39380400002)(39860400002)(199004)(189003)(50466002)(5660300001)(66066001)(68736007)(48376002)(6666003)(6916009)(33026002)(2906002)(4720700003)(16526019)(76176011)(305945005)(59450400001)(7696005)(52116002)(386003)(186003)(36756003)(26005)(956004)(51416003)(69596002)(105586002)(2616005)(476003)(486006)(106356001)(55016002)(11346002)(446003)(4326008)(97736004)(25786009)(47776003)(6116002)(53936002)(316002)(478600001)(16586007)(3846002)(86362001)(8676002)(81156014)(7736002)(21086003)(81166006)(107886003)(8936002)(54906003)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2311; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:3; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0501MB2311; 23:+vJ6HVYCxOIr80AnQxq0Lrx2qSkMy1B6qlt9dje?= =?us-ascii?Q?ee2f8SHb4LVdYnPsYSk9p4ZksPMLM3hCsnD+7MPKBfkLIgFYebkPMgebjEfV?= =?us-ascii?Q?mLEUs7KpFJ7JkmbnS7Wdt535vzQBkGyq1gojiEXJxLVqmNM31yFz72Y78VGQ?= =?us-ascii?Q?4jopxTXI78st9qaDaeXEfT4ebbIkORBZUoqdWilON8qW9cAlGZmQzbHHKgyj?= =?us-ascii?Q?ubGtOo3eft4pZNDOeMyVKp2P0qVrgyRqFX5N+zFbrqn1FGaPXRt1xSYlWbXj?= =?us-ascii?Q?T8pwRKJHN4SjOPrCmQKKb8IgpsYcvKx4BE7CSLHL4CZ3N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jvywOo14k+g6o9C/pC0bX9vBJmqJKX5kLP+8tjxUXyuau67Xi86biEfBl?= =?us-ascii?Q?mu0LFoQ/KYYtsanXnq4RjKZ5JgjKloG0l2qdG/Ek0tIxAGRz5LG5S1ndn3br?= =?us-ascii?Q?JuWr+x0sCfJvaWvuhw7wDJn4=3D?= X-Microsoft-Antispam-Message-Info: rQ7voRhhlSdy5z8h4L6q/5byL4tEKV83uylHJKCo4xjoSZFnDXB9wHMXieDr92gVnOBwBFbC9bt1EF8r7SBPl+/o4pQEzARTEn64sysEDSuUJlKvjSDdurTr98nx4egibFKMdqxEvFq0q88WIMbsIDoSphsJM0jSjAN73vhyOyj/FPjuvdf339D0UNagQaNz X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2311; 6:bNickkYVWr4gbK/7I1TU3czjGWRmZ6ETeXhr0Fx091sXJtphXGLWlvdz8IYtF5xGZwmBX88fQMkyu1/ESq8a3mpC9NKa+G0vB2AeC4C0Smo4F1+8VeapIT55A6zN0v024P5daJkx3hCNljaadoNN7tlNWHDohytPbz+hD3+GxMBllAZAmQTDEi9HoRGR47UsW4G+3I3FBBcMZrbkwbF6VnwI/JV854ddqbWAUxBnhFuSnr2Hn2366OmSTTGd5GdnwaGb4D3Ae8fcv7M5XasK9XdJPB2g2eYvfStKj+uWDpekrwXDajnkrI0xpUsGLawoBW1dXgQLSe/0zvklbaU0xQe0n4dGPXs52pOmMfsH/DqBNWSOXkA/U60KFBUNVcrBoKc0PnK35q+PP5nC2x6fRCJPTfXZB3ETC+B9MqftHibidb4OXwGYV+P2r9sMI4M9+AXkJGNsmaEMIww95cTlXQ==; 5:7x8bVrBBh0MZMSGloKG+BgmXnhVjrHaVxiN8jA23XfP8WyWtYwgCDgCl8wgmbuc8xCNB2h+kqiC8Be57oNwVg4cVga4+ji7mXMi0WbziiINx79aG2HovGcA2oo2fM9m8MIrGL+BzDwRb7BMMZGTdYOiSPwm7hr9TIVExrsyCHNE=; 24:CV7TaJPycS29n/5TAJFsnWqvzR2A35ntYkY37kOb96nXUzX0a38UKsH87JdgtQuUyAx5HeNcjuWJIu7ty3C7piwmfQQEIcEANGca5gX9p9w= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2311; 7:U5LTJdowQP9QKBQJkNeiA8i6B4MJ3qrUYn9osJuIcxSqnVW0gVmeaFKFleZp69TC7AhTRzjUODTJ6prFrezYrhhzG8uxmbQMDJqc+iJOLEOHbMUClsBBPGo8kjnEsoeC3jMT5ekpq0n2gizNN9pjRkWwmsKubb1ZeXPrT6jwPrnKrP2mWwNFB/maQM1pLKOfUyWVbMt2YPjHFCUZU5+9vwdtkhCkD4ObBT6jwqU58wtxStz5J6OwWIuHNhMbpbr8 X-MS-Office365-Filtering-Correlation-Id: 23021894-ecd2-4aee-c71c-08d5b5063c27 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 17:07:51.4276 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23021894-ecd2-4aee-c71c-08d5b5063c27 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2311 Subject: [dpdk-dev] [PATCH v2] net/tap: report on supported RSS hash functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 May 2018 17:07:56 -0000 Report on TAP supported RSS functions as part of dev_infos_get callback: ETH_RSS_IP, ETH_RSS_UDP and ETH_RSS_TCP. Known limitation: TAP supports all of the above hash functions together and not in partial combinations. Previous to this commit RSS support was reported as none. Since the introduction of [1] it is required that all RSS configurations will be verified. [1] commit 8863a1fbfc66 ("ethdev: add supported hash function check") Signed-off-by: Ophir Munk --- v1: Initial release v2: fix checkpach warnings doc/guides/nics/tap.rst | 5 +++++ drivers/net/tap/rte_eth_tap.c | 8 ++++++++ drivers/net/tap/tap_bpf_program.c | 2 +- drivers/net/tap/tap_rss.h | 3 +++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/guides/nics/tap.rst b/doc/guides/nics/tap.rst index dca64c9..2714868 100644 --- a/doc/guides/nics/tap.rst +++ b/doc/guides/nics/tap.rst @@ -258,6 +258,11 @@ Please refer to ``iproute2`` package file ``lib/bpf.c`` function An example utility for eBPF instruction generation in the format of C arrays will be added in next releases +TAP reports on supported RSS functions as part of dev_infos_get callback: +``ETH_RSS_IP``, ``ETH_RSS_UDP`` and ``ETH_RSS_TCP``. +**Known limitation:** TAP supports all of the above hash functions together +and not in partial combinations. + Systems supporting flow API --------------------------- diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index c535418..9ef511e 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -875,6 +876,13 @@ tap_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->tx_queue_offload_capa = tap_tx_offload_get_queue_capa(); dev_info->tx_offload_capa = tap_tx_offload_get_port_capa() | dev_info->tx_queue_offload_capa; + dev_info->hash_key_size = TAP_RSS_HASH_KEY_SIZE; + /* + * limitation: TAP suppors all of the following hash + * functions together and not in partial combinations + */ + dev_info->flow_type_rss_offloads = + ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP; } static int diff --git a/drivers/net/tap/tap_bpf_program.c b/drivers/net/tap/tap_bpf_program.c index dabbf7c..1cb7382 100644 --- a/drivers/net/tap/tap_bpf_program.c +++ b/drivers/net/tap/tap_bpf_program.c @@ -84,7 +84,7 @@ struct ipv6_l3_l4_tuple { __u16 sport; } __attribute__((packed)); -static const __u8 def_rss_key[] = { +static const __u8 def_rss_key[TAP_RSS_HASH_KEY_SIZE] = { 0xd1, 0x81, 0xc6, 0x2c, 0xf7, 0xf4, 0xdb, 0x5b, 0x19, 0x83, 0xa2, 0xfc, diff --git a/drivers/net/tap/tap_rss.h b/drivers/net/tap/tap_rss.h index 4ebb653..bd6b97b 100644 --- a/drivers/net/tap/tap_rss.h +++ b/drivers/net/tap/tap_rss.h @@ -9,6 +9,9 @@ #define TAP_MAX_QUEUES 16 #endif +/* Fixed RSS hash key size in bytes. */ +#define TAP_RSS_HASH_KEY_SIZE 40 + /* hashed fields for RSS */ enum hash_field { HASH_FIELD_IPV4_L3, /* IPv4 src/dst addr */ -- 2.7.4