From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0067.outbound.protection.outlook.com [104.47.1.67]) by dpdk.org (Postfix) with ESMTP id BA28E1BBA3 for ; Thu, 10 May 2018 19:27:22 +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=XOJo3+z9nQh2eG7/BmxKJvUVzAVGL/DLWDzPmYu3MkvWsdEGGlwvIA64Q3oHJk4qWa9feDj8CsC+R+9hb2h2CeQ5Kg1iqJajHPyCSaMZ4KdF/EthsW/qvwwGQLe3K9E9jPdB6BNXBVP9ErZxDCTYoOKD/GJTJOCvLQaOS5LBwtQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by VI1PR0501MB2317.eurprd05.prod.outlook.com (2603:10a6:800:2c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Thu, 10 May 2018 17:27:19 +0000 From: Ophir Munk To: dev@dpdk.org, Pascal Mazon Cc: Thomas Monjalon , Olga Shern , Ophir Munk , Shahaf Shuler Date: Thu, 10 May 2018 17:27:05 +0000 Message-Id: <1525973225-28617-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: VI1PR0101CA0048.eurprd01.prod.exchangelabs.com (2603:10a6:800:1f::16) To VI1PR0501MB2317.eurprd05.prod.outlook.com (2603:10a6:800:2c::18) 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:VI1PR0501MB2317; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2317; 3:ucm4UjSqgOpdEo198PqhW3NlMkJxeCSSR9GRQmXGp7Cm8fJIb9ZrF8V+/yIkEjsJwdBUB8CfZaOLnlrf8IqQAIjCp7ZNDkZC07Bts1MY+3YYA5vTfPcMw3OkLg+Ey/KjdQ2XX1cXxmqThs1F6BcpV+fVWA/NE2VO3o9nE5XBh+EyhAxdbnsscWhdg6OW34EpB67BRubFkotGUvzgOV0c0I6/G/PQL7Xy9ia6xHI8beNDMT07T598JlGiMXwVvVlj; 25:IvmvnrPcS9a+HXtmdbW4t+GVsFUd8ep5ldc/ogmYGCl5v6r0SVmCw0Z5AxsojcxZBrsTUH8DozpEhMAvdpHpDVxcFQcbaoh5COLuBRTA3cyiXjtiVFe9cn6Md5ugQ+EfUdtOtRjHKGkruryd8q7VcO0hhcH/YF+SsQ1FiAi0FPoTEC0EOj4tjbxAQN9kIkRebjpVgTpp2PWS+60eIlhFGsPbSoKkJ0AKiTyXJTiVMIaUvHtT2J8+cORZyzlUIv6Zcyal5kT/ef+FsPwUM1YEwqp+5uL2AiF7AClfjf1+3UlGwrEFzkfcQ+ARJ8G0B4prBV0Byj7H3/yf28IDR5pTUQ==; 31:Zm5EkvmaRaj5/wo1mHfJ86VnuzsFHdxxvTQBg5XwZpXgXwL+kXVARSC1fWVZjT5BrNjAFpeR7mpDks/UddM6K5/+S8wTA2PNwendW2x3U7NP/k7xexqSHYezK6tarvBmO3IGCqxroMfjVl7Igex5D3+GtR5r4VvU89cXbd9DwWvk2bLd2KH3k8vT+8xdMKjz9k9V1/sfx1yJbPQmxw1kRzTFC3dEMw5hLc6u4BGV/Lo= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2317: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2317; 20:CySFoX59YBSsRwc3BsaUEJU96jByUso4D7SuXX8cVrjmU63qnzMuUjRDaGEJJko6XMVa5DD5nXRFA/dpEHLLsXpaPlfeTdTPEFvuExCliyAWeOUeGlIuX6pHWAuxn6His9WQjc9YByHHD9jAB1s3jrMhf+vz0pBEWN/6pwULqVnF7I7g6tsRvxaJXzPHtFYX9TBze3KY7I0rlgJjfGQ+pi5e8ldgSiTjnWSiPOx0g7/EtPABxqeDJKPVw51qgCbsF2kOUYV0EwlIpTJONYLWsBRIwT8QWB/6P7Ina7R+j4IjErRj2AbZus/+a0fSGKQcHbWahHHKc8vuTc0Qy5El+k7Qv83Y3WdGeN88wUjO0bu6NRKfnMebP5ckdYTy5u2NS63sXRw5hN11i/FDtGqYrm/YMZ6IfBYLVQU0DrjNgc4wLdOtPU16xL7BoC8uEhNA26ZTcZ9JW/t2c7LEWZgBcoZgS20YgLN5fiB6TZj8szYiB6ISIc5cRRoNtKSg/E72; 4:ShjDeodH//J5jdv8BIEuMQdEtaIcx46KFTYQ3gfBPvFXDhWC8JwmJ8VfA3sOB4ML3qxVXP1EV9Lb3+WpzkyAXjiPpoWlwzgHMvG918uDX2WnOvLVKBidHldZQ5DWko+hDucypnnjlkJhBcZ+n5lj3JC1SFd39lxLC+LSi+da4Vl9AI/1rwb8JsZCImCTkFpNZZf7S+usaStB8oR7CkRDkELF13VDM8UQWJrzoxwYXPCXARagiYfDSirN8G4Urpn3d/InL68qwKmbDMtS44z9D4Pu0TDi5gqwsSD7KwnNf+KpbSrTkm/0BIXgExxpcYjE 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)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:VI1PR0501MB2317; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2317; X-Forefront-PRVS: 066898046A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(39860400002)(39380400002)(366004)(199004)(189003)(54906003)(66066001)(316002)(47776003)(16586007)(25786009)(6116002)(2906002)(68736007)(16526019)(3846002)(186003)(36756003)(6666003)(4720700003)(6916009)(105586002)(107886003)(4326008)(106356001)(55016002)(21086003)(69596002)(53936002)(48376002)(76176011)(386003)(11346002)(8676002)(446003)(5660300001)(7736002)(486006)(7696005)(51416003)(52116002)(86362001)(478600001)(8936002)(97736004)(81156014)(2616005)(305945005)(476003)(81166006)(50466002)(26005)(33026002)(50226002)(59450400001)(956004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2317; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0501MB2317; 23:CQ4/8CgaXZ8miqS/wJIvfuaO0XS6vwHWb3UMPBG?= =?us-ascii?Q?Q+j8YQ8oO15FxFNlRsNiW33AioWYKzFwcCa4TeTQPq4Dd9KKPbqNAz+mZVKM?= =?us-ascii?Q?JUjD4FoaGKTX6y1NY7VNqURGfpkRGSdKWUByVUaxfjMjzUm5N535YHSLR9GN?= =?us-ascii?Q?GIlgA9aB7Fxe9cUlAOx2h9pTsRDJiFvRupRRqOoZODVrWrJVfSQBkbFuCF8O?= =?us-ascii?Q?6eGezA1sZN+QgIz0TyYvX8s0ujDpK2NAIpIrtFqxziVyTGIHPiRQcT6ve7OU?= =?us-ascii?Q?hVn7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17C2DQ6cRoAOViETQ5VqsGKNtQF0s=; 24:fm6+wqpXXB5zKmTS6JMGoQ68STgUazrnDPfB0LsnNMbY69RGqEwdHZkyKbmw6SQyPchjEVDnvmq+6Sw3kGxZSa4kweM6KnP3AcKqCiDDu70= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2317; 7:RTa/bbxP8ZxaRVY3txkFPHU4sXgx//AFOmpyp/ATkBBWHcvcdeyUJrs4Drx8Mvx/wFxKbNl8NXoe6C5r4vJ3uLKXlKxMvKoZcZZUfYClosRWSl9EU0rQDvLw3sFnnPisUyegPgu1xa6B67kAt+W09vRKry56A2AIowcGeNNyxafSrkmsceNAt/7XTmNCRWUQYe6sRnI8k5dlXsT7XvrsJ9h3n1CXBzVchAmrvq0CdqZFbr57P78J3PR8K7qMxYpA X-MS-Office365-Filtering-Correlation-Id: 5b8a4cc8-ff72-4978-5554-08d5b69b4947 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2018 17:27:19.9953 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b8a4cc8-ff72-4978-5554-08d5b69b4947 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2317 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: Thu, 10 May 2018 17:27:23 -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