From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0083.outbound.protection.outlook.com [104.47.1.83]) by dpdk.org (Postfix) with ESMTP id 741F91B1A7 for ; Thu, 10 May 2018 19:25:51 +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=u7raAqXVCJP3rE0TnrcVp7Acw4LGXiU3M8CUYPrjXkw=; b=gozYZBpuVREN9XydvWAy0DZxr3Fms16vt8V1AqFp+q8qiH7pn1j6EixMhFiYEpODhROd2uDU8lfH8QYIWPSzc6xK2MZhuxqyYXK1fQtz/sOeOLR/PnAOTNYXk4EK1ThZw31oDcCeymJJzjL5aV1eSSjUg0p234by/Rxd1ipV5V8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR0501MB2316.eurprd05.prod.outlook.com (2603:10a6:3:27::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.19; Thu, 10 May 2018 17:25:48 +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:25:37 +0000 Message-Id: <1525973137-28518-1-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1525969418-24504-1-git-send-email-ophirmu@mellanox.com> References: <1525969418-24504-1-git-send-email-ophirmu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR07CA0243.eurprd07.prod.outlook.com (2603:10a6:802:58::46) To HE1PR0501MB2316.eurprd05.prod.outlook.com (2603:10a6:3:27::21) 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:HE1PR0501MB2316; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2316; 3:lh9/BlerBDny8D2zIuf7lMqcDSmPt/QyaUqhgHLR9DkGccvpOGSKidr7OxiV6Ky1vPgf6D4XL15KMzt/N7BIAbeLYFyJwSEnnYJILMOpcHwkJfLUwv7Hbm1WM0m9TjBb7URsH3bdz5dDBBB2LCJcZ3sxRZNAOOkW9hSY9IbtZj/JyQpiyU5rgFmjmppaJ5C3/0kp6oPXA6lp6WgEocc23ELYKgQ1Q9obR4XF6WQOKY5kNisVulfmspTEdDzUKlcG; 25:v45X2AQ80+exKMrnYjufRWc4ra/276RjaheTyOTN7wTV8BgVeK53PYQxqQR9nCp0LecVVaSqujE7wnF2KHUoydOuyqXrMR583NnUlSHTzEnB3c4y2RAhS1BuS6wu1eImBCn8Kqqge47Kvu1nTrNROm48/tYUBvUwqRgTrX13gQhAfxehZaLlNH/1smS3tjt9zeZUYkaueU8kbS3/RBjiF6+VXd3vVK5E6UjZbD+dGvcjzBeA8YW8u9utLXDnsTCWCY9xg5CU4k6AzVIk6A/01ORhnNpJ8PexIdAVkDyJ8UijSpJmyvdHA0llvcUVnRkzD4C9LMXkoLEVc5Dysl3Qbg==; 31:WBwpL/1wHrxQmLaHrDBugJVFqhQO2m9QaCDSHv/zn8OO1xu94xDuD6d2eqMomcSVWSWiU0d/oxjb3QTTMUPM8w11QS+A6FisdxrOQkbnoC9rAyEL79wdc8iiTI8GcVXi3i1e0IAElnzO1KgHKM0zemP8DkX87dJH+JxOjJ/SJV/xoXhFPtMAQSXfq0fHs10HhxPAxbB304hKF0WTfZUuPlbVxotLpsqeZlrfTYLve38= X-MS-TrafficTypeDiagnostic: HE1PR0501MB2316: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2316; 20:fIXurFWlNUhl3KCbGTlq4c+nJAMyPgFytDpbWbPeLqehIyTf5mc15aNGGNchsY3t3Awyb0FGDGS2yQzB4Uinf3l8ehjOr8nnIEgKwoWe7njGXjNOJhQqXlexk1/uGRPHbzhnAldOF4c9c1WW9pdN2HAIlBko+chT0n8az2/FqNFvZ0fFU95s2tz+E/ZQv8MXxmOsQYMR1XFsAqnztSsOBAX1wnJSl0Ot6dGGzjulD+d84nKIJ+dOk+9BnuYzKCYw15syLv/UxcV8InSGhTgQiuggWC+nBkuKGqghnwQzA+f2ZGjHo3kwzG/6jhBYfNgz4e5513PDe/os4llvYMzVArjlVMOniEklDKmmCbEE8JffuhSurxLQ8phnpGxKRZrI7iJTkIAQRFw1XwsnXFT/vrNN4uTncWcvHLYUcerS4XAXr1O1mBE3JK9Tp8eQCF5hty1CBpJ0UtbjSHoYzeURQbzafsiNmoUoFBYHzI7WMA5/GQWjwFs86kNnG+qMwCEX; 4:z4yZrbOxJxPm2lrlTE2qI+/lF2Y3THcn/qD7FkIqlJMPvW1hR+764HqxYQffOYmFDeC9DE0MtF7J8hyEfyGR3LmLLc246alve33dkEXOjyCmx5Dy67tgmrjK6V/r92a1hWh3iaSRTqPJHJHmmzHVqEeaCoj/iaR1v7iT5gtLY0XKkwF1EchZm7OIIqKYZHh/1RuNSU0Vi97tEM/OSpqfXxDyWW3bCXGY3hS//nQ7YD5ajT5yYLx53zIV2/ivDkRUEXv4t1Ir5QIh0FLJ0+sUDA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:HE1PR0501MB2316; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2316; X-Forefront-PRVS: 066898046A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(39860400002)(366004)(39380400002)(199004)(189003)(106356001)(8936002)(105586002)(6116002)(36756003)(186003)(2906002)(69596002)(68736007)(26005)(76176011)(6666003)(305945005)(16526019)(52116002)(59450400001)(478600001)(25786009)(7696005)(486006)(3846002)(386003)(51416003)(48376002)(16586007)(4720700003)(21086003)(50466002)(97736004)(50226002)(8676002)(81156014)(7736002)(81166006)(54906003)(33026002)(66066001)(11346002)(15650500001)(55016002)(956004)(2616005)(47776003)(86362001)(107886003)(476003)(4326008)(53936002)(446003)(316002)(5660300001)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2316; 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; HE1PR0501MB2316; 23:2rKrPoZnof8ljPmFQdEO5fUUjAspk+TOzryddKn?= =?us-ascii?Q?7cDDWPWO1kPds7RoRO6gycFEPoo3GphWGWUK+PGw4K89jdS82C4xFoVVcVkF?= =?us-ascii?Q?A2MWUL9fSTgdK9NviqNUG7nQYedz5q7yZDxJwdWFPH6gMJ+pUxVK9vCEFD0+?= =?us-ascii?Q?Hzy0WqVy2S0tCLOP4vw7k3nuEplai7Uv/gknW/r5FywMUXkrHQRdO+LOwsT3?= =?us-ascii?Q?oh/A6KcKIJ9Lc8ygpESnBTCCPzKt0dqbQ9aO3mK4vFKusdAuBJIMGSz2yK0o?= =?us-ascii?Q?19jUMoo4VmjDFyhrA9OEISr9AaYOy037yX+rlhd5J6xqkZwVscmQ5SkFymr7?= =?us-ascii?Q?HZ9SH9P51Tj/Pk1T7x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24:P4Czd1KZFIX5zJkn7agC4NWR0E1Lgm1pXX6BJfb377T6yHQnBwXRRCafk3ZsIeLeu8N6/BqeJgX2gsmJ60eeP/QQX1KDQFQQQkNrsTmmbmY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2316; 7:mDufMfTWCKiXm/9tXiYj5RmAyqIZa6lGO3s0o38MZKusmbje6i5xoMI7zO5nSusjAiWj93jrztKPmKmAo0Q8wt9mz3zbiNfiFTM6HAW11y13olDUUxQkSt5BF3WgIY4Nl3ol/aaGq8Y9B+uh0mWj8yDlYLyxghjI3K5zt+4DqfA1pmA9UF49rLOjonX+gasdZcVQdcAS3BvaQ2oCG11AKUtE3gXTyHkSLtnCNzTe4dMOY/EhUQhawDIcY0Yumlrh X-MS-Office365-Filtering-Correlation-Id: 924fe334-2844-479b-e024-08d5b69b12b8 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2018 17:25:48.1678 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 924fe334-2844-479b-e024-08d5b69b12b8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2316 Subject: [dpdk-dev] [PATCH v1] net/tap: add RSS hash update callback 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:25:51 -0000 Add RSS hash update callback to eth_dev_ops. Signed-off-by: Ophir Munk --- v1: Initial release v2: typo fix drivers/net/tap/rte_eth_tap.c | 39 ++++++++++++++++++++++++++++++++++++--- drivers/net/tap/tap_rss.h | 3 +++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 09cd70c..8556c6c 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -835,11 +835,10 @@ tap_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->tx_queue_offload_capa; dev_info->hash_key_size = TAP_RSS_HASH_KEY_SIZE; /* - * limitation: TAP suppors all of the following hash + * limitation: TAP supports all of IP, UDP and TCP hash * functions together and not in partial combinations */ - dev_info->flow_type_rss_offloads = - ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP; + dev_info->flow_type_rss_offloads = ~TAP_RSS_HF_MASK; } static int @@ -1434,6 +1433,39 @@ tap_flow_ctrl_set(struct rte_eth_dev *dev __rte_unused, return 0; } +/** + * DPDK callback to update the RSS hash configuration. + * + * @param dev + * Pointer to Ethernet device structure. + * @param[in] rss_conf + * RSS configuration data. + * + * @return + * 0 on success, a negative errno value otherwise and rte_errno is set. + */ +static int +tap_rss_hash_update(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf) +{ + if (rss_conf->rss_hf & TAP_RSS_HF_MASK) { + rte_errno = EINVAL; + return -rte_errno; + } + if (rss_conf->rss_key && rss_conf->rss_key_len) { + /* + * Currently TAP RSS key is hard coded + * and cannot be updated + */ + TAP_LOG(ERR, + "port %u RSS key cannot be updated", + dev->data->port_id); + rte_errno = EINVAL; + return -rte_errno; + } + return 0; +} + static const struct eth_dev_ops ops = { .dev_start = tap_dev_start, .dev_stop = tap_dev_stop, @@ -1459,6 +1491,7 @@ static const struct eth_dev_ops ops = { .stats_get = tap_stats_get, .stats_reset = tap_stats_reset, .dev_supported_ptypes_get = tap_dev_supported_ptypes_get, + .rss_hash_update = tap_rss_hash_update, .filter_ctrl = tap_dev_filter_ctrl, }; diff --git a/drivers/net/tap/tap_rss.h b/drivers/net/tap/tap_rss.h index bd6b97b..17606b2 100644 --- a/drivers/net/tap/tap_rss.h +++ b/drivers/net/tap/tap_rss.h @@ -12,6 +12,9 @@ /* Fixed RSS hash key size in bytes. */ #define TAP_RSS_HASH_KEY_SIZE 40 +/* Supported RSS */ +#define TAP_RSS_HF_MASK (~(ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP)) + /* hashed fields for RSS */ enum hash_field { HASH_FIELD_IPV4_L3, /* IPv4 src/dst addr */ -- 2.7.4