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 2672DA0350; Wed, 6 May 2020 08:49:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F39701D700; Wed, 6 May 2020 08:49:02 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2072.outbound.protection.outlook.com [40.107.20.72]) by dpdk.org (Postfix) with ESMTP id 2454F1D6FF; Wed, 6 May 2020 08:49:02 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VNybs8DJsHief+V5Zy1A0nVRNrDdmytFti+ICQGgItGGSyigtrp5l9/5bY4f30K11f5HdprbgdXAtUmFA2rArHIyG40Xc0ek7R5S30Kt4f0rNbCGNAmNC5jyoLaUS5/orbavxvJPzyRJpIAC63Eon6sGGq8tZJmX2WtxJwhmfhMeDCedgr0+pOe282T3NIgNLtNwx0O+zATBegV+m+c2N18RpZbiuR0wE5inZOvqbMcmyAyzO8dnmctkDB3943y0ZmdD7JxWr7yjE4QOlba/Kth+hmcd/O7jcbbtv2EP1i0pmKH2ZIgTrbuSYqmyshLgXuGx3P5M+eXphn4+11U6cA== 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=A8ECxR3VtFY01amyXBjEovCIsp2Rgh6lGTLRdWL0o4A=; b=PQgVX/DZ+tLpf36BykAS4BpV04vRZWXswK1gIQQddQMZxWdyMaSMrHgW++zIbMQFjsTFkn3krY4YGvjKUeXjnjtBWRPK0or6aa+HeVKZ94EgYWQdw60gp5CGDQaRF28nfb9T45qbcEX5WNznDaqnTSxLhyl74ZhYD3iWixQ2+s/5OUWZ6UK7Sl2HC9PJDeTNh8rEyB17Wb02JUdLkfcTO//+W3q4w49O7WkhuI3inv9jLx/ppvjlR2HYoND4c7pzmzHiRE9Sew7qbm/HJqz+R1Go0d/Cv0O6plNUAg5jlFfWtXOnn9yYD6A37vDcIFv4SlSpCZ05cJqMlNyA677znw== 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=A8ECxR3VtFY01amyXBjEovCIsp2Rgh6lGTLRdWL0o4A=; b=tzZaq3PAES1EHCMppDfh+UYlAep/Y3/w9j3e8S2pjm9kKdEl31LMtPw+HoIuV9yo42HqKV7ThheB234lVH+vSktfZ6ZWf7/5S47UQ7QxfjGdkeDRKaZL1r/9j1Mkel3DhAJ1eNDd25VphVsATigbf2XfL4Yh0VgGymxwQppfRUQ= Authentication-Results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM0PR05MB6692.eurprd05.prod.outlook.com (2603:10a6:20b:155::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27; Wed, 6 May 2020 06:49:01 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e%5]) with mapi id 15.20.2958.030; Wed, 6 May 2020 06:49:01 +0000 From: Raslan Darawsheh To: viacheslavo@mellanox.com, matan@mellanox.com Cc: dev@dpdk.org, orika@mellanox.com, stable@dpdk.org Date: Wed, 6 May 2020 09:48:50 +0300 Message-Id: <20200506064850.772-1-rasland@mellanox.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200505094543.30841-1-rasland@mellanox.com> References: <20200505094543.30841-1-rasland@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) 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.217) by FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2979.27 via Frontend Transport; Wed, 6 May 2020 06:49:00 +0000 X-Mailer: git-send-email 2.26.0 X-Originating-IP: [188.161.229.217] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9d87034c-4f3f-46a6-012b-08d7f1898f46 X-MS-TrafficTypeDiagnostic: AM0PR05MB6692:|AM0PR05MB6692: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n3Z19p5NtapFlcrs3b9E6GMcZqQgcpUVOlbg0GPAkVn+TA2a5LgH9B6/z/GzLW2/1t8aNVPiDKOD6adtpEgqHIH17cCEyfMlgBEMdqjVjMkLMyy197AFcHasXe7vwTL3PwkdDImCegk5ixFw0H0JJsTKME0wE0xcLaQUOA3TChlkSr2ZUFtM3B0zWfXZTEumd46di40O5syux1hPYA2RStMOi4GHmdIg3RF4bR/Wboj7VPgrzy1xpdaKFMZJRS4yqQKHZAp5erRFd23fuh8EpF1aixIHzdc6/siylzxv6JUfG90SX/jIo2cXfCDJ7GYTMrlYYnDJsrsZwwAQsvD1On3lHeXfKJSaWlfd7DdM1av26z4b8dUbRQ7YRxBQQWI/rPNj2p55LdE3pylIH+Y+BUVZYOy6tvYwrApOpgup+dx7hl8vrquxkl6ltW68B6xCHpBaU9BcfpKFdAKAGeHFDzt8HNWDh53NzoHNU8we8GP1cjTBe4bcmSmRgnHicsZx1zTtJx8+oXCNxyXT9w11KA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6707.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(396003)(136003)(39860400002)(366004)(346002)(33430700001)(55016002)(8936002)(8676002)(36756003)(4326008)(450100002)(2616005)(956004)(478600001)(26005)(186003)(6666004)(16526019)(1076003)(2906002)(8886007)(52116002)(66946007)(5660300002)(66556008)(66476007)(7696005)(33440700001)(6636002)(86362001)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: x8VXT82h7ZXF9wa8AlQFRxC9aiC+IJUJo4AW9L5ZUprhEkXj6oX+c3T40vMnx/rWRJWv2kUG9PeOgz9hrTYLVgWhe3NRjnKbbXhjrrkmEupcQCoJd56oyo0+cBW5y71hxuaHzDyXyUxFvQkRQ02H7FrlZpm8vCtds+5EgX6sPABx5kfx0tGu4tEQjYg4IRbONf+ZIGiY8gt9Yj51zPhRsljytbeg5wlTbLc5PGHVIokWYfdYczbsl97VwzDskTQVmynBfYBp2bDQAvYsSym710hl+nv8elhAONtbeEiG1o4EOkaAXxZJDDQERGtLL+9JNMCx1MwFxeB/M9npjW6D/Jf+7Li6WFwIyltbC5l5MCbnh1fhxsCFag/BFRlfBgRi4QPmzqtuOyktW6lky7tRunQm78dUcKdbk1zDipFLnl/xH6gLQdIISTtSOZKMq2Vxu+Ghb7hzOt+wmvmmF0elIzxyJE64n+VZRwyJwGybUHyyTWVmz2ruKcI7OJTDERrdyAhL1azEIQRjc+NxpjgOvi6J+p8Jj6NP/217I/9yylcdxbpxzlHEUcdRH4PRZSy3ne+C2Qqaf0NJAjhX1anM+hnnVxZDOIWebzqY67QnUCbi6oKAUulpiNZIR/wYEKidl1Dxk0hF5Z0Bck8314xE8AjdlnPOpJblxXMGcfXCNcH+p+Ylf7kegFxECWBtV6FGE31ra2G11NFF9aTUzeude+T/INbWkhnrTI6lZ1mx6ctCZ+yDoJ2dwirTx7NiAwocpwNI+3IpGqUJkSMvUa9DZ0wVOfiDkNDRKOFqhbhiuLI8wgfH0ibWetHRVhNDdL6T X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d87034c-4f3f-46a6-012b-08d7f1898f46 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 06:49:01.5187 (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: D4PkzazuRMWvnu8HBNxGtCedJ9hLdyYNPXwO+hJsPtsJm4zpl4TK5ixZA3RY4w+hwzYDRePCsSUPA6gXMdmwjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6692 Subject: [dpdk-dev] [PATCH v3] net/mlx5: fix matching for UDP tunnels with verbs 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" When creating flow rule with zero specs it will cause matching all UDP packets like following: eth / ipv4 / udp / vxlan / end Such rule will match all udp packets. This change the behavior to match the dv flow engine which will automatically set the match on relative outer UDP port if the user didn't specify any. Fixes: 84c406e74524 ("net/mlx5: add flow translate function") Cc: stable@dpdk.org Signed-off-by: Raslan Darawsheh Acked-by: Matan Azrad --- v2: fixed checkpatch issues v3: handled ITEM_VOID after udp item. --- drivers/net/mlx5/mlx5_flow_verbs.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c index 7efd97f54..ac29c5d98 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -680,6 +680,28 @@ flow_verbs_translate_item_udp(struct mlx5_flow *dev_flow, udp.val.src_port &= udp.mask.src_port; udp.val.dst_port &= udp.mask.dst_port; } + item ++; + while (item != NULL && (item->type == RTE_FLOW_ITEM_TYPE_VOID)) + item ++; + if (item != NULL && !(udp.val.dst_port & udp.mask.dst_port)) { + switch ((item)->type) { + case RTE_FLOW_ITEM_TYPE_VXLAN: + udp.val.dst_port = htons(MLX5_UDP_PORT_VXLAN); + udp.mask.dst_port = 0xffff; + break; + case RTE_FLOW_ITEM_TYPE_VXLAN_GPE: + udp.val.dst_port = htons(MLX5_UDP_PORT_VXLAN_GPE); + udp.mask.dst_port = 0xffff; + break; + case RTE_FLOW_ITEM_TYPE_MPLS: + udp.val.dst_port = htons(MLX5_UDP_PORT_MPLS); + udp.mask.dst_port = 0xffff; + break; + default: + break; + } + } + flow_verbs_spec_add(&dev_flow->verbs, &udp, size); } -- 2.26.0