From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20043.outbound.protection.outlook.com [40.107.2.43]) by dpdk.org (Postfix) with ESMTP id 4DE92A499 for ; Tue, 8 May 2018 18:52:03 +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=jw2/cUoBzp3LPcoJwov8DS6uHWoZ+eqevqIZ7j3UTrs=; b=q/wJeANd108HKXa0CU3EyIsuTHv9eNYIzfWAEUSFjV4EyYdTjAOkjMxdH0wQWPyIpGwGtN+lzQAnWkBcKc0Aq/LOxEg/GEiTb++QjVpn9c2EWCnMsgmOFgWBldijT995LH5gCUZAfdY8RnpO8YwogZbqsSzZpbJbtmdT7cWytm4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR0501MB2315.eurprd05.prod.outlook.com (2603:10a6:3:27::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.18; Tue, 8 May 2018 16:52:00 +0000 From: Ophir Munk To: dev@dpdk.org, Pascal Mazon Cc: Thomas Monjalon , Olga Shern , Ophir Munk , Shahaf Shuler Date: Tue, 8 May 2018 16:51:51 +0000 Message-Id: <1525798311-30253-1-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: LO2P265CA0099.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::15) To HE1PR0501MB2315.eurprd05.prod.outlook.com (2603:10a6:3:27::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:HE1PR0501MB2315; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2315; 3:vL3JGJChQGV6o4/nuVMcp4bgDATQF2Zr24WLTPLAuaftsXcL6s1hGkNz5a2xkcb1JYaV63Sg5Gpy6OS4HL4vIZLksLzZ805Bh1ofVJqAqGcg2NKSpfAOpb0s1d1NNZgGya2b7iyqC+JvccBzAu0zrLLW3sm9r+MfRwa2JvWaBjeIv3xv9E1q2QhTKyIAvhCCw49fRJQuKEHuyn9m9ztQbLuN1lW41SRCpLs+y5V3mq68ignp1Ud7BgXZZkouFSKJ; 25:mUePP07N8ZDWyGIvsIpyJgAZA8H+SANpHvNQa0nY5NvMlLPcqgqVOBiV893oePGdvGTZHSu+hoo4YubyDfXSsiaFOyerfX8sKDbmzQYgl4FOyUbSGhkP42Jjl5rBCO5OOe60HwasvGUh4gnZV6uU4xSox5+hZZKiCOeEDnWbJAqpzqX+tFwk+lry5hv4gOOHBeQBTU5S5NDaHB8WReQeKGEU4bBxDU/n+2SZVtBJPMXMYyR7ALdjm9mr7ashRQXXan6CBWXUCfT72pW3XxY5PayVNA9G5ZhlCRGm4Y1TB9VnarYKup07DJiMzSoHLSRWmKLN09Uy7isSG7M1PyN2Ig==; 31:OJ3J1Nuz8eSyuxtfW/IbVdHVGHo9OwIglxBpIfP++AIUj583pM+3AvFY1/boVYoUCPm8bO/I6DucCc7d94vcZrWaF00kjOm8joKQgyRw9u6gk61xFQRuAp6IlgBPqo2drj/jdCI3FuvxgTmu2NO75UGGuhVoIcEjL+tr2/6jzZFMENlx4FgH57wi7iF4GWBDg2LG7WVzsQdo2zmxw1nIUaKa3Cz+YGtdm7u/kqj5xSY= X-MS-TrafficTypeDiagnostic: HE1PR0501MB2315: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2315; 20:d6JfX+BEtydA/K9mV9Fs54XIzFrsZ1MZfcZgCr2/PElalE4rw2PYG1pUcG1T+mBTueYRauSx4JPu/EBq0OD18CJlkMC6PjbyWH+JEnnpgOCL6IMz9GLwmAANXB15E41LYJohgaojcoewjj7xqnJS0tcqkvsYi4gIhVf2j7aXQIwXL8DcwITvOtmNW5p+vtwud1nJGdjTY+HzdxtF6MlyrtqYBWjVtpZ7XgpVAyTM3FGKe0fMwxtPAPyyyqvHT7hWIda2yKpr7ERHiVQ6aQESCdwm7HOXju/EgsjQx/2gCG8NAzS8WOvTCl+ZDsgkzhgZYJE4NUsRpTZMGVgx4bt5E2I2DZE5k4bkwbgOZ45gg+QqE1gOXUI1pWgEPH1vYs05qhdKRPNVPGlub1cqdMgfw4rKiCF4MP85nYqqJmh61TQi2gBlAQABDdY9xexjUqtipEnU948NsMr5wgMrmthOXV6plWA8973QVp5mXtLSEISd9XJkDe2ZLR2RHI6uj/cM; 4:HLZ35fqt9wYli2hLCLe0hRX3wb5Mxzvx6bnxjUHkXVGIRM4F7QIQEOAO6aN/3IbGGtQfRS3KwBgqHZcgaSApSoyK53Vae9Qr8nIvgPs0eFaLhO3/coarzNVakCP1iwhn4iOCFqE3rjAJsGMdqDdZUZZRFMwMyMQdBxr5f8wXSN+mW78iZ40GCt9XYGGdLe75Q3rjoJcX+Lj6yZ2HQqPcfqa7bObaqKPNLqiF/QVA4G42MS8QrZxfCeNhrJZvlBH41TIQ+oDIj/7gox4B6X3Rm8BJs+uSpR1KdoXVix7aoI37Xns6rrPNL4M2mm4PY8dL 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)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:HE1PR0501MB2315; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2315; X-Forefront-PRVS: 0666E15D35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(366004)(376002)(396003)(346002)(189003)(199004)(6116002)(97736004)(3846002)(55016002)(5660300001)(4326008)(50466002)(52116002)(8676002)(21086003)(7696005)(69596002)(2906002)(68736007)(50226002)(81156014)(81166006)(107886003)(7736002)(53936002)(305945005)(8936002)(54906003)(956004)(66066001)(51416003)(6916009)(33026002)(6666003)(16586007)(386003)(26005)(2616005)(476003)(478600001)(316002)(186003)(48376002)(36756003)(486006)(105586002)(16526019)(47776003)(59450400001)(106356001)(4720700003)(86362001)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2315; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0501MB2315; 23:d3GSCL7DPQu6oMKXFZxh8WoxgGUyG0XZ+Q8t+5a?= =?us-ascii?Q?i7caPrlpTRbB5Vb6jGMa4E9BrjkoNvcwnjZ6RaANYOzPYFTNAcPKxY0ySFa/?= =?us-ascii?Q?RoLRs+mNWgjtKGJFLhfvWe3LjsU+QAYmD3KgpwtVQ2DthudQVeySt/3sJQE4?= =?us-ascii?Q?lAUSempYQHze3BV/+VZIN3fY9C9ylEoaH8xrtEsEluTXorhq2Dk+Aj12Yf73?= =?us-ascii?Q?kl2QVCWtXGctY/4iAjOqpkytM0FQHasGEL2kjcwQDpgAoUK+XhoRK5KiX3Md?= =?us-ascii?Q?vUpPFqsjjy692jnLKmhHpfTz/hlJ/KoMloCpnNgn8zqbQsb1RvarQu/w1bdE?= =?us-ascii?Q?qOfgrE5p1NFgurouUyflwwrT3mQobgQRfCk6Lzz//x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X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2315; 7:k/dQgjjKHwdIVt7wTAEdF3oNUcH8M/vE2AxWGaZWPgm0fepP9gvs5itFgaMU6KmR8r3IKsCwweTutTEsbnyt5lJd9fqvzNTg6ad2n0bOXD7gWtXrqh5si5beqFYHZ5N7X6z9bLleBgt+xGE5/sGM5RdQfCeqRXzmqOG3AQuR85nRJ3BDJucbzTmhdyZLej4UdcLlylV8mZUwg2eT7FMeDCRJw7dDeis0jgMRf4dV0V+CvoO2mJrxOsKYnQdF7TX9 X-MS-Office365-Filtering-Correlation-Id: 079f8c19-3dfd-42c6-5633-08d5b5040555 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 16:52:00.5674 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 079f8c19-3dfd-42c6-5633-08d5b5040555 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2315 Subject: [dpdk-dev] [PATCH v1] 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 16:52:03 -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 --- 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..a9f63c4 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