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 B0FDAA04B8; Tue, 5 May 2020 11:45:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CD9851C1C9; Tue, 5 May 2020 11:45:58 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2065.outbound.protection.outlook.com [40.107.22.65]) by dpdk.org (Postfix) with ESMTP id B3C2A1C1A7; Tue, 5 May 2020 11:45:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BbzSsjn1+tsWHJVVWfSQzPVP101EEghPOTi4BKyw5K7FaQP4HmQkFYrw5+BXT2atxLNw2tna/xKtm4RrHfBCpnjzqzkHS6C3+5pezN/qxFnilOB3J3JNgmRvnmcNQ+0V+iTC1adfPSQzZH8Ok6NJIRwyPLB7U32hw2zD+NKBohT3csI8FqaGRjY0N3Qj3FN1ObqHUE0rUjBdY5TBXoZaS5ulkE3SmZlaRv+Snp9f3FukaqYOG91DUfh5IEXV9N8YzeAu4iVfGR5IjM0kDTpVCmj/7l+i7J5cQRANMIqZsD5DKribvU/pnDXHd2+GjWLNE4J6nvjxrF1TR1QIjmQKzA== 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=9ExHHyhEisnOMReB0U9wxyqSAHQUCbOldG53dus2Heg=; b=dSYZ2d5cxZGx+gN90kDVbABnsLzybdoiQa8Ut4HEej5EeV2EcxwnUAN+IX7k7YEpTeuiyF6JMkZJMXNd0Jo0CxhJhWx8iKP4ZeGaMA5cBmCgrn1qFuM9qUQ6lAQ5jRNgbCcx+3j3JgAW8SZr0HmJoO76XzWXdzBQdaOgXjwoDmTVKPZvfDCzgfAtMqPl3vbwDN7GWtfoD9gilE2jAxqY9NbYL2xiKCMMdvQw7c1Z26Q8W3ew2GSUV+hJp6WgksGtT9Rxrin6mPwAniUu3q8dA3dBmX3Wpodr+OrZwuIjtT3Tr0LeuFdoTM4KEIPe13RG0IJic6PxH8PxG/tvGbXYLA== 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=9ExHHyhEisnOMReB0U9wxyqSAHQUCbOldG53dus2Heg=; b=EW9JbsTKqZBObHnlzRymIxUjz6ml4UZVIB7ohRWJVuU/3s9mRwddDXy5UtBksDzNHLaZ9Y+cKGQmTZUB3TyAfVETrag7eURLLa6ZMfKAv+Pdx3cphg2z3xPZWFOmYQjMstl3FB2GDrdXB22ZkXbWarMNSSINlBYziFbmCHJDJWk= 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 AM0PR05MB4769.eurprd05.prod.outlook.com (2603:10a6:208:b5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Tue, 5 May 2020 09:45:55 +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:45:55 +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:45:43 +0300 Message-Id: <20200505094543.30841-1-rasland@mellanox.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200505094218.29666-1-rasland@mellanox.com> References: <20200505094218.29666-1-rasland@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: FR2P281CA0008.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::18) 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 FR2P281CA0008.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2958.30 via Frontend Transport; Tue, 5 May 2020 09:45:55 +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: d3a9860b-1630-4ab2-4bce-08d7f0d91b79 X-MS-TrafficTypeDiagnostic: AM0PR05MB4769:|AM0PR05MB4769: 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: vthz8tfoRuq99sWbWsBfsW6WetcHVEs9naqbdS0o8Xn/SP7HQWuXNeT0tzD9lLHpqaP7NOFEILLI8HaSa1UVO3C8wa/UeZCkkuhJYib9WyDJz525lTKwEbD7P1xu34Nrgz533wyw9HyKv/t/VRXkfL2KrWC0aqpX3o7uUK0m4XEZJDXNEnrb+msxaaSW/lHo6NvI7TfpOP5ZIGsAMU8kAdsI/BRGkMJCN4BxMpWh4LhcYWFGH9fh65ANjC41SNU9wNM3BwYOgjf6g+1+S9fYiVaxqClzsjlYorEr7aSZsBWos4GL3C4i8EfyRrh59xJS0vHqYMMNIdy3rwHikia0gepzXHftx+16UWhj26EXTSa0e8U27DMv0zXUj0SBCN+ubnlyYTQgh+3Q3dNSfYYsxFapNKrWqcNBMmcyUjGPhvk+2Fj34voC1JjW6O71UEKDu1fLhifpRUZPAOO9iiRSZVPyUZNvvOxROqJAmjngxqH/IztQ6MxqXciAoMChUfVuyQT8fiZjeb2ZPQGr6ySqsA== 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)(346002)(396003)(376002)(366004)(136003)(39860400002)(33430700001)(2616005)(956004)(8936002)(478600001)(8676002)(6666004)(36756003)(66946007)(5660300002)(4326008)(7696005)(33440700001)(66556008)(52116002)(1076003)(66476007)(16526019)(186003)(8886007)(450100002)(26005)(316002)(2906002)(86362001)(55016002)(6636002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: RrcABSwHtHn1i0GQ4sVhaXI5zczg+pdcd+3MuYXBpBp9C5q56HzJHeJs2eZKJSujQdA6BTRr3hohgETu6We2cO7kDDkdiZ8gPg+KLqCnsCptwdUe2pL81EKNnoCxRuAt5wTn+ysifIMwwKUebZELA8izz9IDKDkoeRJXVWs84KSYEZn9LIh/8/LoifJlZu6c5+0Wu0FAzmcYZA1tHEsSLqoQKEODtgXCjo6JNOXvWqS5QZHlSwUzBYP7ocUU5DfhEZ3KuB+oZIu1oXrLrj6ibqvZ+s4g1lvgFFXSYVTh8PI+tVNpb+2atpA/5KHySODbtD3IDpPGujYIBUPWZ4KCF1rMvvGIhch3aF77RUSZnVEwpyKpNWfLljV5nudLGbMQPokcrnoR1Q5c8raVhbHTJlcouJbUAm5DQfe6goLCoYsLwySJ9C9VnPJGf66d4TP7uPyJHJSOfnqLeH8d086MYCVwl2aXtgyDmIailf7ncXcOUPix66RhOrnmeDJ8aZzxPLDZCDqW0eBQaw7rhaVyps9oGo7HI82xDXpD1r/xCV/LU1+M3QCLA7145OZxY0cGH1Qn/fu/i+AtO7deWLxROdn/bqvTDVHC7oLTcjCFvat531V43cApF/gMGAkvfPqZ6Bx/kg89JcW7/Zrs7ymvhvWrbvN7sUGyirEEgP2/T1hsJ1d2c9wOdL/eClbMAopsfS/A0GJJENYyzoalu77bWixCd8XKOJT5i/lv9MYsOqd1h1u0FY9MFXl2jwfB5EhMcpBEq898Jkyc8JfbQ7N/utBVYtneNnEOK2n7aPSA2tVZNNS8g8T/FQlH/IsjMxvb X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3a9860b-1630-4ab2-4bce-08d7f0d91b79 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2020 09:45:55.7649 (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: 8u5QUS5i1YquRvXmgpXRi836WCOlY169SE3H9sxm8TeMepLvCx8e3LwFVtX9Hn3ejnL9F7Z9025A1Z5BFJNqFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4769 Subject: [dpdk-dev] [PATCH v2] 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 --- v2: fixed checkpatch issues --- 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..d711466dd 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