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 7D34CA04B8; Tue, 5 May 2020 11:42:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C5B161BF57; Tue, 5 May 2020 11:42:31 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130041.outbound.protection.outlook.com [40.107.13.41]) by dpdk.org (Postfix) with ESMTP id 130062C5E; Tue, 5 May 2020 11:42:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ABG6KVPn6/efyzF5IxPZfCa5W7J8towihasfQebKNKxeIFm9OlOoFgGnZPgmend3UzKMlw6iexhAZvGKORRdq79I6oxCVtKjGzpo3BBesHPz9+mrBYWwbNi+jN27QlIkiQuWZ3TT+41aFb1HOaCJJNAagkpvQp8zF5sta7LPOJmJ0QhgtK6ILxzAOtk0mK74Z9jb1V5xNI+Xxy6100hvvXb63cDkjE2ZgkG/Z+DtjWcN/8vfqdGc2ICMwHOTvLZgd+qG4znTiFSytPclBxp6+z60/UvdmuGrOyMK6P6dVUU89XOa45U/c4Zt21TUzXu60zyDZu/Zgr3TAqhFv1GLjA== 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=6hcLTEgZh1cuQwUYXEq2E4FU/J7lnL2IJrrJJ+Dycsg=; b=MUUJQHEYSCW4c/Rac7uaU22seZTpZDHQJ4t8t4AgaFM+wKoyXqR88QWCRoLoOuf2u3YG6yv+9urYdxtTm9pPuVgzy5sdLC+8JQz1HuBuxFrBA1qBdTDf2QIO2qo1yIFVtncy3rXzZBpsykQTbJ9473Li3SqmxOfQEgyB18HRgl01eRAc/uusgcIToS2B63lWvFsV0aturIJGzx3FfwolNIVcIpyiP5Dj+sGF1lK4ncazHT4wIDI8HJHWOBGy601FsV8PVUb8UZLXxEsvKvDFVEHcq3IJlaVpX+dXNHByeMVHhS6xU5Ax6KFR74e9pbrcZIISIguTPabv5EVkvD2CTw== 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=6hcLTEgZh1cuQwUYXEq2E4FU/J7lnL2IJrrJJ+Dycsg=; b=i1dy1ASXAyWNLua3d4menlhrdzcBUkCynSc1ALOBwDyI7rrqRwatDJH2FRbhjJHGcvBk5XpVtGeGXKzB73GQbr/Yr+NeWnqh9YUFoOYX4d/gzFEP65YWXg79r1VZ0FQV3d6uX4N8QEzINbpeEWMi6/dnpoXoYRPVdL36Ewplqx4= 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 AM0PR05MB4257.eurprd05.prod.outlook.com (2603:10a6:208:63::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Tue, 5 May 2020 09:42:30 +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; Tue, 5 May 2020 09:42:30 +0000 From: Raslan Darawsheh To: viacheslavo@mellanox.com, matan@mellanox.com Cc: dev@dpdk.org, orika@mellanox.com, stable@dpdk.org Date: Tue, 5 May 2020 12:42:18 +0300 Message-Id: <20200505094218.29666-1-rasland@mellanox.com> X-Mailer: git-send-email 2.26.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: AM0PR02CA0001.eurprd02.prod.outlook.com (2603:10a6:208:3e::14) 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 AM0PR02CA0001.eurprd02.prod.outlook.com (2603:10a6:208:3e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2958.20 via Frontend Transport; Tue, 5 May 2020 09:42:29 +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: 3884035c-0531-4309-9858-08d7f0d8a0ee X-MS-TrafficTypeDiagnostic: AM0PR05MB4257:|AM0PR05MB4257: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-Forefront-PRVS: 0394259C80 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J7quB+3m5dF4cyqgutpYuNYk74z4uWRAoeWLBcNRkxU0yClPdExp61peCB7a5+iVMBlUtzBCe7VIy8otpvaVY1JmQNFSoYS9wvrRwEmOUORWDuY7Q2Wdx4hG7jJewgTTW1Ni+pezYvCOsYBwXZSVCbrHHREC/BOOaRmq3vWMB8z4my9nPV/9OmQIkMchjeZBRUTzqYnw0s1PwJ7t07xFV4Vd73aOB6ctpUCszzs80CPstoo1NArxU3qw0pmrVMATGO7wg8ajZ0ygpY4SGkr1ndHsroNTUujto0O4r+NwcXyqsZKqShHviN/bPsljqpLH7sW+R0d5rqS4Y4zI0Oo9SWIxWJ9xSGBVyUsWAKUH0qgo89vVKbCPwWOaWQSBsp4POjjNWz2DSKq5SdXbW9syqvrP3OjcryAveA5V96RhqsDT63x1kAQgYyXwMcUcdXJ8ysWRJZjYiZ1xb0z2qiDUcDvFOoJ/mQmKtwQeo1OE/9VtljtEbW86eB5EJcqTqDoCEMQiaT52pg7L1HaCNJHgGQ== 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)(366004)(396003)(136003)(376002)(39860400002)(346002)(33430700001)(956004)(2616005)(8886007)(16526019)(36756003)(26005)(7696005)(52116002)(1076003)(186003)(86362001)(2906002)(33440700001)(478600001)(8936002)(8676002)(4326008)(316002)(55016002)(6666004)(6636002)(66476007)(66556008)(66946007)(450100002)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: /qS0FJfRJmA4uMVEb7fsN/Ladbbvl5tlXplaQRqMiUITvBLmPIEtbr/b/OWguSpMF/uR5MMnWwYmnuPHXGNTHr3JvOlTk8adcDK/LkvvRaG5Qkv6TUdBrVMz8IMADdcTO2rNaefXeAGLBMEEkI3VG6gyPO0fNBzmHHaw06FrfvxgTBYgGMpaMdslQVKP4/Ch6zZPF4csmdhPBs5BODTwU3MNGkIlYEC1QyhRUuDO1ShmrIXvXAJrw9Q+aO4DtQIJxiaDFQqc4kA35FW3jOZ/YRqBHB4EL0Qwh3jmOBY/dTO/S07yJijx/atPXOjj/pJyBXE4QYY7sJvvGroWE9PkLSm/gA9Ltrz23yuCyKNVokwD+4SaCySbJ/JEWNz5nlgTf9NU6nJAFqyezgaDj0Na6uBvLKbxjLYTPjc9ot5XdBwOioNX8loIPqiHQ2zIVUGYe4kMBsUMWIwV5YKdAO10cq4YW81+zXKfsSbS3moW92/socTfl5NoEV++6ngnsDUmWVl4WI5txOhsoC9C9URpLAFxgCxtsLhWJCXhABG78JC/fJ4ky8DOP5zAbPBtsmt9hKBKUbi2uWpNukMwoZmXv5SEU4e8Q4lNAcxTj7GNOO2MtyOQKS2p+UEtC4ue10Yv9hq/XgxiAA9uSm84wR1P5B4ljCETM6KMTXB4t3zWCh0IOU9d34jXnfT4mVdVMCNXFZcqHsCsYCYOWZPfGE/eCvW9H9DhEUGnQI8SAXtQ8p/rr9zeNEyYImC9mrGiz2Ix8IWvT0yPvWRBzbWAFD/EYDABVjM/sP27/m3wU8Uh2gmtihZgJE9lwYqzxWZacRHc X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3884035c-0531-4309-9858-08d7f0d8a0ee X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2020 09:42:30.2157 (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: FYDUFCE8NsSgMOVDb66spQ0nDCvrAE8ODLLixyx9I8al5+q/9A0IM/d0RjWrN54Otn6VQa81xex0tt2CntBTKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4257 Subject: [dpdk-dev] [PATCH] 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 --- drivers/net/mlx5/mlx5_flow_verbs.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c index 7efd97f54..9094fb70b 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -680,6 +680,26 @@ 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; } + + if ((item + 1) != NULL && !(udp.val.dst_port & udp.mask.dst_port)) { + switch((item + 1)->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