From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 466B0A00E6 for ; Thu, 18 Apr 2019 15:25:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 51FCF1BA96; Thu, 18 Apr 2019 15:25:45 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40082.outbound.protection.outlook.com [40.107.4.82]) by dpdk.org (Postfix) with ESMTP id 3C1D71B676; Thu, 18 Apr 2019 15:25:44 +0200 (CEST) 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=HS4DDzQI65a19lXBklDCoc2VEEYUCxJnVglS8qxfLK4=; b=iBcOuETYUFc75Nqry+2G0ZGV4sXJRRnocda2K59Ow9KGQwoA9OzP61nfPdy4E9SL4KNQT2jBic+q42fGqN1LvSGzXO54Z+kOQGlOFOlPIAnAFYc8GzvB3G58+3OIHBv2msZx37rrtupbY/842ygLa4vnkphubiS9Ht5yVAhenA4= Received: from AM0PR0502MB3971.eurprd05.prod.outlook.com (52.133.40.151) by AM0PR0502MB3796.eurprd05.prod.outlook.com (52.133.47.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.11; Thu, 18 Apr 2019 13:25:43 +0000 Received: from AM0PR0502MB3971.eurprd05.prod.outlook.com ([fe80::7da6:9e13:922a:9d88]) by AM0PR0502MB3971.eurprd05.prod.outlook.com ([fe80::7da6:9e13:922a:9d88%5]) with mapi id 15.20.1813.013; Thu, 18 Apr 2019 13:25:43 +0000 From: Yongseok Koh To: Ori Kam CC: Shahaf Shuler , dev , Dekel Peled , "stable@dpdk.org" Thread-Topic: [PATCH v2] net/mlx5: fix modify header action position Thread-Index: AQHU9VhzcV9d1hj7xkevdOJ+choM0qZB6cAA Date: Thu, 18 Apr 2019 13:25:43 +0000 Message-ID: References: <1555273197-1949-1-git-send-email-orika@mellanox.com> <1555531305-90597-1-git-send-email-orika@mellanox.com> In-Reply-To: <1555531305-90597-1-git-send-email-orika@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=yskoh@mellanox.com; x-originating-ip: [69.181.245.183] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: efbeb9f1-aa21-4391-ff01-08d6c4015bb7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR0502MB3796; x-ms-traffictypediagnostic: AM0PR0502MB3796: x-microsoft-antispam-prvs: x-forefront-prvs: 0011612A55 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(346002)(39860400002)(366004)(136003)(189003)(199004)(81166006)(26005)(6506007)(53546011)(102836004)(6512007)(5660300002)(6862004)(71190400001)(6246003)(71200400001)(83716004)(186003)(82746002)(256004)(450100002)(53936002)(4326008)(25786009)(14454004)(8676002)(478600001)(8936002)(81156014)(14444005)(86362001)(7736002)(305945005)(33656002)(6636002)(66066001)(446003)(486006)(3846002)(6116002)(2906002)(36756003)(2616005)(11346002)(476003)(68736007)(99286004)(6486002)(37006003)(54906003)(97736004)(6436002)(229853002)(76176011)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3796; H:AM0PR0502MB3971.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-message-info: /wC8YKOkGEu6BWA7KCJBGwi721KPb+zD3H3L+4dAyq4Gieqnvan8dUCB6yaFV/eI0z/7csUR/n6/6O8LUxQ72Kj6AM81oUeifgPLrEpiABbR1UNw1kyZr7MvcIEj6LFu9ebaQY1rKe+AAtCisqOeYBa70aNfPkyD3BMuc4ks0RY3hJaWIehc6diwO90NdRnm/CncRJnoYz7gFNMC62ahWBWbkMXYtzdwFgym52M9FGhkm/aeRIN+uk87qatCk1Ysc79XEUQ+jIslMVy+UHA5fL5aGMmJWuQF5X5C0mVQH/rPDeueHVQ6kEoU7WpdSHTsjfSnDLdi2isNHs7c1noQ3EG8hyudiWXvVok4O/6FbWBzGFGqicSqfdr4mCNl2CxKyNzCsxZIJi9ssoAyPgA2oyRS4HIv5uZyWE/Ne4ywLgE= Content-Type: text/plain; charset="UTF-8" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: efbeb9f1-aa21-4391-ff01-08d6c4015bb7 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2019 13:25:43.0789 (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-Transport-CrossTenantHeadersStamped: AM0PR0502MB3796 Subject: Re: [dpdk-dev] [PATCH v2] net/mlx5: fix modify header action position 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" Message-ID: <20190418132543.GVL6Do9VqiqwJ5s3a1OU0NxrQ5UsVe9Rokt9FdvbDCc@z> > On Apr 17, 2019, at 1:01 PM, Ori Kam wrote: >=20 > According to RTE flow the action order should be the order that the > actions were given. > In the case of modify actions the position of the action was always > last. >=20 > This commit solves this issue by saving the position of the first modify > action, and then adds to this position the pointer to the modify action. >=20 > Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs"= ) > Cc: dekelp@mellanox.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Ori Kam > --- Acked-by: Yongseok Koh > v2: > * Move setting the index position outside the case. >=20 > --- > drivers/net/mlx5/mlx5_flow_dv.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow= _dv.c > index 3862b26..c84779d 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -3235,6 +3235,7 @@ struct field_modify_info modify_tcp[] =3D { > }; > union flow_dv_attr flow_attr =3D { .attr =3D 0 }; > struct mlx5_flow_dv_tag_resource tag_resource; > + uint32_t modify_action_position =3D UINT32_MAX; >=20 > if (priority =3D=3D MLX5_FLOW_PRIO_RSVD) > priority =3D priv->config.flow_prio - 1; > @@ -3474,13 +3475,16 @@ struct field_modify_info modify_tcp[] =3D { > dev_flow, > error)) > return -rte_errno; > - dev_flow->dv.actions[actions_n++] =3D > + dev_flow->dv.actions[modify_action_position] =3D > dev_flow->dv.modify_hdr->verbs_action; > } > break; > default: > break; > } > + if ((action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS) && > + modify_action_position =3D=3D UINT32_MAX) > + modify_action_position =3D actions_n++; > } > dev_flow->dv.actions_n =3D actions_n; > flow->actions =3D action_flags; > --=20 > 1.8.3.1 >=20