From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0066.outbound.protection.outlook.com [104.47.2.66]) by dpdk.org (Postfix) with ESMTP id B92462C29 for ; Tue, 21 Mar 2017 00:04:53 +0100 (CET) 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=RZC4pVqLqdbXzf3e8PFH93MtlEPHvz5f24ls+RNvRGY=; b=Ndgq4VHTeoHJyeiDFnCr12YqsS8Wp8o9yNMk4mKWomh2bs9bBKBsGH0apNxodNK7sSk3ajhMbYCxr29UrMJde9kbYTV57WXSK1gUIRSJtQn9Pc92/ngSLgY3YpgITLbo1x3Cs2ftb/QV6AM+eVp2gSm81nUo4JZVA5C+o11yGE4= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=mellanox.com; Received: from mellanox.com (12.250.235.110) by VI1PR0501MB2462.eurprd05.prod.outlook.com (10.168.136.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Mon, 20 Mar 2017 23:04:51 +0000 From: Yongseok Koh To: , CC: , , , Yongseok Koh Date: Mon, 20 Mar 2017 16:04:34 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: <20170316224056.19685-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [12.250.235.110] X-ClientProxiedBy: BN6PR1301CA0021.namprd13.prod.outlook.com (10.174.84.162) To VI1PR0501MB2462.eurprd05.prod.outlook.com (10.168.136.13) X-MS-Office365-Filtering-Correlation-Id: d876e610-1afb-4695-f48e-08d46fe58475 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:VI1PR0501MB2462; X-Microsoft-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TXpuVNibTcNVxkWxQZa1GG2McVnoihc7aKDFZHv97jWziTctn0UGUSRuJbngfdNhV7cfIK; 20:7wBGvuyJ6wYfr9gn1qYIq2Q2VkrDDoe4EtQKbNsk/qN3s7ykX31tZUBuj9jTSGlRuoUuKb2FkFLj9yLSm5wIMYhV2bha2W0YASxT8KV9cpvckhfNNfkmwEwfLFINrvBIhHPz0fMZQlbzF5mt2bhJ/e27jV84aoS98Z3Sy9u/baN2UIX9Zu9wyWWTT7ycjsyJhwjgdUfniQMmxngSQdE5mTuuWv6TmMQJ7BTJxbOwSrG5I2g8plmC+pj5KmcOIw77V1/MPTlw8HoZ6NHgXwfO3DAvJcz2nzp7vT20zkkZ3UCssxG/J8ZzCYMgrN3q7L9vNEUJdSr5rqYYbALhMcDLhP2Z6VolQyBA3nG+d4cBbr904jt/DZvyjUwyWN7hkbiKyZNCNp8LNzv1m1xwQlGBxyj1ECmT8+Og7ydr5muqiUC1wLcUymR9FZD8EovJR0nf9qHvIL8jvxNGscH7hWpPoJ+J+7X0ddxmMI2tsJPexhOrwviELNJqytdKvwI2Xrm1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(20161123558025)(6072148); SRVR:VI1PR0501MB2462; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2462; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2462; 4:/y/nRHGHuKxPjpwFfyyCqermFuy5ofoQSzVwl66xdBv106Eyxpl81rJFvbOUNqTco78PhCmBfOTHH+jbJKBZuU5VYcap+KuW7+9D39dswZX3lyjhK8wBBXvAO5aYCkglUM6wqiaLZnj2BRVWXP1SPp+5VhPD+elVVyWNvGzTdlv4noz9EkViMKziWL2hzC7SPj8N3+s0j65DWW3+YTAtLLT0YkViYPG8MU66vgAf9jl3UueII7ikPuS+8QfJiTEZpEFB2exglnYiAy4OLPiU7dzIncDTNjoub6eUgWRLdpktD5n4japjeWSKAaX7Lg2iMKhyiE4Kz5bxSznODV6mcQR3eD6V0CjT/bBBnBc4fs3I+Vw084Jc/WND6K6CV75qvFGOeEO6t5hO+Pf/882xQzybyF3z3jOjjCgylSMLcgEXc+QE5w5s9ypmjdg2u58oQZyDUkSPh9i+2n8NyZCnnaXlkb1t2D3yHYw+KHUK2IJ2m0wEhmSrqmBAwhCz2ydVIqYVjvQmsySc4gkSvb24uBn1jFD97nHyQB2nKyKwpyqOzOI9w+75zzE2z1tyIATgt6VZw4GOfYggn0OY/6xP796h606fbeBeK44Y0Zv1QwlpUl0KcUpHT0ixlBwK8nev X-Forefront-PRVS: 02524402D6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39840400002)(39860400002)(39410400002)(39850400002)(39450400003)(305945005)(47776003)(33026002)(7736002)(5003940100001)(118296001)(5660300001)(66066001)(86362001)(81166006)(6116002)(2906002)(8676002)(107886003)(4326008)(3846002)(50226002)(38730400002)(53936002)(189998001)(6666003)(2950100002)(36756003)(54906002)(55016002)(48376002)(50466002)(33646002)(50986999)(76176999)(42186005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2462; H:mellanox.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0501MB2462; 23:Pnm4QWMVLtNK3F9U67zbodjnU4g1bPnXc+tUFuu?= =?us-ascii?Q?M3+CjfETLypAop5X4N4cWDmB5xsajpCWmjqEedc6ltQzimwjaNpS5tPgO7Tp?= =?us-ascii?Q?lYYCXJOGa+qVV5Nvtss7v4kHrRRngsKuPAVJvC/SuS0+SCm1wYWVJS5K0FZS?= =?us-ascii?Q?rFxl4Q7iJ/CJuea3auX52JQqHrc7IR/zmI8vEQE4AxN3KDcnC/imulpFtoYI?= =?us-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cJ4LPyXL1kayJ/v2bhZc3TOTTeZeDKtYURV094zRPL2e6y+9UYV4X4V/eXbIvnUxM/PLVd42Ibxcu1XPRKhazNwhaVsZerYWCOjTdDFwICX0IQq52pxZ7HjRKiXeS6paVdW4FOP2wgrPEaCMfXPzUcP45dSC8tJ528tUu6XdoPOjH8TitnS2bvqnrcA8TzRd6I7aLkiBUuJbPmuv0AdOyZxbd/KM5jgvVeexWeIlEoJjdXiey6+g7xsWVbCKivQt2qG0E+vLL0WhSexYtPknl8ZihRd6Cxo0+xU+o8hPqzoTg9m2VjvxSSf38lQxsj114nMoJoT+6wz0sztYKQYygT6iSul0ulB032yF+lvRB4SFyk=; 5:joXW9d//m0vj3f/YpSSqopXaWAtz0xFfblTPWc2/99FZK3y5GQbxQOeHYJpuHPQaCfCJsSYWKNISyyfNfRgMjrPw4lBBbE/47ubwQHjsYWFrps0gdJ6eI/Jvj2GH+Vo3fk3jglSb7MW0c2xGU0lRvw==; 24:0d7W38svcXvzx0BVQsKipDW8ielFHQntfQbO+FBeJIZEKyxF39+Z/EK5E2k2wC+4u2KTWSDahyP6fao7ctKiCNNtvff+VoYrh/ysI2NcS64= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2462; 7:w641cdD5df9yXrDcZQz7L0egs3mAayq3jv1jDjb4k0Oy8ctwQgmyB1FOiLAxBWHH4Nqada3HDJSdUh43TowbSFSlFVSexSSFmbbohpBEegrou9KCDKNamqIEoKkq7QEaMwzcwRhk8ClE8sxnJiQZRMehTjhZt73MHm/ukrwsvzLwYZIDpaHvsZUVKfpJLLzMl3M7R0CqQgqzPaar+rSb8Y/IPufC9RqzuqpduvAHw/05Te5crWUthOu/Grp0r/+2dNG2bWNPLq7pKByq3uY/4IimH/EgmNsyW7TQUjO6qQBbWWVyrl5Xn8mUG7CjoaTeLp5rIDKUns72U5m5LUx3PQ== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2017 23:04:51.2817 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2462 Subject: [dpdk-dev] [PATCH v2 2/3] net/mlx5: use correct RETA table size 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: Mon, 20 Mar 2017 23:04:54 -0000 When querying and updating RSS RETA table, it always uses the max size of the device instead of configured value. This patch fixes it and removed the related comments in the code. Signed-off-by: Yongseok Koh --- drivers/net/mlx5/mlx5_ethdev.c | 8 ++------ drivers/net/mlx5/mlx5_rss.c | 13 +++++-------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index dd5fe5c1f..0578b11e4 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -701,12 +701,8 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) DEV_TX_OFFLOAD_GRE_TNL_TSO); if (priv_get_ifname(priv, &ifname) == 0) info->if_index = if_nametoindex(ifname); - /* FIXME: RETA update/query API expects the callee to know the size of - * the indirection table, for this PMD the size varies depending on - * the number of RX queues, it becomes impossible to find the correct - * size if it is not fixed. - * The API should be updated to solve this problem. */ - info->reta_size = priv->ind_table_max_size; + info->reta_size = priv->reta_idx_n ? + priv->reta_idx_n : priv->ind_table_max_size; info->hash_key_size = ((*priv->rss_conf) ? (*priv->rss_conf)[0]->rss_key_len : 0); diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c index 0bed74eeb..0702f1a63 100644 --- a/drivers/net/mlx5/mlx5_rss.c +++ b/drivers/net/mlx5/mlx5_rss.c @@ -257,13 +257,9 @@ priv_dev_rss_reta_query(struct priv *priv, { unsigned int idx; unsigned int i; - int ret; - - /* See RETA comment in mlx5_dev_infos_get(). */ - ret = priv_rss_reta_index_resize(priv, priv->ind_table_max_size); - if (ret) - return ret; + if (!reta_size || reta_size > priv->reta_idx_n) + return EINVAL; /* Fill each entry of the table even if its bit is not set. */ for (idx = 0, i = 0; (i != reta_size); ++i) { idx = i / RTE_RETA_GROUP_SIZE; @@ -296,8 +292,9 @@ priv_dev_rss_reta_update(struct priv *priv, unsigned int pos; int ret; - /* See RETA comment in mlx5_dev_infos_get(). */ - ret = priv_rss_reta_index_resize(priv, priv->ind_table_max_size); + if (!reta_size) + return EINVAL; + ret = priv_rss_reta_index_resize(priv, reta_size); if (ret) return ret; -- 2.11.0