From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CEA0AA0565; Mon, 23 Mar 2020 15:21:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EB8CE1C068; Mon, 23 Mar 2020 15:21:43 +0100 (CET) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80081.outbound.protection.outlook.com [40.107.8.81]) by dpdk.org (Postfix) with ESMTP id 0CDE21C05C; Mon, 23 Mar 2020 15:21:43 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lOvhUMwIZjBRNlKS+sjpyak47koUlEU0nQXAKIB1UIuzZNgpDkpTtRHPHIbroowyXYjDT4SSFOUwpooQoaupvCQ6lhBTbyyJIdpXUdmOZ8vqpSODpBuqJFNSVI4MT8GOuVoovrhhQ8djOv3bErsAKoEOJLlqZeQh3fkO6F86E2JjZvknj2aIOU+KWwWBm+UOaui7q5ZLqZT7ASVITmdLggRqHw/nKKJvGKf5o6y6v7wiii2roY05q9v4rUwG9ceOLaCpgKDJqyqTo+VsPmh7JeOJURcSIaSknmSpyFcVnOywKe+kWoQFkwHEyQ+rvz+BKJIHcWd/kmn01xC6J+auGA== 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=gK6e1FgQwEz9Y9FGEejoF5KU+thIMyqP5w8B4R5Sjjo=; b=EVgOiBitvs2MN6J7cJqS964qn/xWjDwliNTaQLPUVqgLywuvVqiWbhW2FUZHOgACv3V2til7iQWdDCRQfPKLPD6xD4wsfKGPwMHXu5htW4ibkrGSBYoo40ou40uYQTfmhK8EWrV0gPzXoofLA9fEpZcpw+4SAn0QaC+Lj4nLhoHknNtJOPwJmPgrb/tHwgWdcoVm8MlSLKlzo+xVbs7zoCnea1bEqhSdvzzel1Koq8s0hQlG417TUaPpwqkRO2ukcT1FQ8E/eCYNgvyekVBOcB2G8fD2mdq2WMzYLU0nShHARYnmkhx1z0RsPWtrNV6LRlGuD/BQA1IFPgOh75yQfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=gK6e1FgQwEz9Y9FGEejoF5KU+thIMyqP5w8B4R5Sjjo=; b=KGJRT4zoRqw3Xxv0SQErE+Qwh1pE4FM28JNXfbLg+FtkCMTTL0Zx5DFNZsi3W4ACopbp3yIKFQA12fblawsinSX8y91vI1Rh2Qh16gu+im6Q77Q+5eb/9vfNvVrVUm7J3uH6uxpXYuPLb6QN526Gt62kXoZBeE2MJseZ2TFAbvk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (10.186.174.145) by AM0PR05MB5089.eurprd05.prod.outlook.com (20.177.41.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.20; Mon, 23 Mar 2020 14:21:42 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::adbd:45ca:54:bba9]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::adbd:45ca:54:bba9%7]) with mapi id 15.20.2835.021; Mon, 23 Mar 2020 14:21:42 +0000 From: Raslan Darawsheh To: matan@mellanox.com, viacheslavo@mellanox.com Cc: dev@dpdk.org, stable@dpdk.org Date: Mon, 23 Mar 2020 16:21:33 +0200 Message-Id: <1584973293-186-1-git-send-email-rasland@mellanox.com> X-Mailer: git-send-email 2.7.4 Content-Type: text/plain X-ClientProxiedBy: AM3PR07CA0122.eurprd07.prod.outlook.com (2603:10a6:207:7::32) To AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (188.161.229.72) by AM3PR07CA0122.eurprd07.prod.outlook.com (2603:10a6:207:7::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2856.12 via Frontend Transport; Mon, 23 Mar 2020 14:21:41 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [188.161.229.72] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7b00db22-3dbd-4e49-f4f0-08d7cf3581fd X-MS-TrafficTypeDiagnostic: AM0PR05MB5089:|AM0PR05MB5089: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 0351D213B3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(39860400002)(366004)(396003)(136003)(199004)(8676002)(81166006)(81156014)(16526019)(6636002)(52116002)(7696005)(8936002)(26005)(186003)(86362001)(8886007)(66476007)(66556008)(316002)(66946007)(6666004)(478600001)(450100002)(956004)(2906002)(55016002)(36756003)(5660300002)(2616005)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB5089; H:AM0PR05MB6707.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RM2QVrnv/Pt23SuvxW2w6D5l5fW5coy9nKQrJYLOxa33XZxTEVPEDROOBFvnIaY/PHBeJQJQ+R68laf876tR9yTilHu7/wFHFSImcaDuhjNbC/mEfVNCtjlySqM1MSb7TwmapJcpR+CMjvow32bLaP1LlRSEcLOr/C1gvLsS50XPSLzi9IX3pKnFjYqpZyfqEcDUoSBULhDZsVqJCj87zOjzyG0g5grraeNWL1/rbxiDvEi+sb8q8eZYZvQ/UAoXSaUOyHkY3S09uW1rzjgv6XdaJqCETZ8PdvjVnD4S6/NIIfW52TM9rdr+e7itSKKdbNxXbdzdhBTtWXwuRH/NtJeapIW1CoXcElT8R1qMHnuZPOtUB99ykwFFV00IxMsV+CIkCEq5M8HlvPvIC6Bj3XS7Wi6t8nNsksfhqBai93OEohJqsFRHCWstrmBI6iRY X-MS-Exchange-AntiSpam-MessageData: QFdVGjGbt5DPNbGyJXkx4oWn3sA04nldttQMa3Mz5b9W/EoD3jpq/rLe988tkLlAHXYZvSlfY69n53eHbpvc2BLyHGNQhhVlzWhIcgXFzXs85JV5bJdfw+4DHx9Tk4EMdD3YT7J3GOp34JBitAplEQ== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b00db22-3dbd-4e49-f4f0-08d7cf3581fd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2020 14:21:41.9376 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1X8pthIrE1WnztPEYQs6Cg4HbfJZo1X9APBnKbcEAG55SFv4nKL2cDdIP0/j44tVoaAHWZYAkcjpBdy5KGawfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5089 Subject: [dpdk-dev] [PATCH] net/mlx5: fix validation of VXLAN/VXLAN-GPE specs 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Trying to create zero spec for vni wasn't allowed, to avoid matching all packets from previous layer (udp). This behavior is incorrect, since VXLAN is being identified through the outer UDP destination port. Currently, if the user didn't specify outer UDP destination port the PMD will automatically match only on outer UDP port of 4798, and if the user want to match on some none standard port he need to specify it explicitly in the rule. This removes the limitation of vni spec to be able to match any vni. Fixes: 23c1d42c ("net/mlx5: split flow validation to dedicated function") Cc: stable@dpdk.org Signed-off-by: Raslan Darawsheh --- drivers/net/mlx5/mlx5_flow.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 41072da..2ef6558 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1836,7 +1836,6 @@ mlx5_flow_validate_item_vxlan(const struct rte_flow_item *item, uint32_t vlan_id; uint8_t vni[4]; } id = { .vlan_id = 0, }; - uint32_t vlan_id = 0; if (item_flags & MLX5_FLOW_LAYER_TUNNEL) @@ -1863,23 +1862,8 @@ mlx5_flow_validate_item_vxlan(const struct rte_flow_item *item, return ret; if (spec) { memcpy(&id.vni[1], spec->vni, 3); - vlan_id = id.vlan_id; memcpy(&id.vni[1], mask->vni, 3); - vlan_id &= id.vlan_id; } - /* - * Tunnel id 0 is equivalent as not adding a VXLAN layer, if - * only this layer is defined in the Verbs specification it is - * interpreted as wildcard and all packets will match this - * rule, if it follows a full stack layer (ex: eth / ipv4 / - * udp), all packets matching the layers before will also - * match this rule. To avoid such situation, VNI 0 is - * currently refused. - */ - if (!vlan_id) - return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ITEM, item, - "VXLAN vni cannot be 0"); if (!(item_flags & MLX5_FLOW_LAYER_OUTER)) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, @@ -1918,7 +1902,6 @@ mlx5_flow_validate_item_vxlan_gpe(const struct rte_flow_item *item, uint32_t vlan_id; uint8_t vni[4]; } id = { .vlan_id = 0, }; - uint32_t vlan_id = 0; if (!priv->config.l3_vxlan_en) return rte_flow_error_set(error, ENOTSUP, @@ -1956,22 +1939,8 @@ mlx5_flow_validate_item_vxlan_gpe(const struct rte_flow_item *item, "VxLAN-GPE protocol" " not supported"); memcpy(&id.vni[1], spec->vni, 3); - vlan_id = id.vlan_id; memcpy(&id.vni[1], mask->vni, 3); - vlan_id &= id.vlan_id; } - /* - * Tunnel id 0 is equivalent as not adding a VXLAN layer, if only this - * layer is defined in the Verbs specification it is interpreted as - * wildcard and all packets will match this rule, if it follows a full - * stack layer (ex: eth / ipv4 / udp), all packets matching the layers - * before will also match this rule. To avoid such situation, VNI 0 - * is currently refused. - */ - if (!vlan_id) - return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ITEM, item, - "VXLAN-GPE vni cannot be 0"); if (!(item_flags & MLX5_FLOW_LAYER_OUTER)) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, -- 2.7.4