From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10056.outbound.protection.outlook.com [40.107.1.56]) by dpdk.org (Postfix) with ESMTP id 205A91B135 for ; Wed, 3 Oct 2018 19:37:35 +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:X-MS-Exchange-SenderADCheck; bh=nqU9GuZrwYdge9o6Ok1kQ0F4tdLl+qAmKukhLhSX6Fo=; b=Y+2gGYtiEYKE/KcTUqPC/TH6/P+SyfZROC7+Qel+yKEwQRpNwRi7vZjsohLQiGfpOoHwXps+gIl6VDXJb4Bzlv3I7IUQnq1KkpG5/8r1+SEKwRmRztTsONY1qK3d03MPgmWOnDdFQq9cUQ3BjZCYOiKn7QHVSglWOmku8lHkX/Q= Received: from VI1PR0502MB3743.eurprd05.prod.outlook.com (52.134.8.154) by VI1PR0502MB3789.eurprd05.prod.outlook.com (52.134.9.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.21; Wed, 3 Oct 2018 17:37:33 +0000 Received: from VI1PR0502MB3743.eurprd05.prod.outlook.com ([fe80::e48b:53fa:f268:753]) by VI1PR0502MB3743.eurprd05.prod.outlook.com ([fe80::e48b:53fa:f268:753%2]) with mapi id 15.20.1207.021; Wed, 3 Oct 2018 17:37:33 +0000 From: Ophir Munk To: "dev@dpdk.org" , Yongseok Koh CC: Asaf Penso , Shahaf Shuler , Thomas Monjalon , Olga Shern , Ophir Munk Thread-Topic: [PATCH] net/mlx5: set RSS key len 0 to indicate default RSS Thread-Index: AQHUWz/ESBH47HIm1UmG4BuA5+cC8A== Date: Wed, 3 Oct 2018 17:37:33 +0000 Message-ID: <1538588246-21436-1-git-send-email-ophirmu@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR0701CA0043.eurprd07.prod.outlook.com (2603:10a6:3:9e::11) To VI1PR0502MB3743.eurprd05.prod.outlook.com (2603:10a6:803:11::26) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0502MB3789; 6:zILEvQ8Nk9V9904HqcX92cJgRm8VGlVSkjsMAr8mJxO4F8lt+kseIYnjFuHWX26pVuU5Gxk0IdsC/GZQPTXdwLoLnbofWF76fLZnPW/06Q+sKvFmlMU42gV5DG8hkBdDBgscfGKzU7lE7rO1s3EKHPxuZLDIDEG0LWI7wfivsa5vIDs9gwpJMUQg4cMwPwzvXn5Mmy3DLWg+OG+wRCf6LeSjdIvah82NshirD55ycKO8GJJYy/qGEGs6DKEMvGr351EjRcy70Xvo7rzJ7tooJSYE9tkzkxR926EUYFuZ0HwBi73O6H63RvpbL+Cfa21yAEFSoNsYrfcdznjblGCg3vJPOxIDc9hqYjDPUhM0sFS5BfEV8Sg1lEJziasqNA7oXj6iSnev7kMvQ3Vsl2WYqUZnqKOjLS7feNKvKgDkEc+4QawvvtZnn7SRnerS3e2zhBEQXJ1O2asOxBLjcJIVJQ==; 5:szb1Jff+H+GIoPpb2CjPm3NL/9ggaxmzrczwEJhfA71ffziwe5wIIwHcmd8KEUBCon4fVqFS3v3mIoJgBqEVT9HfQti9eQp+542ERQMOmEv4pQ9cxzoQicQaUy5S1PmMeeSAk647Pj8y3Wivm6fwqPyBiJ8tQjwKI4CQ8xvBg9U=; 7:fem0q2UDL1micngDNnP7eMGZZnIrgYMJJbLplj1qzXH3Y3z9w8DCBA4bm7DbA3sPz8z67Ue+scBg8bJXyvvYYa3ZftO1Ira38DGeXcEnK8ne2hlaUXVewizTb1kiisp2/ytm9pO3dRg7ybG5GbMUaK/mq2+n7s+iy7kbAypokT9MBuftirgb8IUD59geW3OpmymtsFkasRupycE4sN8CgSW2Q3w+rwfpUtOcyrH0++1ZLwe+kjMmm6c/JMmrHG7v x-ms-office365-filtering-correlation-id: 024f1e24-3b56-4a8f-9856-08d62956e6b0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0502MB3789; x-ms-traffictypediagnostic: VI1PR0502MB3789: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(278428928389397); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991048); SRVR:VI1PR0502MB3789; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0502MB3789; x-forefront-prvs: 0814A2C7A3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(39860400002)(396003)(136003)(189003)(199004)(2900100001)(186003)(7736002)(305945005)(316002)(81166006)(36756003)(486006)(81156014)(8676002)(66066001)(105586002)(106356001)(8936002)(25786009)(478600001)(2616005)(14454004)(68736007)(476003)(71190400001)(102836004)(110136005)(6636002)(71200400001)(54906003)(386003)(107886003)(6506007)(256004)(52116002)(2906002)(6486002)(26005)(86362001)(97736004)(5660300001)(2501003)(4326008)(6436002)(6512007)(99286004)(53936002)(1857600001)(5250100002)(3846002)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0502MB3789; H:VI1PR0502MB3743.eurprd05.prod.outlook.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-antispam-message-info: udbo2zLjhEspb5g2aqzTZl4u5W7MEd/NA6kKRs+Ug18eNoMz3v6QdcWolSgCtHwwhAXUz0SJsIEW+Krb1GS+8rbsBzq7DbNLk6HlJ5mHJ7p22UzDEtXV/U+mGo8dgHHnwCk/xDc/orG3yr7k/mp3mAYSP4+ILLiX3fNDkpwRAGK/m+nj6b1pjTZ8Kyjwv8TLFKcbxjDS01bZUcm4k6zGi+/tNKY5dV/Pkm5Emj6IAbRrZnKbpb6zGHTnlIDp3VY2i//dR6Dd68HT3By2mtrwv9AWzXHKbKwEI357IbbQZ8CEOc1F8RnURrxv6WLc4Us94i5qsFanwTxO0Yxn6XSOIXUxkc9Aef5vevnsxYBaTLI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 024f1e24-3b56-4a8f-9856-08d62956e6b0 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2018 17:37:33.7295 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0502MB3789 Subject: [dpdk-dev] [PATCH] net/mlx5: set RSS key len 0 to indicate default RSS 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: Wed, 03 Oct 2018 17:37:35 -0000 Applications which add an RSS flow must supply an RSS key table and an RSS key length. If an application needs to add the default RSS flow it should not care about the exact RSS default key table and its length. By setting key length to 0 - the PMD will know that it should use the default RSS key table and length. Signed-off-by: Ophir Munk --- drivers/net/mlx5/mlx5_flow.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 3f548a9..18eacf5 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2062,7 +2062,8 @@ struct mlx5_flow_tunnel_info { RTE_FLOW_ERROR_TYPE_ACTION_CONF, &rss->level, "tunnel RSS is not supported"); - if (rss->key_len < MLX5_RSS_HASH_KEY_LEN) + /* key_len 0 means using default RSS key */ + if (rss->key_len > 0 && rss->key_len < MLX5_RSS_HASH_KEY_LEN) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION_CONF, &rss->key_len, @@ -2106,7 +2107,7 @@ struct mlx5_flow_tunnel_info { memcpy((*flow->queue), rss->queue, rss->queue_num * sizeof(uint16_t)); flow->rss.queue_num =3D rss->queue_num; - memcpy(flow->key, rss->key, MLX5_RSS_HASH_KEY_LEN); + memcpy(flow->key, rss->key, rss->key_len); flow->rss.types =3D rss->types; flow->rss.level =3D rss->level; flow->fate |=3D MLX5_FLOW_FATE_RSS; @@ -2948,7 +2949,7 @@ struct mlx5_flow_tunnel_info { flow->rss.queue_num); if (!hrxq) hrxq =3D mlx5_hrxq_new(dev, flow->key, - MLX5_RSS_HASH_KEY_LEN, + flow->rss.key_len, verbs->hash_fields, (*flow->queue), flow->rss.queue_num, --=20 1.8.3.1