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 430D2A0535; Wed, 12 Feb 2020 15:10:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1AD4F2BF4; Wed, 12 Feb 2020 15:10:44 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2067.outbound.protection.outlook.com [40.107.21.67]) by dpdk.org (Postfix) with ESMTP id EEF852BF1; Wed, 12 Feb 2020 15:10:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UkAIYDGj7vCZ4Zg0/JfATn1kNuOlUkQszlHAS9XCgbGnZWXJT1hmEpH2ioWgHu953tc1cw2y/2XISID8v7yFs6lt1yI+7ZpJ/a2VmHYCrwreMgmifYd6Aok9nE6clV1quZ1DzSpcJ+JN1zrIy/qRjC3IP+1raMj/dA877L6d7tGQDl5rvsrsggFR33mAqygQT+P796IyJx3yJyKQpFjVCXopb2V01f6Z36xzJ3WC2HWECtdQNyIYfzvbu6wtZuO0esl5RZMkNBMnWyUKTbJXPJdeCcSvlDlOMsyr0Xv3qqIcIeqowcy+EEJZI5IIJE0VZ0BerxDAUELpvAgqX+DhVA== 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=yCFG9qw/cd26hD/VvLpwPnOKBk/HNZRc1tusLEA0aRw=; b=Vd5u/PeUwol3W3ZWp2O5OiOhPgEqqX74uJYaoWzL82EOkLIrLBxiqMHlR3mYEXRkgrctt2QD8ERbSh2EjtPyY6QY583omjGgMGf4TH498Dt1lfyjdLd0L7y1TAfVzNayYo8Spn3vnrQYRB4CAh6q7byT9c3dERAJ1q+o5zlJFLIga51KDZXZirqzCrTaX5ak/7FZd4Ro4i9JEr3fDdeeSLkt8n+WkhYXGJIuTNThSKIWgOOrPrVJs1O2apsVy95vWaQ1mnAvXMAdxw0MP5v6o5jZ2wViHGvWyuofvbjZ617xhV5EQR0JaJBGGSJMxwB9Btb2SX7vijZCitVrPU1Q8A== 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=yCFG9qw/cd26hD/VvLpwPnOKBk/HNZRc1tusLEA0aRw=; b=SDY1FOZ+i6/pJ79vzLSkVA2SvB/enSSvT93T9kiU63/7o74rFkF2tJ9zw+m5Y7V62Q1Rdkzr/u/19U73617/WK1xIr95UIAlvQfuBi8wXzAQaBKYiDsx/wqMPebi8HB6gn3UFNT45cPflnNZ4n7gckhR4zQO5EPn46ENjysyaKE= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (10.186.174.145) by AM0PR05MB4708.eurprd05.prod.outlook.com (52.133.55.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21; Wed, 12 Feb 2020 14:10: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.2729.021; Wed, 12 Feb 2020 14:10:42 +0000 From: Raslan Darawsheh To: Dekel Peled , Matan Azrad , Slava Ovsiienko CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v2] net/mlx5: fix VLAN item match for DV mode Thread-Index: AQHV4Mssj4HKUb147ku6O3XSooioqagXmsVw Date: Wed, 12 Feb 2020 14:10:41 +0000 Message-ID: References: <5efd0f36d43342b0e450fed3642f2b2498cf0899.1581251023.git.dekelp@mellanox.com> <4db303faa3da7cb9490ab218dc6b8de34d212561.1581411317.git.dekelp@mellanox.com> In-Reply-To: <4db303faa3da7cb9490ab218dc6b8de34d212561.1581411317.git.dekelp@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; x-originating-ip: [212.29.221.74] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: f58bebe7-123d-4b58-3f07-08d7afc55852 x-ms-traffictypediagnostic: AM0PR05MB4708:|AM0PR05MB4708: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2043; x-forefront-prvs: 0311124FA9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(136003)(39860400002)(366004)(396003)(189003)(199004)(478600001)(2906002)(54906003)(26005)(316002)(8676002)(52536014)(6636002)(71200400001)(45080400002)(110136005)(33656002)(81156014)(81166006)(186003)(76116006)(66556008)(9686003)(55016002)(86362001)(6506007)(5660300002)(53546011)(64756008)(450100002)(66946007)(66446008)(7696005)(66476007)(966005)(4326008)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB4708; H:AM0PR05MB6707.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; 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: AnoBF5nqIHy07wJbouLZts7xW4B86gwWMRoZ9vXLFtP+7uYzuET0q+dlwxc6pr1syl6z7BJrstULsxPEwijOfQ6pO8+DjqptqmoHvtq5Lz8GwP2xc0MoVjBjBEYzM4Xf2xogUXE37W8fP6MVVC/4Sm+pH2leJ2VmBqjOQDnCSkc7G72FZIj4oQfhEed24gcCGr0yQGvDRpF2rrbQGCWV93DiG0hat0kaCNutIVEVYi0C08ghzQjTi1FKwizM0BSdrz20wHAut2MAVwPnvvEI1GlxP7mZkkQCS6hbVMe/182TnzB3gQbCGx+h20v5zER4iM0gc1hoDkWg5AJR7Rs+fnrdsYvbf2ta/FsBIMZAqYiLzqJ1oa0bC9/Ixggectpb+FbhFPsztvRvrz9QFvekyBN4VMlFdNIbtiOPCN6dTstQ6Cq5dlse0H/R8lr3ZmjH9oawdEx9fAyMWi6ukiTAbem2ZWOyBAd89TwygzZdoaajmeHxO3R94an6cSZbhji4fPHvjSydz81qE91CFIIVJg== x-ms-exchange-antispam-messagedata: 4mXNmTErEAAWB2yZDEFco+/Pina6NIgzZHwBgNcYtdlrVDtqkVBFbtFqc8lUyPLat5BgteJWFSPaYgfPGkU3NYhz5FHf6FScdIaY5D+qMgPcG0JEKm8M49g3j1+m/I2OcWFqrP19G2GFm2WProoojA== 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: f58bebe7-123d-4b58-3f07-08d7afc55852 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Feb 2020 14:10:42.0043 (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: Qx6HsmXpd9zkRTjeI6drSkaZ43D/mLLU3Tei9PTq0n6zDGaLsQ185zMGG/kDOIPCHzdHgn/2cMGcsB+kA/uCCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4708 Subject: Re: [dpdk-dev] [PATCH v2] net/mlx5: fix VLAN item match for DV mode 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: Dekel Peled > Sent: Tuesday, February 11, 2020 1:05 PM > To: Matan Azrad ; Slava Ovsiienko > ; Raslan Darawsheh > Cc: dev@dpdk.org; stable@dpdk.org > Subject: [PATCH v2] net/mlx5: fix VLAN item match for DV mode >=20 > Currently MLX5 PMD can't match on untagged packets specifically. > Tagged traffic still hits the flows intended for untagged packets. > If the flow has ETH, it will catch all matching packets, tagged > and untagged. > The solution is to use cvlan_tag bit. > If mask=3D1 and value=3D0 it matches on untagged traffic. > If mask=3D1 and value=3D1 it matches on tagged traffic. > This is the kernel implementation. >=20 > This patch updated MLX5 PMD to set cvlan_tag mask and value according > to flow rule contents. > This update is relevant when using DV flow engine (dv_flow_en=3D1). >=20 > See example at > https://eur03.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdoc.d > pdk.org%2Fguides%2Fnics%2Fmlx5.html%23limitations&data=3D02%7C01 > %7Crasland%40mellanox.com%7Ca0e3ceda39d24d8e045808d7aee24dcd%7C > a652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C637170159302953553&a > mp;sdata=3DEtKSvNXJ7qiz10fi%2FQYGzEv0fbLH3VvhpYBGZsu9yZ0%3D&re > served=3D0. >=20 > Fixes: fc2c498ccb94 ("net/mlx5: add Direct Verbs translate items") > Cc: stable@dpdk.org >=20 > Signed-off-by: Dekel Peled >=20 > v2: Update PMD documentation and release notes, update commit message. >=20 > --- > doc/guides/nics/mlx5.rst | 9 +++------ > doc/guides/rel_notes/release_20_02.rst | 1 + > drivers/net/mlx5/mlx5_flow_dv.c | 11 +++++++++++ > 3 files changed, 15 insertions(+), 6 deletions(-) >=20 > diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst > index 2411fb3..2ea4fa9 100644 > --- a/doc/guides/nics/mlx5.rst > +++ b/doc/guides/nics/mlx5.rst > @@ -110,21 +110,18 @@ Limitations > process. If the external memory is registered by primary process but= has > different virtual address in secondary process, unexpected error may > happen. >=20 > -- Flow pattern without any specific vlan will match for vlan packets as = well: > +- When using Verbs flow engine (``dv_flow_en`` =3D 0), flow pattern with= out > any > + specific VLAN will match for VLAN packets as well: >=20 > When VLAN spec is not specified in the pattern, the matching rule will= be > created with VLAN as a wild card. > Meaning, the flow rule:: >=20 > flow create 0 ingress pattern eth / vlan vid is 3 / ipv4 / end .= .. >=20 > - Will only match vlan packets with vid=3D3. and the flow rules:: > + Will only match vlan packets with vid=3D3. and the flow rule:: >=20 > flow create 0 ingress pattern eth / ipv4 / end ... >=20 > - Or:: > - > - flow create 0 ingress pattern eth / vlan / ipv4 / end ... > - > Will match any ipv4 packet (VLAN included). >=20 > - VLAN pop offload command: > diff --git a/doc/guides/rel_notes/release_20_02.rst > b/doc/guides/rel_notes/release_20_02.rst > index 786f9b1..2ffccf2 100644 > --- a/doc/guides/rel_notes/release_20_02.rst > +++ b/doc/guides/rel_notes/release_20_02.rst > @@ -112,6 +112,7 @@ New Features >=20 > * Added support for RSS using L3/L4 source/destination only. > * Added support for matching on GTP tunnel header item. > + * Removed limitation of matching on tagged/untagged packets (when > using DV flow engine). >=20 > * **Add new vDPA PMD based on Mellanox devices** >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index e71b3b5..bc067a2 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -5216,6 +5216,15 @@ struct field_modify_info modify_tcp[] =3D { > rte_be_to_cpu_16(eth_m->type)); > l24_v =3D MLX5_ADDR_OF(fte_match_set_lyr_2_4, headers_v, > ethertype); > *(uint16_t *)(l24_v) =3D eth_m->type & eth_v->type; > + if (eth_v->type) { > + /* When ethertype is present set mask for tagged VLAN. */ > + MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, > 1); > + /* Set value for tagged VLAN if ethertype is 802.1Q. */ > + if (eth_v->type =3D=3D RTE_BE16(RTE_ETHER_TYPE_VLAN) || > + eth_v->type =3D=3D RTE_BE16(RTE_ETHER_TYPE_QINQ)) > + MLX5_SET(fte_match_set_lyr_2_4, headers_v, > cvlan_tag, > + 1); > + } > } >=20 > /** > @@ -5356,6 +5365,7 @@ struct field_modify_info modify_tcp[] =3D { > ipv4_m->hdr.next_proto_id); > MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, > ipv4_v->hdr.next_proto_id & ipv4_m->hdr.next_proto_id); > + MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, 1); > } >=20 > /** > @@ -5460,6 +5470,7 @@ struct field_modify_info modify_tcp[] =3D { > ipv6_m->hdr.proto); > MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, > ipv6_v->hdr.proto & ipv6_m->hdr.proto); > + MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, 1); > } >=20 > /** > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh