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 1548FA0350; Mon, 28 Feb 2022 10:53:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B3F741157; Mon, 28 Feb 2022 10:53:23 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2071.outbound.protection.outlook.com [40.107.96.71]) by mails.dpdk.org (Postfix) with ESMTP id 7ADF94068C; Mon, 28 Feb 2022 10:53:22 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nx8v2gVtNrIvgk3ud8BO5fhHKIQrwmbD6gsZCPBT3S6jUb7fxGEEYG/MGGAty/eK28k6Qnm5cn+0CjWzv47KokoJ831jkuoy5yIhm22RPKu448CdcDtDVbT2JaE4f/XyZgPnhVLWBbHFoJ8mi3a+CY32EeLdKofdogmsm9/FQzk4rbvVc5X3bYBhZlsqwIfat7lgUUjZVLGINE/XK68ELiBCKjDQD0LVa8CHvXHzlN3bxwltaamUz1yDflNcHXE367A0RE4AfsOMP9xejhu/mFQvVJD3PKZ0UQTpSTiuVl484wit9t94o9biOXIcDKPOzR33QexoATcyFIDYwDYpCA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ff3Xl76Owgc4l7BFuh/bG/GCFKOtZP6OtEs/rWmARGs=; b=jLalPrSd5e0KmQtX9mwZF5mpPAkBfwzrFsrcDZBQ9ZUyl4d6LrxS0z0eWAqrjzK3/79tZOvaDm055/o5U6MpTgJzUKmZfR0Jv0UkiHQxJZ1YaC+IZZ3zl7O+eBIOWQa8lCWRsbN/xTzULnjQQTkEl6Nc0MJkBLzVPgOUUV5ewRR2JwSM47lSF19KuvQyZlAYSv62bRBW9xb/rvwrtPLgl5JYPtqE1xj4JQ/Q1B4ennbkGXO7pkeKC2/48pF/exEhaaJlQW/pro6eBKvrFDuGlYkHYjMCFRVOQ6m+5QvhOKFM3/VUG3TPZwcypZtxBwKWQZPQET3y5Fymf3LOs9qUdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=Ff3Xl76Owgc4l7BFuh/bG/GCFKOtZP6OtEs/rWmARGs=; b=r5UDQQ7xDSNGjGr0jbRYyK84vHiqlOIs83SW+ppbI+eR1WL2kwp5xRoR3PUkorwJydFttIEaqsaRN3zAEypmJ7pv3Pk2jwOAtvdg3FmXZh3pS6868g1Ya3bNdUNeyyMLWLhfTxFevYPGz6YkPWofiYJqKlF7j6G+7JUTASGl9atnqnYL/WfwyMtkkb65JOO55FkFNy+BQ6FFQ4RiU2/O6FNfSxdlSo/Qf+4uLPAj8Q6cg61eQhFL0/oADHoI/vuZtXOs1CAXt/uKaH1cy9AWEDifwndimacAi5Z4n5n8MN9tSWRCccqujj3xxd8w+CuP3Sto81MRKND5sSTwXwV0Ug== Received: from MW4PR03CA0023.namprd03.prod.outlook.com (2603:10b6:303:8f::28) by BN6PR12MB1363.namprd12.prod.outlook.com (2603:10b6:404:1f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22; Mon, 28 Feb 2022 09:53:20 +0000 Received: from CO1NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8f:cafe::53) by MW4PR03CA0023.outlook.office365.com (2603:10b6:303:8f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22 via Frontend Transport; Mon, 28 Feb 2022 09:53:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by CO1NAM11FT051.mail.protection.outlook.com (10.13.174.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5017.22 via Frontend Transport; Mon, 28 Feb 2022 09:53:19 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 28 Feb 2022 09:53:18 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Mon, 28 Feb 2022 01:53:15 -0800 From: Gregory Etelson To: CC: , , , , Viacheslav Ovsiienko Subject: [PATCH] net/mlx5: fix GRE item translation in Verbs API Date: Mon, 28 Feb 2022 11:53:01 +0200 Message-ID: <20220228095301.4985-1-getelson@nvidia.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f4e33d96-408e-4a11-aee7-08d9faa026b2 X-MS-TrafficTypeDiagnostic: BN6PR12MB1363:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fJf4zHpnQOZvNamLco+YJf3oFfJVs74oyL7p1bLpHkL8Jj3qoilslv3hm0WBLMsPJjiWDeMYN9DUE4OGkvDAAYK7sP/HQv+rqp4taBp/a42hd/01btwl1Yp714bdLkdAQeLZr11w/vtiheSOY4WbN6An+s6sTZpRL+ecydJamc8SeTeX2hr6tD1T1nxDvritr58CnviED7FVo1Ynccax2EI2ZlGaNDGBKWYOEbGJVV6ZEPZNJWMb15PR0f0eQhRmvXqsRlM9k3lXQg6F5UTyXZ/r6VtraoGniugO1ntMPWefq1cuJ+1QvCFMlWgeocDV+3V+fK/GePHKxX5d3T/Ap1wgxTJEBV4ctbmpLhCdIpi+mfBR0HsD67FBvOr8b6w1xzqUhI3RIFpwQJHz+R8BCmQgIJ8enpVTA7jaoYbcp3XSMGPHBtS9yBGBnFRjzbdIfQuUIUUPbcKpqR+GSOyn7V3jIYs04X0z9gG4trEe3gr0+H33uAQg0DI55sYiL2kp/9fPDRQFjuv2zDjy8NmmNo7DH8JvU5SlnXBoaa2f5b7L5OhQFQ5Wtt9Qq9bbh8EEUxT5+kTL5J1yvbqmNYe8KUhZCaYErN6cASG4cjqiSYuJNDOi4Q6PPPVhyaoqK9eSmspLmzCtSfejBrCJ+JHZ+cSsypmA1nUjy80vJlGbgRQB7SC/qCF5JOm30KmyIg2hZCkh3ToBqnhPsZq+dmfF3g== X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(2906002)(2616005)(107886003)(26005)(186003)(508600001)(6286002)(16526019)(55016003)(316002)(5660300002)(6916009)(54906003)(86362001)(8676002)(4326008)(83380400001)(8936002)(82310400004)(7696005)(450100002)(36860700001)(1076003)(70206006)(81166007)(70586007)(356005)(36756003)(6666004)(40460700003)(426003)(47076005)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2022 09:53:19.9966 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4e33d96-408e-4a11-aee7-08d9faa026b2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1363 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 GRE item translation must set inner protocol value. For that reason the item is not translated inplace when PMD translation iterates over flow items, but moved after the loop, when all inner types are discovered. If PMD does not translate GRE flow item inside the translation loop it must save the GRE item for access outside the loop. Cc: stable@dpdk.org Fixes: 985b479267aa ("net/mlx5: fix GRE protocol type translation for Verbs") Signed-off-by: Gregory Etelson Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_verbs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c index f08aa7a770..85f0788222 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -1679,6 +1679,7 @@ flow_verbs_translate(struct rte_eth_dev *dev, struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_flow_workspace *wks = mlx5_flow_get_thread_workspace(); struct mlx5_flow_rss_desc *rss_desc; + const struct rte_flow_item *tunnel_item = NULL; MLX5_ASSERT(wks); rss_desc = &wks->rss_desc; @@ -1818,6 +1819,7 @@ flow_verbs_translate(struct rte_eth_dev *dev, case RTE_FLOW_ITEM_TYPE_GRE: subpriority = MLX5_TUNNEL_PRIO_GET(rss_desc); item_flags |= MLX5_FLOW_LAYER_GRE; + tunnel_item = items; break; case RTE_FLOW_ITEM_TYPE_MPLS: flow_verbs_translate_item_mpls(dev_flow, items, @@ -1832,7 +1834,8 @@ flow_verbs_translate(struct rte_eth_dev *dev, } } if (item_flags & MLX5_FLOW_LAYER_GRE) - flow_verbs_translate_item_gre(dev_flow, items, item_flags); + flow_verbs_translate_item_gre(dev_flow, tunnel_item, + item_flags); dev_flow->handle->layers = item_flags; /* Other members of attr will be ignored. */ dev_flow->verbs.attr.priority = -- 2.34.1