From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ophir Munk Subject: [PATCH] net/mlx5: set RSS key len 0 to indicate default RSS Date: Wed, 3 Oct 2018 17:37:33 +0000 Message-ID: <1538588246-21436-1-git-send-email-ophirmu@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: Asaf Penso , Shahaf Shuler , Thomas Monjalon , Olga Shern , Ophir Munk To: "dev@dpdk.org" , Yongseok Koh 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) Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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