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 085A4A0C49 for ; Tue, 20 Jul 2021 17:17:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ECC4C40DFD; Tue, 20 Jul 2021 17:17:37 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2088.outbound.protection.outlook.com [40.107.212.88]) by mails.dpdk.org (Postfix) with ESMTP id CC36D40689; Tue, 20 Jul 2021 17:17:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OpGiqtDQ8FZHAgtLr0ly3CCJsleyoR2XYoSIqLyKj4d0g05H+7K9ycSR13PWcxb9S0Mfs8UIpU+qOQHEsu8Jj15Jlz1dVUV0rHesAAyvcEt5vIPhUnZdGDSQ6RZRJ28hxm/w1sOaqAcptQntG4NC2TARfT9aneJ3LdZxpA1FqTasM2vr/7Spyc75e6XqkkKW4NSciC80py8ZTac/BRzuOqIxUK7t2uLae0Fw5tAJbfG4iLhWcXiePbbTRDhomB4ZKEGJIOnG+wn6nbhgZa7TUuNyggMKQDYgJtwstVkqLs7vYgvMEUPXncWHr8iVYSym9MGAAb+MEW0KK/SCeVfFjQ== 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=wK/qh9aYcbGoafEwH5DlPINF/nGGG/VHN/6ewukca3c=; b=PCjjP1zDCl2Cd5cJh0oW4g54yU+dXcJfy+jC6herYXNs02Fg9Cv3j3ZfUQQtBt5HH8uYjrtZQ3ze89NNuJZ/N3BB2HxI5HWOD+MxotXjCFSzYfEhn/CYYEHaT5JA8PPNNzqdRE4drRVfdr56tvybI49ZoMU+qIzwuBkdjc6korkxOWWX3dGTKoIxVbmFyn8gTcpq2OVRdcNcTiAJRskryJR3f2m3lboCslxcePecYlU1oRZZPmGVcl23Me6w+Wzl4nNbnC4Bp9ryqIf0tLkmhzcYO2fzKVouIQDNMPG7aMh1ZlRy4BpGOVw7KGXRCkeiE2CLgztMvESMqklVqyHh+Q== 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=quarantine 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=wK/qh9aYcbGoafEwH5DlPINF/nGGG/VHN/6ewukca3c=; b=rmLRMg2NnWYUkoS5s+zQASxqJzU3Xv0s+v3gWsPEw3FQnE3tZkKEkEoC/lQT4D3AHDJRKimy9WiQG8q8OsrpuLA5ydg27u4/qm53i8O86mSCr8UNo1NDFMlLAMv2HoT+H56i2JBgkyaddoNnLQ0CjrelzPC6EdBxPIicqOqo7+zQRf6Y3uqEiivX9MrlDWxad3Al1AUTQc+tsgiWWlqdy+x7yNRzo8LPhBKCBX3mVW6GN6k6cTasYt0LHJQx/UUBnvLlnTQo0gSgelcxVolDLvqDRpy+hL5NldH63HeK1BCanHhuQLGKuomBLYYAnR+5U0ddMDenHDdA9gGnX39I5Q== Received: from DM5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:3:7b::13) by DM6PR12MB4634.namprd12.prod.outlook.com (2603:10b6:5:165::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.26; Tue, 20 Jul 2021 15:17:34 +0000 Received: from DM6NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:3:7b:cafe::23) by DM5PR13CA0027.outlook.office365.com (2603:10b6:3:7b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.9 via Frontend Transport; Tue, 20 Jul 2021 15:17:34 +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 DM6NAM11FT056.mail.protection.outlook.com (10.13.173.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4331.21 via Frontend Transport; Tue, 20 Jul 2021 15:17:34 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 20 Jul 2021 15:17:33 +0000 From: Lior Margalit To: , Matan Azrad CC: Lior Margalit , Date: Tue, 20 Jul 2021 18:17:18 +0300 Message-ID: <20210720151718.2789015-1-lmargalit@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] 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: e2f8e204-3f77-4090-10ff-08d94b91806c X-MS-TrafficTypeDiagnostic: DM6PR12MB4634: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lr1HxOBnmNKjAKw/4k3HqTEMeQBghqvmF+LNvKAG3SI+xuosSTnT+Dv/+1x8E9xHCO4Qxce2WCZPrP7TxJ+0aMbZ/kOCCgYMsSRczOzejfJETgTlW7TZGtg8InX5+9Ql/WbZeCUct1pk0lSn4NkigjMiMMKIg8N2nGZvMdydBTAj80XSPL1MNBrbrS1/yjs4wr/GszWBzg6/fNi4JlYaAtwkDHfIl470t0cyaBKsi/ot2nZxBEKVCw8JDcNAnz7J/WuZfRvjh4N0rbvUx0g9AH06Zaim1N0SoCUZqzwgym+H1GoRsrzbMbTawzJ3dQbJs8sQ5Vc9KpwrnE0V/1isrsvHqggcLy/qnvYiIMevkbNjebI4+uLQU9idOqYZEez+luSLZdich9IUx0AJk0PSWyUoxcfySt0AJL+k9meDSFW1RERLog7DwrU/g7sqb6HkSGN8JJ5k4TEikwl9XLFvzb1zHD4mtBL6XtxwgjfkRq0eL6+TdAWcXA1/oS52j7Ev5jKnFXRkS1wzii0Lc9fI1lhxxP3nmR5eKmoPwPPxRTs9HGmjmmRckwPCwqV17mo2DfIVJKGXqauVkOUHxxok6RExm8HWerZcvgReGMQPD2enJwqffo7emb5Xom6aPwrUa3m4oo8uzue9i/0qv1M5Tjt/9HwvxvQdJ88bvSCX5ZmwN73+QPSL96dBf+7fwchzIyNdzcA2QsKo0N9G+7TH7A== 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)(39860400002)(396003)(346002)(136003)(36840700001)(46966006)(86362001)(7696005)(1076003)(70206006)(478600001)(70586007)(36906005)(6286002)(5660300002)(47076005)(83380400001)(426003)(186003)(82740400003)(336012)(55016002)(36756003)(110136005)(6666004)(2616005)(36860700001)(82310400003)(7636003)(316002)(26005)(4326008)(6636002)(54906003)(2906002)(8936002)(16526019)(8676002)(450100002)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2021 15:17:34.5543 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e2f8e204-3f77-4090-10ff-08d94b91806c 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: DM6NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4634 Subject: [dpdk-stable] [PATCH v1] net/mlx5: fix ETH validation for GTP X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" The user is able to create a flow rule pattern with ETH after GTP although it is not supported by the flex-parser configuration. Failed the rule validation in such case with proper error message. Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function") Cc: stable@dpdk.org Signed-off-by: Lior Margalit Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 347e8c1a09..69a6a5c76b 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1992,6 +1992,10 @@ mlx5_flow_validate_item_eth(const struct rte_flow_item *item, return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, "L2 layer should not follow VLAN"); + if (item_flags & MLX5_FLOW_LAYER_GTP) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, item, + "L2 layer should not follow GTP"); if (!mask) mask = &rte_flow_item_eth_mask; ret = mlx5_flow_item_acceptable(item, (const uint8_t *)mask, -- 2.25.1