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 07730A0534; Wed, 12 Feb 2020 16:03:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7AFFC1BC25; Wed, 12 Feb 2020 16:03:14 +0100 (CET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70073.outbound.protection.outlook.com [40.107.7.73]) by dpdk.org (Postfix) with ESMTP id D54912BF1; Wed, 12 Feb 2020 16:03:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J9kG6IM24AnktoOp821xKnascQ0O6PWLZpoKBGSWPg08XYfUSA5ogWgrcvp8lH7yTuf+x0/gtN0Tdch4JazLtIqX2NnlkPuib47syQR532N7ACg59shQLuDtJFJyoELB4Um3cXigST4uwJE07FdDMJnWs/tad3Wkikl79Pwj/rzCMWOG9CbywUr86u0l/gnwHcR6B4gdrZ8/PTz87HR6vCECRAbOm6HaKv2L86SFn1gQhW66/vUQeLMzgvkAjfZ5GWTnGK/H/IAoSOZfJ3fZsni/MJwixUKCIFv8mh3q7mMluL7P9diwOtNxzZQJPjt3siHfY5EwTlXQsbi0YA6KqA== 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=B/OCsCzcEQY/yiPUKx3dILMB6ATFxMM+/b8tGQXmL/g=; b=XrV/Kgn6Q7taPHsQFwcV8jKYjRgnqTg/L50jBYMtIuDyCyplvJD0I4Mm4LYPIxNBN2ayUyPeYDLRwfYRv65AgnsVZucFUGxlBzPRqborwqdCgnOv2jNayAvLycjhTV4cRafLwKz9uzXGzp9L1077QBEFETTVtc3y9XlJPJFFWuMxH/sT1zT8Tqim5aaI8iuGndUcyTWl/dQ90KPyHQz5FwUTD/tVrnKxL6jMN8pui5iv8dUDQqEbj/26CBzGHKRc9b6akWbVj2efQcTm3vxAI7dQPq5pt9RZhoaO65xkPGlWCXT2tfVbk/U9nEBdqTiSVm0g2B1bZydOqTQM4omHMQ== 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=B/OCsCzcEQY/yiPUKx3dILMB6ATFxMM+/b8tGQXmL/g=; b=V7TR9lu9skzVsW4Uy9bSziAeJgzRAKqDAtIErMiZFnYb7ByJ/DgQmEiIkiv78nv30EZ4tozJatTpvuVFMqvb2GzVVLGzeagGeP/3B3hQcftwMJQnF+9Bkwi+ux110akaiWMy5876CqAWxyTtkHJe8AbvT4Qq/lfZdxOpWky/KhY= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (10.186.174.145) by AM0PR05MB6513.eurprd05.prod.outlook.com (20.179.32.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.25; Wed, 12 Feb 2020 15:03:11 +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 15:03:11 +0000 From: Raslan Darawsheh To: Suanming Mou , Matan Azrad , Shahaf Shuler , Slava Ovsiienko CC: "dev@dpdk.org" , "xiangxia.m.yue@gmail.com" , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix meter header modify before decap issue Thread-Index: AQHV3KPwrHXd3Hm4SkuOb6SLOqat56gXsbRQ Date: Wed, 12 Feb 2020 15:03:11 +0000 Message-ID: References: <1580962467-159286-1-git-send-email-suanmingm@mellanox.com> In-Reply-To: <1580962467-159286-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: 6a223a7a-cf7b-4a08-7f15-08d7afccad79 x-ms-traffictypediagnostic: AM0PR05MB6513:|AM0PR05MB6513: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-forefront-prvs: 0311124FA9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(396003)(366004)(39860400002)(136003)(189003)(199004)(4326008)(26005)(53546011)(6506007)(7696005)(76116006)(2906002)(71200400001)(66556008)(33656002)(66946007)(478600001)(54906003)(66446008)(64756008)(5660300002)(52536014)(110136005)(66476007)(55016002)(186003)(9686003)(6636002)(8676002)(8936002)(81156014)(86362001)(81166006)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB6513; 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: xMuexRXOGvkLdjAZrMPhr75oUsxv4zA0FfAZq0Cqe0TDeg+k/a1KqiY8V/0drVXLX60x4qaXP5XvWo18B9y3h3jS2cOvveDcyZvGsv9SBE/pNgKPFNgCplk0Vy3c2PoSmI7sTDTjuasXE88JyA/fyBOk5Ur3IYmjbs6cvGqgBiGip6owBdDsTPvkA3aO7hSs8jXEBoGnzL6+zsTpd5QUIxLlnB+QWTWVpg8caI9VdW9/Ng24B4Pi2PdAidSUdHmgTGBG1X9wdioAlnpz4jBa715gVTJN/HbEWF7Gsxmqr6pWXuGwZ3eWhEy8sH7ZUDjzTPraswJh3W/snbqmH86Ncv+ZOMR0CIKWIrI81l2I+IsTymPSa8J2DNYRqliKbY8mNCLjeSWZ2ku+BOZe84btNJBwKZ5Qx1p0knt6kFCdRCvcJdWDX7V0U5Hu/tRCM+Xq x-ms-exchange-antispam-messagedata: CUzbBTWaMYddW9kicliWBTkrpOTQh89CCAanW1L3ABFcPjvLwGCbWVj1CUcbIdUYilai5RwxRXOKY/WHIBVwDjHDPWlI4HdDfGGsOI14X/KL+Bg0HS+Omw+tUAqbo2kHcBFd6cbVipsseJP80UdUGA== 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: 6a223a7a-cf7b-4a08-7f15-08d7afccad79 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Feb 2020 15:03:11.3928 (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: mtBYAiTHatMTo7Y3Kd7pJlp7RijzjqM3wf5/8ydlV7rSVTQWOkKKrGt/0bcSYMNwuTJRXJHP6oNMcgekGuDDlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6513 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix meter header modify before decap issue 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: Suanming Mou > Sent: Thursday, February 6, 2020 6:14 AM > To: Matan Azrad ; Shahaf Shuler > ; Slava Ovsiienko > Cc: dev@dpdk.org; xiangxia.m.yue@gmail.com; Raslan Darawsheh > ; stable@dpdk.org > Subject: [PATCH] net/mlx5: fix meter header modify before decap issue >=20 > The meter flows are split into three subflows each, the prefix subflow > with meter action color the packet, the meter subflow filters out the > colored packets, the suffix subflow applies all the remaining actions > to the passed packets. The tag header modify action is added to the > prefix subflow to make the suffix subflow to match the packets from the > prefix subflow. >=20 > Currently, the tag header modify action is added at the beginning in the > prefix subflow even before decap action. The header modify action does > not make sense to the later decap action, so the flow create will be > validated as incorrect flow rule and failed. >=20 > Move the tag header modify action just before meter action in the prefix > subflow to make the flow with decap action to do the decap first, then > do the tag and meter to fix that issue. >=20 > Fixes: 9ea9b049a960 ("net/mlx5: split meter flow") > Cc: stable@dpdk.org >=20 > Reported-by: Tonghao Zhang > Signed-off-by: Suanming Mou > Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_flow.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 144e07c..7f1830f 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -3476,21 +3476,25 @@ uint32_t mlx5_flow_adjust_priority(struct > rte_eth_dev *dev, int32_t priority, > struct rte_flow_action actions_sfx[], > struct rte_flow_action actions_pre[]) > { > - struct rte_flow_action *tag_action; > + struct rte_flow_action *tag_action =3D NULL; > struct mlx5_rte_flow_action_set_tag *set_tag; > struct rte_flow_error error; > const struct rte_flow_action_raw_encap *raw_encap; > const struct rte_flow_action_raw_decap *raw_decap; > uint32_t tag_id; >=20 > - /* Add the extra tag action first. */ > - tag_action =3D actions_pre; > - tag_action->type =3D MLX5_RTE_FLOW_ACTION_TYPE_TAG; > - actions_pre++; > /* Prepare the actions for prefix and suffix flow. */ > for (; actions->type !=3D RTE_FLOW_ACTION_TYPE_END; actions++) { > switch (actions->type) { > case RTE_FLOW_ACTION_TYPE_METER: > + /* Add the extra tag action first. */ > + tag_action =3D actions_pre; > + tag_action->type =3D > MLX5_RTE_FLOW_ACTION_TYPE_TAG; > + actions_pre++; > + memcpy(actions_pre, actions, > + sizeof(struct rte_flow_action)); > + actions_pre++; > + break; > case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP: > case RTE_FLOW_ACTION_TYPE_NVGRE_DECAP: > memcpy(actions_pre, actions, > @@ -3545,6 +3549,7 @@ uint32_t mlx5_flow_adjust_priority(struct > rte_eth_dev *dev, int32_t priority, > */ > tag_id =3D flow_qrss_get_id(dev); > set_tag->data =3D tag_id << MLX5_MTR_COLOR_BITS; > + assert(tag_action); > tag_action->conf =3D set_tag; > return tag_id; > } > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh