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 1F67FA034F; Sun, 24 Nov 2019 10:15:21 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 12E4C4C90; Sun, 24 Nov 2019 10:15:20 +0100 (CET) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60071.outbound.protection.outlook.com [40.107.6.71]) by dpdk.org (Postfix) with ESMTP id 8418237B4; Sun, 24 Nov 2019 10:15:19 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UUwmbb1uXA3DwiGHZ+y6fih8i/52mWadaMdE6ozTPNWRaot0jnc9FCL0Z3UEP9G8Fn0hs88bYqUxWoie0RVB48so4W0fuOqH4z93xWjsw6xaS7Tl8+biU2qMCVvEzM/ikP2l3DIPftrmVUQGZOf4FzjDdo22Ans1JMXMuIKJUBiZ1Gp8+6Msa2roUlXtOM2LDQmV9rqWgT/WLeLMvAduEjdwQwzO1Btv1UPuTGv2/AW1TIvrDjsI+akHJW4lP/C94YkdxdqlHgfOjfMgIWpLSkaKi4end2YjYq/CsTz5MsXGqBjBG2vtLdBFjldj5NU4WiTWhrzqx/nWCOMDKnRqTg== 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=LsURVl9Zqyjgf02xtHLBXULNPsng8M9MtjPZDsMMulY=; b=anXabtXRa03JtXb8ZKUSd5kvzi9RtVryoVoaATSfZhL50HmVnxC3qp/GkQOqjWiKKN2SMl4D6aBN5Kaa7KPE0e/m31YOdZvp3Tx1mItIHH0olooc2SfVVUA1XJMlNZ9wUIaUl6x+fbLQ37DIGqLG9oCy0PdMCZOgvX/pTSAOnas9pTd8ZQijnAxgnvehv8UEjhSOb1FOe4pSxFrEWwwC6UQDTMzbrAKuEc6eVZ6wlDZBm+/8ClfMJo7it311SSaeS+JRCmFspEKi96auB4rYpxIYZgItHNGuuAuKZwqmmZiDW34pNFB8wpwx4MyT3skiKZ51TCMSH2nTIoipGn6llg== 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=LsURVl9Zqyjgf02xtHLBXULNPsng8M9MtjPZDsMMulY=; b=gJ4RMU042CUP1hrk32/8HXTF1Igfjz5JWhScYehAMP2kymjkprjQCBU9W08sMsYUecyCjxWkW5FKyLJ1vE4xGJcHuoA6okmLGPDzIE4X7blpZ8lunn8ivmOAonf0Xqw7v09gm+XqmeByQycgUqAOmk+CnKPxv3X+khGVu0tFlmY= Received: from DB3PR0502MB3964.eurprd05.prod.outlook.com (52.134.65.161) by DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.21; Sun, 24 Nov 2019 09:15:18 +0000 Received: from DB3PR0502MB3964.eurprd05.prod.outlook.com ([fe80::a850:bac9:c90f:f2f5]) by DB3PR0502MB3964.eurprd05.prod.outlook.com ([fe80::a850:bac9:c90f:f2f5%6]) with mapi id 15.20.2474.023; Sun, 24 Nov 2019 09:15:18 +0000 From: Raslan Darawsheh To: Suanming Mou , "dev@dpdk.org" CC: Dekel Peled , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] net/mlx5: fix incorrect L3/L4 layer chosen with tunnel Thread-Index: AQHVoGSTnKCAUPnGQ0qzbpbdIkZw5aeaDniw Date: Sun, 24 Nov 2019 09:15:17 +0000 Message-ID: References: <1574307071-152513-1-git-send-email-suanmingm@mellanox.com> <1574338170-167657-1-git-send-email-suanmingm@mellanox.com> In-Reply-To: <1574338170-167657-1-git-send-email-suanmingm@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: fc67420e-b70f-49e3-8d7e-08d770bed2ec x-ms-traffictypediagnostic: DB3PR0502MB3980:|DB3PR0502MB3980: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 02318D10FB x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(13464003)(66066001)(316002)(478600001)(54906003)(7696005)(186003)(74316002)(2501003)(66946007)(99286004)(450100002)(76116006)(25786009)(11346002)(110136005)(6116002)(3846002)(8936002)(4326008)(446003)(229853002)(5660300002)(2906002)(52536014)(66476007)(6246003)(64756008)(71200400001)(71190400001)(9686003)(81166006)(55016002)(86362001)(33656002)(81156014)(66446008)(14454004)(53546011)(6506007)(76176011)(256004)(14444005)(26005)(66556008)(6436002)(305945005)(102836004)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3980; H:DB3PR0502MB3964.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: 7DtY70XI3khP9zvOl2YTDZaznfsOKBpvseuzGB7IDgZs/eQPmgFA/4iUM7V0Bg/jWYIb8wgD1oZqgbO25gmoxR0XcfhiymTUuIOfWVin5j57yUXROKrCG4wrBxOfagh10tLCL1Ycq5mTiULdiuEnzKQvsZy2v6ov+qC93l93t0lFZd0H7VSRc1GTaBvzFQe/vStlHMGLOiS0vSAGWNEAli9cZb94Q0Q12thi4+Oaz3zJoxZXAaIJokrOouth2gpUQqweApYDSFpciLpT34BneqruuG6XcKgbYrCo9eR7rRIAIgfA+UkCfafg1eF/Dc7J1Jr4td+cBvoaVbt1jlp/+sQAX/X389CWzwMd30Zl97suj1VZ6ao0USP0Gk6pKxMBXnKAIqcHGEZSRXDXgwuBhzSjbIxuu6Zmp5Ed2tjAGQ64KgMaDINck5wG8S/Jc0OF 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: fc67420e-b70f-49e3-8d7e-08d770bed2ec X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Nov 2019 09:15:17.9470 (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: Zj5oSVjLnpPkrmWSLu0l1jNfuLjEO8WNvs9xXvraGzTpnsNa4ks7pw671kDFOT1D9ezTBy1e/D7A6xmxWQuK0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3980 Subject: Re: [dpdk-dev] [PATCH v2] net/mlx5: fix incorrect L3/L4 layer chosen with tunnel 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: dev On Behalf Of Suanming Mou > Sent: Thursday, November 21, 2019 2:10 PM > To: dev@dpdk.org > Cc: Dekel Peled ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix incorrect L3/L4 layer chosen > with tunnel >=20 > For tunnel mode, there maybe two L3/L4 layer match pattern items, > the inner layer follows the outer layer as the latter layer item, > the TTL and port modify actions should handle the outermost layer. >=20 > Current the outer and inner L3/L4 layers are both regared as the > outer layer in flow_dv_attr_init(), it caueses actions may use the > incorrect latter inner protocal for header modifier. >=20 > Check former L3/L4 outer layer existence avoid set the incorrect inner > layer to the flow attr. >=20 > Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs"= ) > Cc: dekelp@mellanox.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Suanming Mou > --- >=20 > v2: > * Add L4 layer check. >=20 > --- > drivers/net/mlx5/mlx5_flow_dv.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index c402a8d..688291f 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -73,6 +73,9 @@ > /** > * Initialize flow attributes structure according to flow items' types. > * > + * flow_dv_validate() avoids multiple L3/L4 layers cases other than tunn= el > + * mode. For tunnel mode, the items to be modified are the outermost > ones. > + * > * @param[in] item > * Pointer to item specification. > * @param[out] attr > @@ -84,16 +87,20 @@ > for (; item->type !=3D RTE_FLOW_ITEM_TYPE_END; item++) { > switch (item->type) { > case RTE_FLOW_ITEM_TYPE_IPV4: > - attr->ipv4 =3D 1; > + if (!attr->ipv6) > + attr->ipv4 =3D 1; > break; > case RTE_FLOW_ITEM_TYPE_IPV6: > - attr->ipv6 =3D 1; > + if (!attr->ipv4) > + attr->ipv6 =3D 1; > break; > case RTE_FLOW_ITEM_TYPE_UDP: > - attr->udp =3D 1; > + if (!attr->tcp) > + attr->udp =3D 1; > break; > case RTE_FLOW_ITEM_TYPE_TCP: > - attr->tcp =3D 1; > + if (!attr->udp) > + attr->tcp =3D 1; > break; > default: > break; > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh