From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6B069A034F; Fri, 7 May 2021 11:42:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4B964013F; Fri, 7 May 2021 11:42:31 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2077.outbound.protection.outlook.com [40.107.237.77]) by mails.dpdk.org (Postfix) with ESMTP id 90D2C40040; Fri, 7 May 2021 11:42:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SjRkSW96shwZWNEKsjoxgUtGwNY2+/wbtK2csa7NBA9IXH4l96Obm/T6QShH1Xnyc9QIjAchagWsusi2/jIkJtRcoYuMnDUDIpiBYXz0rmkBcSOE9m//GwytNrQa4u3wWiDDt/m/rHu9MNic7TAvx0jLamLYfnXbfJuFEwRjNMBhuwtTl9bDQiziE2a8pvf5ui18wvtkSv42GX0vBSTNRnA4YdbN3sTQS5NhggrrBsrGQ5pwgHBA/aD12T0O3t1CjZOjhAbP/kXwqlUI3sAaqkGiLQdsDhwOn4eCGZPZhM8toj3/8fpwiulYahZemrYAXJmDXpFpme5TdKwKf4c01w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HbwzAcBrJ04viPL97YCkf8oqEPgPu1jp3ZWEmi5C/as=; b=VFXngcRYBKv7yCpRQJCxbGPtt1Z+gwHgoFu5FmMuFJL3/6zYmuf8e0qIkiUfYpJfVyUoeuHeJ7vR6EII4SEtc72OO6gN2T0LmDDkhOfKc3J6t0B9U2TqOGQHBTZazyuYd3Ox+qHmKZEs6dGsrIOrHK3hgaQh+a3N5KepIpfsXJ728grHRGG3uYaIJQksairsHo/Y4SZc9CZkrpTqPrYt4ME5aLn6PHneyrJYhjvbyjKZUO00fn2sWeglER1Ju3uPSxR2jGAQraSl6lrpKJ+O7JIry1pP1cI00KHhhzAQLek8+HFki6J6xD2BD5HgSvlgZ6ndRSJdaMYLsqIpW3RpZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HbwzAcBrJ04viPL97YCkf8oqEPgPu1jp3ZWEmi5C/as=; b=ufGzs/Hzm6QoO3487pAHV5AfdFOlpFgLS/bozaqhzvKg6KdqVevfCMf3qB9bdUZ6dgSnjFuNTbJ5PIhia6gVamGfG5AJVliYxE9rzR9/hcS+yJZjkbgAxE31iTMWenO8pw9/ZlzdMQhS+Z8RLjFWG8ABkGQyCOLHtEiT6EDnawmZO3vBDQo2zy2VKXXsii8/ohFvI1oEKT+liJt1ni2Lqqrmn7nYJJlZ7YHm2fK+NpQMmrMjarVkHy+bxzjRLEauT/n8OMQgjwu5Gu5BwCt2IODYLOMNFRIiucBUDjmdf3sz9OrHEGpS8bNBEjoLcsn/iOIS8Z8gvyl6Egc/NzjS/Q== Received: from BN9PR03CA0365.namprd03.prod.outlook.com (2603:10b6:408:f7::10) by DM5PR12MB1642.namprd12.prod.outlook.com (2603:10b6:4:7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Fri, 7 May 2021 09:42:29 +0000 Received: from BN8NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f7:cafe::32) by BN9PR03CA0365.outlook.office365.com (2603:10b6:408:f7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Fri, 7 May 2021 09:42:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT005.mail.protection.outlook.com (10.13.176.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Fri, 7 May 2021 09:42:29 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 09:42:27 +0000 From: Jiawei Wang To: , , , CC: , , Date: Fri, 7 May 2021 12:42:12 +0300 Message-ID: <20210507094212.39250-1-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c2d56091-f225-42f3-d2c4-08d9113c6e1f X-MS-TrafficTypeDiagnostic: DM5PR12MB1642: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fiK2cCLqeeTy25LkA+O/DonKGGwPG5GIQ3qq5W6O4hPIU+J/tC04VYUqkjeIlh6IyKgLb5wjd2Ws2k+TXszdI2wEmTF91wXekZeuRcjZIEwGIt2zKygX93qOWlb6mSnpef57X1F/OOlswOV2MtO1H2/0SApR7llrEfqLe6dd5vrDii1gkPh+TrUtMOK2EFgugvBMwn3QlDmeukUPihOAWioSwUlmo1SnE7LqcHFI3l73qEP9PfCwkcbbaiHgyRA9r+MhMG94/goHyugr4diSdpgae+VA7NuXgg6C4DuBOv1HdvNBHdmZaHpsLV3sRLCOlxVPfKWOO7Y1qe529x5pcGaDwiVR+CURwuyTwtBXEMrTNhRQR+h48a3s1a7JokGCojDehqAVxtk75NVShCKdxrL4yXao4yreSzNXMn6nKCBAj/RoZ0TrjtoqQRq0xlOXCOhRS7UeOiEwV+YvEWjpcBT3pKx8omzfN0/Kmjq1aeK4Q5sDcn8dowNqz+M9GuJE5BPCqAf12P18Nxf6I8571PX3aBlLLvGneYd+TjeGDi/Z8MnYFCkZoZ6yb5v3ESNxTIRnpG2AyI5HgPu0BL1oqylpaiXkrJArXyKs9QVj7Gcv/9o7bMPM01UOZBOmYN0aab3+kqnZNcPqzGGqSnKB8w== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(376002)(396003)(39860400002)(346002)(136003)(46966006)(36840700001)(82740400003)(16526019)(2906002)(356005)(7636003)(70206006)(1076003)(26005)(5660300002)(4326008)(6666004)(70586007)(186003)(86362001)(8676002)(426003)(54906003)(47076005)(450100002)(7696005)(478600001)(36860700001)(36906005)(316002)(110136005)(336012)(8936002)(55016002)(2616005)(82310400003)(83380400001)(6286002)(36756003)(6636002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2021 09:42:29.1116 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c2d56091-f225-42f3-d2c4-08d9113c6e1f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1642 Subject: [dpdk-dev] [PATCH] net/mlx5: fix RSS expansion for GRE KEY X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The support of RSS expansion for the flows with IPv6 GRE item was added to mlx5 PMD. And the GRE KEY item support in expansion was missed and the flows with GRE and GRE KEY items were expanded in the wrong way causing the flow creation failure. This patch adds the RSS expansion support for GRE KEY and mlx5 PMD performs RSS expansion correctly. Fixes: 048f0d45e342 ("net/mlx5: support RSS expansion for IPv6 GRE") Cc: stable@dpdk.org Signed-off-by: Jiawei Wang Acked-by: Xiaoyu Min Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 3194cd5633..3a95754d09 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -99,6 +99,8 @@ struct mlx5_flow_expand_node { * RSS types bit-field associated with this node * (see ETH_RSS_* definitions). */ + uint8_t optional; + /**< optional expand field. Default 0 to expand, 1 not go deeper. */ }; /** Object returned by mlx5_flow_expand_rss(). */ @@ -212,7 +214,7 @@ mlx5_flow_expand_rss_item_complete(const struct rte_flow_item *item) return ret; } -#define MLX5_RSS_EXP_ELT_N 8 +#define MLX5_RSS_EXP_ELT_N 16 /** * Expand RSS flows into several possible flows according to the RSS hash @@ -366,7 +368,7 @@ mlx5_flow_expand_rss(struct mlx5_flow_expand_rss *buf, size_t size, } } /* Go deeper. */ - if (node->next) { + if (!node->optional && node->next) { next_node = node->next; if (stack_pos++ == MLX5_RSS_EXP_ELT_N) { rte_errno = E2BIG; @@ -405,6 +407,7 @@ enum mlx5_expansion { MLX5_EXPANSION_VXLAN, MLX5_EXPANSION_VXLAN_GPE, MLX5_EXPANSION_GRE, + MLX5_EXPANSION_GRE_KEY, MLX5_EXPANSION_MPLS, MLX5_EXPANSION_ETH, MLX5_EXPANSION_ETH_VLAN, @@ -513,9 +516,16 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = { }, [MLX5_EXPANSION_GRE] = { .next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4, - MLX5_EXPANSION_IPV6), + MLX5_EXPANSION_IPV6, + MLX5_EXPANSION_GRE_KEY), .type = RTE_FLOW_ITEM_TYPE_GRE, }, + [MLX5_EXPANSION_GRE_KEY] = { + .next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4, + MLX5_EXPANSION_IPV6), + .type = RTE_FLOW_ITEM_TYPE_GRE_KEY, + .optional = 1, + }, [MLX5_EXPANSION_MPLS] = { .next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4, MLX5_EXPANSION_IPV6), -- 2.18.1