From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0051.outbound.protection.outlook.com [104.47.0.51]) by dpdk.org (Postfix) with ESMTP id D2A2D1BB94 for ; Thu, 10 May 2018 18:23:52 +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=n4RL7BAlreahWEfdauTbEQFJEzIFdh223FydvM6QzXA=; b=oGMoVUj9rUdtQaOTl1JhVFVEphe5aY7t1A3vDy8cKwXD6vjyR4VHxU17DYcxOcx22piR3Lj9cfECPv+LQ9gKOGOnaLGAhblCNoosxarb1bpHjYIfJgzd7Q6eO/bpza/FbHBS9Bd4BAKdkEgJOHHdfeE2rXf+mkuuOtSwmUjxdJs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by VI1PR0501MB2320.eurprd05.prod.outlook.com (2603:10a6:800:2c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.18; Thu, 10 May 2018 16:23:50 +0000 From: Ophir Munk To: dev@dpdk.org, Pascal Mazon Cc: Thomas Monjalon , Olga Shern , Ophir Munk , Shahaf Shuler Date: Thu, 10 May 2018 16:23:38 +0000 Message-Id: <1525969418-24504-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: VI1PR0902CA0029.eurprd09.prod.outlook.com (2603:10a6:802:1::18) To VI1PR0501MB2320.eurprd05.prod.outlook.com (2603:10a6:800:2c::21) 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:VI1PR0501MB2320; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2320; 3:HV7jR+GZBFK/jin6Y52cfaWwBFvuDjB22DFu29yFEG+O77SsBodd9yZVFhvfOaSqPxbCt3QFPZMSKI86eriO7SH3m5cg5udwIUcvZswxJ2RFLnjbDxXK1rxLR0Rks2gRKE4AHJ80t7KuX3AObT8KMax7drY0qGOYmNKE0fQfgCF7mMF2nkggmvoVGPeE6Ksr1XINI9ZdZ7+q98/M9f8abOrr9uR0znTtR3gdcm5UD/wr6TI1h5ycX1Fy8xfop3XG; 25:3qbc8aM9IMZYKQw5Mx61xtIWUdBlcJF0XsqIaAp3wrbe1a8ayJJNIjOEUyMmGDtOS+qgUJ6dJb9hFN+L+qO2XP8CZxUf4NPxBL2XKMh1ocqaLaCyKeRYPjhmrzCQRfhLaOi6rgacNh8hGqkstF40T/0Lz+1tlCZIX4hDN0xGORhPPZRWCYKwIWXVZzBtJ0446OYhlp21VegCI7Z8n1lP4TLD5y8oDrjV1eJjw/7t/18A5MdblvB2jwXkhojmkFUvvd972eJQ+cC0pLuMs+SakanQMIhaXLJKPipaWeTXeWuCxvdbZQXGwTblkbg5zxbmlKjPk43/qJJIYkwJJrD57A==; 31:GYnkXvnye7pNjAH7lQv0iZIoZrg9D1PxRk8fcQfAOBDlcACeGvO4HLFjUpwLGzDOV901gvn4y5T82r7bZiUStG46209rj/ax+v+xYp8Py1OzglgUamggeGBGj+69j+RAkV10u9VR/9HRzkhufcZHbuuMQJ8FOgnFApLlbnvh4jELqVoP3dS7NGpnBzGyiIVh9z/lw0AsoGUkWBuQN13ERcmPkds7mf6fZISa+L45t8Y= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2320: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2320; 20:Wl4EjU9s4QynjYe2wyEfuxYpksWxq48u1n6MnZzbC7H4Jj0mZIOxB3lYoKFbZTWT9/PHv3+73w/2Tx/Nr9xPwlCLSEVE21a3KWUsKKzjqdumFUshl+nUY116Spq32C45twt3ypkvXB2fyPSYNfcL43FEZ+Q0oxkqT43Rqe4NH2plg7Up1rXUzPTnh4tfhxgf+vxLnEi6HcurieXFym/o95WJjqmCWN709vAXngSLopxEiQNfCMWtFnPc8OIhR53ACFDWDWHTII9SiglBwSCtweuJyrnLhqqdzmZ9I+/OE0KAKvuznxiSWabEkUmuJqdAPqMY1OMUgbyLKGwy9X2KaPn/nUr8RS5tXEjZ+w3MrMmwGSJaUcD5sv9+XGXnvMtxr9UUWxrANdYvGI7MxJJMiHeIiip0vAz+EEQ55s3BUl9pYfgRnyHl3ZCt4Gg0t7IztUq1+5YTiUgani4Yw7vRbnQRB1dOrzE+ygiNrwhY+NVf03nIEc8u0KfBgfKyA+5+; 4:FMDoM0kxQy2xJA3bXcIUFwGWYF3rSoPYqEcoIOlrJZOpeB7Rw5wJyCgxQdid0mVNvQygWfgevFCnBzY6tTxSXRGlAfsLznB8m/4WMyyJ+A7UZacZVKBvnzdxPbeBDIF68cWJ5J2Wg8GK1bf1xXm1fL2r8j4hXEhFCfMo9iYTJ1nWdggo/pUgmjIPSCTSjmGqyozeghvErz1HQSqlFql4AfuXl8WQv3yfias3i2BhXgs3Ts8aXeaVAXqfyqZjFoWLmTyrVq0aUirMDMoOevrYFQ== 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)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:VI1PR0501MB2320; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2320; X-Forefront-PRVS: 066898046A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(366004)(39380400002)(39860400002)(189003)(199004)(51416003)(53936002)(25786009)(59450400001)(21086003)(69596002)(7696005)(97736004)(52116002)(956004)(66066001)(105586002)(26005)(486006)(386003)(106356001)(6116002)(16526019)(86362001)(55016002)(476003)(47776003)(186003)(2616005)(107886003)(4326008)(68736007)(15650500001)(3846002)(36756003)(81156014)(81166006)(316002)(8676002)(50226002)(16586007)(5660300001)(478600001)(54906003)(8936002)(50466002)(48376002)(2906002)(4720700003)(305945005)(33026002)(6666003)(6916009)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2320; 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; VI1PR0501MB2320; 23:i950ZITm1xOr33uyNgbWJFLXPnC7jj+Ks8xPIlP?= =?us-ascii?Q?KKzpw/M6N47uqQ7oM+tpFST43dhDJSuZ/4jpvga2KKpWGl8ID8zlkzDtWWTB?= =?us-ascii?Q?JezOYOc2vTR2lUhBJ/W6KIUjrUM6ZOrhSCJkhYkCY0dZMGkVbnavRBNTnc09?= =?us-ascii?Q?dcihP/Xy7LQ/cXpJm3daCML4N3D48aVTVVNu6cF8reRJYyH4Bg/tWu6IBpdn?= =?us-ascii?Q?QQM6o0gTYQ9xBYgEJiP9EVwg1pc5br63BuVyUrWKpQZAvfCpPEHwCCL/tYh0?= =?us-ascii?Q?KzEQRotNYGyflokWeUGo+QxgR0LQFgraNIYirnZeDbhoCDlIZhwsIvlDMx9B?= =?us-ascii?Q?xaq6ebN32K3K27oX6P6uR/f3z9DAb5fE5FuH9WJqrpCWsmf0U3bPed3O2k63?= =?us-ascii?Q?foNFY847sLE2jV8IQ2QoaWvUQkeS+ht/Bj/FHuOidEdmQ1hx4AU1MOD/6WlA?= =?us-ascii?Q?vEqYJTBuXRlPrVloQY/oO15GMvxr/sZjEsDOViL17AGaSW7kiYECLh6+V+5P?= =?us-ascii?Q?8kqB/a2VmgkWlIM13RreH9PSqwZyh4dyIT9//iKtDa7e1dFm6nHCKEVDfBWy?= =?us-ascii?Q?73K5y2038niu0XB9HNjXqgKXOwAOyx3XJR3TXqFJWSvcYir60uUr67E4pfrb?= =?us-ascii?Q?AkYq7o9dm6uMZytzAVZXQQYP5QoVP3REl1HbgutVOxzNQVAyffRJVQd7CTwC?= =?us-ascii?Q?94Oz6djDXbHHSKWR7tDOuLoE5WjG4M5wBrux9ivZB2gChN8c6aG7rsJFe13V?= =?us-ascii?Q?BLkTLcipSa/ooOfFeo8EUqeM68wdmS3QS3S2cl+fQhuZd+5juUsAuhWm9CvR?= =?us-ascii?Q?YG4+1ThFhHoYniesl60pe6XXc/HxL38yHPazy4fkfruXX5obkRkvmQOigZZc?= =?us-ascii?Q?nXjWpnjaR2UIhOC5uWjcVXDcP096aEELgzUzUd5jZVJEqjVQuibrUbg1j4cu?= =?us-ascii?Q?SndMF9AloSySpYluhd66A0cYYgMzAL2F1qFdWdLdvobE/WGVNpYdlqYxPAEP?= =?us-ascii?Q?CcdoC8FqJwmzvHx6AI5/EtCKVbr497t17NbIGAgkuDubzaO59hcVMGkqh6tM?= =?us-ascii?Q?iCDtQBFzmdV2TKUnmT1o923SsVI8ZkZPJaITLosU6d9jQi4JvlqWScD5Fhi5?= =?us-ascii?Q?kX5SfpAf5JlYKCnPXpj+77AYUQtjBwGnUwC0r9arby+BuxeaaUBA8Mrybd+k?= =?us-ascii?Q?TbzbzawVPsKsiKhtqma/mreYzF3PNBK4oEkZrSzKisi5sTK4zyjoY7AzxhPf?= =?us-ascii?Q?9ZoOn64wDjixr6fWXU9Boq25YEtSw1FIBP3TnPPGX2L7xrK/5FFpkogX0o43?= =?us-ascii?Q?7DQ=3D=3D?= X-Microsoft-Antispam-Message-Info: oOfkaRY1WxmDN6tgc2aFxYFzG4n9I6JSsiXgqJgt/UWBCalgX+DgdO5pL1/iI8lLOJ6+Hi9zPx0M/aBwbb7aYfKpR28PrOaAe9s2ztVNpKS/TRxH36e2qiWERDJLZ/tP+pq6dw2GgP/ROOKvgTzagwBGvY63dnEc4+HTV1TtoCrKgHYufl9/yl62j+s+LmVs X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2320; 6:3wSXRX/4XYJmmzIL5QKb8onFYX89kSlSvWywwKdJZUVZPG6D19sJUmmdx4rxO5V9dxjVjKBkij7MOfWWd3RZNHpyRkersp7p7Zmi+UybZRpqneAXZFCEk8Iix7xcHSPQwhFfImWKBft8jgmpWMaDyfWttExhBxPDgAYdU6ub11H7JlIue8n76pQwpnt9d4dt2ST15N9KzoHZXjwXRK/Sbe8hXr525nSGpWUKugNc3WNQ9ddn8KpBuNIC4MeBlWKdfr9wFpHSKBwdc7ZrDMWWQcMJ/q9ThaP4e6CdGHjbCEUvYCVRmyOYMJaOopc0Qat0dvmB7Ynq24+EbV5bEmyWNfyOWF+xBIxhpK06vVP9UqEi0T4GGvdPnRanW92cDoc5obsWW8Ze8bCpsqT5FhXzdZw38ipA0uw/+AYLW5hOwU7TRpN37/+MhI5I61sF3O/AIB/Xl+RpLw3Y8wkw24/j5w==; 5:FGRZTwVWiueo2lmCHZgJ/OQJ6jb0jxdYhm9STMbiItb1oUEWL40fG8VyMdJJVupKMViXf6CMetWDegWa3v/2b4cUvg4dLiPnwTmODmcJGInBGZtieHvTis8xW6VbiQurN8LwP4f2DSaknNtRjOiC/pHfimMDWv3L3yO09XdPyoQ=; 24:jrdduheTiWSu2UAR8DfuwFsTnoVu/3H7dnB625OHJ3AayN7SvrsMIM3PGc1xQtGdU3FQ6Jg7RLkaiJJcrW4axMH/6pLvYibq5meFyZR+19k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2320; 7:dao3hk3xJXK1qzgkqlC1yqKM41isezx4SMwBbpTAK2FLYNXQk2AZ7mqg9SyhDqcs8JfC9930HjxISSVfQw1sI+ljKaOPriKEyWhVkfDlzCtilce/SlJfiGXrvFi/uxzgqrx2sTfG3A6jzlQlfc1ac6gCsixb4v+Qk5SSQB5YSZPJUJAtVmR+KbhWFd7KGXL8P5zOn1AbOtKXiTIM4wKGoHw1FzNgdBvlTwFEmvsXaxQ3JW59pwyuX8qq7+k32kPA X-MS-Office365-Filtering-Correlation-Id: 3ec35138-9791-4251-6842-08d5b6926ab8 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2018 16:23:50.5837 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ec35138-9791-4251-6842-08d5b6926ab8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2320 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 16:23:53 -0000 Add an RSS hash update callback to eth_dev_ops. Signed-off-by: Ophir Munk --- 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..b08c27f 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 suppors 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