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 C05DFA0350; Mon, 11 May 2020 13:46:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D11821C197; Mon, 11 May 2020 13:46:56 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2072.outbound.protection.outlook.com [40.107.21.72]) by dpdk.org (Postfix) with ESMTP id EC41537A2; Mon, 11 May 2020 13:46:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cTFgq4YwmX3KUX5OUXnQ0B4AsKo9jHeewAVaHLUdmnOZrK4YnX8MI5n88ELdLtky6fH9vnMNjdaEM02gJHx/jgG3m4NUTYZxZuqsxpKdVr6++kllWt6CQCjqnmZIMCVmtzmbnAw/z937Rq4ij9CmHIb1YL8d8WziIsUBt3d2AKJfUhDjCDFzevx4EuylzbvLX2mscSkyJ8g/8yJ2W4Wx/qzxwofWMCg6XnexlzSGmUlvKQpBpRXDLAl7UJP2fYZnz2jlqLhbaq6VHB4BFcHWFeH6jljxc2YebFk4C9jkK43CMBusAap0pTEKC+Bzip1UXchny6X3Eae6zGboIVJxVg== 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=UIUNfx3QMo8co2Pj+XmqL+A5uLzr5fTVjdLJ6+aLXS0=; b=ogN8iaa6F8YHu1JRPIwHa3Jt4kIVwmUrUEBPBy/qQ/f6QfMku9mQApE/9Wi7pqvKelJR36eNbpX5nwOLL2XHzA1df07o3+o8WK/tJN20ozRuL/9qXN5o0PKBUmjigRsaeQcxIb7tqrC71qskZAWydAgNhQwT+V7E8Y+TPajsrCJ+lzU5J3pKgHy9X7TnWiXCMhFdx8VeomUnM4dwzj0IGqPZjod1togmHdJhW+d+5xMNf4JmCox7ZtLqng5Xv8AhpYFwdZRLqo+aKJ6sqC3YxoLcgkgw+t/FVzymmJO60gy6XCZbwPLr0xevnR2NyTc2vzU9An+BP/GPcnVS7j7tsg== 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=UIUNfx3QMo8co2Pj+XmqL+A5uLzr5fTVjdLJ6+aLXS0=; b=iWqjlAYnr3QshxpCPYK3perOCcCv0GZayUjwZWbL3fYvghAZDxD3i1PLc+/lqvTgtXFCIxzTWnU4/S9NMEvIF8pwn67csH3KTpvWyV20Ak3TZHCWfzAYhOUtxGzgIUtauoh64qHtN5GjLHgm6dGfEET7CZDbHietb00m5sBJzH8= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM0PR05MB4548.eurprd05.prod.outlook.com (2603:10a6:208:ae::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Mon, 11 May 2020 11:46:54 +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.2979.033; Mon, 11 May 2020 11:46:54 +0000 From: Raslan Darawsheh To: Raslan Darawsheh , Slava Ovsiienko , Matan Azrad CC: "dev@dpdk.org" , Ori Kam , "stable@dpdk.org" Thread-Topic: [PATCH v4] net/mlx5: fix matching for UDP tunnels with verbs Thread-Index: AQHWI3Oy8vCFML5foUepKQZo284y+KiizMLg Date: Mon, 11 May 2020 11:46:54 +0000 Message-ID: References: <20200505094543.30841-1-rasland@mellanox.com> <20200506065756.1989-1-rasland@mellanox.com> In-Reply-To: <20200506065756.1989-1-rasland@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [188.161.229.217] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4cdcb958-2cf5-4492-1da8-08d7f5a10068 x-ms-traffictypediagnostic: AM0PR05MB4548:|AM0PR05MB4548: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2887; x-forefront-prvs: 04004D94E2 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: noL3XvFOFPJVt2c1rEWPdfcPh+47tc3YEI4/dKpKeh5x3T8AKGQ/G8Gjq4v9t+j5ndLSNioOTgdc8xYVS5ObP1HUUNbUoWhMeXk+kwld4X5+k7yuFMmpDrSbaEhI5IJ+FPL0dUAXZKXD3PnmjY4cZaDTUGFPO/Gf3OsPb4RQVUV0NQDj3CGdg4s5uiNF+LTdqp9XZD8l/REnYD9cFcNJo35M8CTkzOND9m//QTlGx3YDukc2bbKU1aAyS4R69RjRnmwrpGXlf6QV1Lc1Kv9PoQxPxYC5sYN6+j8VLG7KpQ+h3Xy03YorjOra0SCxmfkx5RRcRtZrJKRUkCsPvcLY7r5jF+2kGbUa25SLxFONXBsvEafmi1r5E9nfINVCG7YQxhenqeKtdhDOzj2nn7yhdImGJtDiYwDDruUDgYA3Xoa6YPJnAiI+q4cZljvjL/t2UYUS8kiXmlahfZLHXY6TFdCIH/S1A04sKXpYmuj3o4pwVcx3GPyywVZmy4DhYOHDobKufOErLzIEOVWcXr5k8w== 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)(39860400002)(136003)(396003)(366004)(376002)(346002)(33430700001)(54906003)(110136005)(52536014)(8676002)(86362001)(33656002)(7696005)(26005)(9686003)(6506007)(55016002)(53546011)(450100002)(186003)(5660300002)(4326008)(71200400001)(8936002)(6636002)(316002)(66556008)(66446008)(66946007)(66476007)(33440700001)(64756008)(478600001)(2906002)(76116006); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: kUnbhA26K1p5IDPMTJ/fHN6YHlfgKqjP7wPkcWeqz/fJq0Mir3EtcZ7kxzGjnDd22Fy4KhWpU4xR5O5i2tHfiFJOnSJGNf3fhiQnXiMf5Fx6EKE6pFm0q8z3Kzbd8f8QDSdWeACkoJeD/CkM+K9/5VpXUZM6nwUZyrkl0kMArY/x2BM+d5h3ek+H2YWO/imIf5VqEE4/T0GFDYQjNk6XcCwe2K5G0fQgSC6ypNenyBasfZoAi71JNkBKcAUxi4YbpxuMQbszGnIJFW5/lxf4bh9FhWBEe4ZNYmCrNMvMwFQ11XMDOYX0tlszJiTEHCI0luZmHgsm1RLkVLtELX96cBJwUKMKGA9dpIL5n2IvvM0MyXYwHjC98L3jKjGyI2R1zZ0KUp5H5tHpA6KQLwsE6orZPrnnso9R1HGZ+getEBNf1swnJw6DQLojp/3XJDoU0eYYw1LxOrnvePZXA/jFXEHSdyxXHU9fY8Z1FTLrCfvPoxleK2jf+im6peez7nUi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4cdcb958-2cf5-4492-1da8-08d7f5a10068 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 May 2020 11:46:54.0671 (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: 41lto3nddGhMnexjGvFkjFB8HQmXkJXctQbNP929w0a59KeUwozIKlh3fL8PjvyhML0qq/Zf25HIyKseg0cTuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4548 Subject: Re: [dpdk-dev] [PATCH v4] 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" Hi, > -----Original Message----- > From: Raslan Darawsheh > Sent: Wednesday, May 6, 2020 9:58 AM > To: Slava Ovsiienko ; Matan Azrad > > Cc: dev@dpdk.org; Ori Kam ; stable@dpdk.org > Subject: [PATCH v4] net/mlx5: fix matching for UDP tunnels with verbs >=20 > 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. >=20 > 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. >=20 > Fixes: 84c406e74524 ("net/mlx5: add flow translate function") > Cc: stable@dpdk.org >=20 > Signed-off-by: Raslan Darawsheh > Acked-by: Matan Azrad > --- > v2: fixed checkpatch issues > v3: handled ITEM_VOID after udp item. > v4: removed extra unnecessary check for NULL > --- >=20 > drivers/net/mlx5/mlx5_flow_verbs.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c > b/drivers/net/mlx5/mlx5_flow_verbs.c > index 7efd97f54..24d4a7203 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 &=3D udp.mask.src_port; > udp.val.dst_port &=3D udp.mask.dst_port; > } > + item++; > + while (item->type =3D=3D RTE_FLOW_ITEM_TYPE_VOID) > + item++; > + if (!(udp.val.dst_port & udp.mask.dst_port)) { > + switch ((item)->type) { > + case RTE_FLOW_ITEM_TYPE_VXLAN: > + udp.val.dst_port =3D htons(MLX5_UDP_PORT_VXLAN); > + udp.mask.dst_port =3D 0xffff; > + break; > + case RTE_FLOW_ITEM_TYPE_VXLAN_GPE: > + udp.val.dst_port =3D > htons(MLX5_UDP_PORT_VXLAN_GPE); > + udp.mask.dst_port =3D 0xffff; > + break; > + case RTE_FLOW_ITEM_TYPE_MPLS: > + udp.val.dst_port =3D htons(MLX5_UDP_PORT_MPLS); > + udp.mask.dst_port =3D 0xffff; > + break; > + default: > + break; > + } > + } > + > flow_verbs_spec_add(&dev_flow->verbs, &udp, size); > } >=20 > -- > 2.26.0 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh