From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0047.outbound.protection.outlook.com [104.47.2.47]) by dpdk.org (Postfix) with ESMTP id 1BDF81BBB2 for ; Thu, 10 May 2018 19:30:40 +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=yG2MdH5+eGQSkN4DQcNEbWt0FE2+XjT0/Lj55fEOzOtSKo685fmxZ480CcfpdvBtqZquFi0ceXAX9CkzuNiX9flEN9noAnHjxgiALd6XXcpxwTJfdcjSkAzxCvZskVMFkDeQD+xy/1VNfaWe4PAO3uHw4q+2EKW/aGV0TbWYdso= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM4PR0501MB2306.eurprd05.prod.outlook.com (2603:10a6:200:53::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.755.16; Thu, 10 May 2018 17:30:37 +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:30:25 +0000 Message-Id: <1525973425-28889-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: VI1P193CA0018.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::28) To AM4PR0501MB2306.eurprd05.prod.outlook.com (2603:10a6:200:53::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM4PR0501MB2306; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2306; 3:LEzTNOaHq1LLqI2gOpI8YDedsCLeiTpgf7sa//pPgs+cCXWuiFW5iQz1iHonQD6uOKoZ9nfIhqnbxPCaO5EtRW9Xom0nLYVb9sbPegXX8hCYwAfVDFVwprhFvPg/HPyKGlUdb1HUohl+N1+oAX0jaYSbWEhfXZVsJgL/IwYjHiSH4gu/KZVTwt1T6D7BINMdpqQNtAdq8sE6XOAbaQRfcu2l/POy4hI/HG57sq7w07x9LKVS073qPJl4vCjCdkam; 25:LSJP8CxbwqNqbUDkzr/PzphuGHd3tDSvlKjFrafO1bHspp6db+1/ukBLjJiXurQtGLNHQK3ag4izo0sB9iNKCYXHQsGEoOWTdZjjjshYz/kxiqIjr0MsoXICLxKZv+/oCsS606bh/mw0LgtOiChQ4MJIXVCeM5gGX9uMB+LrMlaYI0aqXXPzuD0mRlxsBC2zi1hwoPrz/7wNK9/4a+Vtc5NlnKPU2PfM0ApGBe58UfGVxOAOK5SILXdXBEcKyRKvpXbIN343OqDS2cdtSD4d2LTcYkuwioqei8syMNpRVCYHhYj6RdWmWFemtzKUB7aRAxUM5xVkEI8abmoqQlr5SQ==; 31:ToUSHeAhgJLlJj4EBo6q6J+v/rqtyhnstrD8x+CwNQQSo9zKlSPxPzaupY5TR+OgVniKg8mfQMtz5d7XpeQOI7PC9Ik9aixn69KHPwHpCm0ZPYfYxG7fDYhPPwIsNcM1gGAgqh0Mge64tSVu16wMOB8Uo+dkqRRlUqKm4bRo9z3mpfueT3ryGmAJadJIwdfkg4otM2IB42g2WkOIe/XJMpoU6CZiXd7Qsb1i0fYbWwE= X-MS-TrafficTypeDiagnostic: AM4PR0501MB2306: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2306; 20:xRtOaUtEYgbS71ckLPtY7msGbTEfw65AGk95HeoafedwVc5AKLxmKVnRnHuXSMXZiOWxwy3mB+chRWBVYgK3V5XAxHAenX+wVyt9zzVSKfP/mr6LZy2zpJDhH/sXfpUHBJHualtYMxdtckEJGwJ6dcHKqtiDWa+xWuJ2HEH6pHMLDX2z6KTqzvPkNbxzYQPmxuZgwGZ5yJiHuHByWE1JBGyhQldxi5Zd9KTdJsOeWgyfa2l0TQH+bUquoX+FfVTnz7Ragyc4I79CIgox/wbwiWahlX3WYVJhdfUXo+5wAImCFkzdsJRz4tJtsUnVluJdOLL9ZuhCfG9OTcWsHHzmMz0Y7WmT/F9RdzgZtAiAJ06/C7BNXtK0jd23h1mE3wXqn3tscTPjmcqVXcif9euAFxxQ8AnhdcpzTAzNmzUY/r/Wt209MQ/nbiI4HxWACK+DyuoiHa8LNK2rV5h0V1vIAG50Hyh/La6qYL2C3I0/TJdYdCxTd1Z4t7CRvnCa53Yh; 4:gk5VlIEDCLrWgVnCOnK3AyvqT43ImemwpTVzMdLtNvm2JdUN6Fgx5ZYYmedE7UmjMbGzqdx2xxwF8VUEteO4ucm/Xdql2aUJbsVcv9kKZvSNo/q1uFF5Td20q6xSFNmRYe5/qbPZ8Grs/AtrNfhHPUOROhM7L/ygY40njayrxEM5he3Sb8e+UNbgi+xySAjjsNdFHsIaE4Fuy1GjpamjU1+G9x/1gTfFQ2LK/2T3NQJmCvv05NYbkBnr8X04lU2+cjLDVhBQfTqJfGyqYQ52cw== 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)(93006095)(93001095)(3002001)(10201501046)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM4PR0501MB2306; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2306; X-Forefront-PRVS: 066898046A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(366004)(39860400002)(396003)(376002)(346002)(189003)(199004)(21086003)(36756003)(186003)(47776003)(8936002)(50466002)(59450400001)(16526019)(52116002)(7696005)(48376002)(76176011)(51416003)(8676002)(6916009)(25786009)(305945005)(97736004)(2906002)(69596002)(55016002)(6116002)(50226002)(4720700003)(4326008)(386003)(81156014)(26005)(81166006)(86362001)(15650500001)(3846002)(7736002)(6666003)(486006)(478600001)(5660300001)(105586002)(16586007)(53936002)(476003)(446003)(11346002)(68736007)(107886003)(106356001)(54906003)(33026002)(2616005)(316002)(956004)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2306; 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; AM4PR0501MB2306; 23:FcO7GYu3rDvNetvM9IdZ08TX9J2KolrOMLyk1pv?= =?us-ascii?Q?8/qbfGqWAq2ZdHLlZeZwuuPtJMZ2nMEAssiTH+bptZJlswm+gFuM391b+OiE?= =?us-ascii?Q?fqoYh37mRo7dxh81ZWOe1P7LkcthXV/yVVEyum+B+cALR8TX+QBy5P0lrk9b?= =?us-ascii?Q?kTPufsjgDLim61hJCXgppGfQw1b/V5CdqDv9HlCX0nHb8aIwFB4Dhk8nMPJH?= =?us-ascii?Q?IfKFYNzXvI/3XdCfgnfwhzy3V62Dz2V8l6nFWPHUm0GuJjJ+aYkWlo8EXk7U?= =?us-ascii?Q?64kq3Gl6Xrr98FQi8K0KigW5W4gD9hzNkXd5mzwgH05gZWuaKoNqtp+g3UiX?= =?us-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xS4taF6rPgVM/Xvj1PJnTAAfV/gYbGff0Sg=; 24:eAOYQQhiS8RZLgzzWcytgtjRHGv+6oFqJuftjcn9XoppzumrRrY8X5AyZndJzwhxrxVQ04+xSbtywNYyu6PvRJcynnQ2y9urdRphDDWH4BE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2306; 7:ped33hVBnxGNnNtaxgJRPjEc9Tw9nGmYC/OqoAl/AsY/TA+J9nm5GOgV1NaPc0c5WbHMf09JBzRBDefsYbKo69T4nRxFaXsRxAJNH7kh3fF6toTeslbu9zeX7d20YX2gG8TTv1CxT4mXrRdI4K1LE9trb0u34gL1/8E9mo82UfoGX6pxJW5mry53yR7/Vx5uIgHZ1OTxHYwieF0v2X0sNqI6hurd5Lnla74Trcj3azQVy4kwz8fntmydpjQupCrt X-MS-Office365-Filtering-Correlation-Id: d5c68341-e21b-4822-7c6b-08d5b69bbf30 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2018 17:30:37.6406 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d5c68341-e21b-4822-7c6b-08d5b69bbf30 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2306 Subject: [dpdk-dev] [PATCH v2] 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:30:40 -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