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 C0512A00BE; Wed, 29 Apr 2020 14:48:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 470CF1DAA3; Wed, 29 Apr 2020 14:48:19 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80075.outbound.protection.outlook.com [40.107.8.75]) by dpdk.org (Postfix) with ESMTP id B7BDB1DA9F for ; Wed, 29 Apr 2020 14:48:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fzTyA83MXXZwqQAD072DL5b4gK+LZuZnqLLHlh49IZ58efttLGtCE9h4SrwEv50REwh5g4vGLoe3bJ18vrOS++8fK3ZeW4P7bjV4vZM3/HeN/W39eM1oYjbSq5RP5FlQB4ugOVsjYfNnmGLCi/0rB7g8VAz/l7Quix5J9NnQwcPPvJIIysjS6/XpddviICVQjqH/rHc7jKZ+/0cXItfYJ5cKvF96JOdQnXjzCLw3GgrA2CLl61OX4MrCyhiZLgL5O92OqQhfor1xEyMcRpR4/D4NjE7IQ0ZtpbSGHc2xssQnlYDMbUtzauPMSqsCHFkPHHj3JEux9yLGmcBYuhdU7A== 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=OXod8nofWthJ2rLMJ/igeQ33psCHtQSvBZUxKWkJ7IM=; b=J291aGYfbeTvz+TQY452hf6/DiPkNgq2Ndfo/y9c5DiRkqBPAbV0DutMW5HwWuBQ0V6MLiQKWlBcJ2SgvwPMTN5yFWdGUCoQKWh7gZLhmw4YzmV3QroN6W/J3RyRHXZWShe0aQWKfVPBG5RMLjOBY305x23papZlL/QjH2Rx767etUkHSZkGMglwmBAivWsRkyQatRY2pBG7xTn4RRhvjF47hgekdogcmHSe0K0ILD8IllEjcmVCjvnbZz7Lp3lpwLJBcgejGrwneUWPgB2co1/58c1EAYSeuSaLN6KBkqW/phCH6U2eSoPm6OFvUKoVWA4fEbG8Jv4WVFzlSkP7LQ== 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=OXod8nofWthJ2rLMJ/igeQ33psCHtQSvBZUxKWkJ7IM=; b=Bpj4gHErrcC/pxivlnY3rMFDmV/IiZaR6XJPLwk7wA1C3+xjMCo65Qt+UBTerWxt3L8ndo4Z8bGRr8GxUPCGGlDh3UX7TmzIOxM4CLwkHJXamrXDmq8UMpoyKTYZBCFrG9VdBbTVz8fJsR5X6o6sqQ3gqE9Q0KdIhA4HIScS3h8= Received: from VI1PR05MB6718.eurprd05.prod.outlook.com (2603:10a6:800:13b::9) by VI1PR05MB4829.eurprd05.prod.outlook.com (2603:10a6:803:54::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Wed, 29 Apr 2020 12:48:16 +0000 Received: from VI1PR05MB6718.eurprd05.prod.outlook.com ([fe80::6d6a:e905:6b4b:addd]) by VI1PR05MB6718.eurprd05.prod.outlook.com ([fe80::6d6a:e905:6b4b:addd%6]) with mapi id 15.20.2937.023; Wed, 29 Apr 2020 12:48:16 +0000 From: Raslan Darawsheh To: Suanming Mou , Matan Azrad , Shahaf Shuler , Slava Ovsiienko CC: "dev@dpdk.org" Thread-Topic: [PATCH] net/mlx5: save meter index instead of meter id Thread-Index: AQHWG3Wb8xdAQdeLgEak+n0U7emtlqiQEebQ Date: Wed, 29 Apr 2020 12:48:16 +0000 Message-ID: References: <1587869486-60185-1-git-send-email-suanmingm@mellanox.com> In-Reply-To: <1587869486-60185-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: 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.230.216] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c473ce51-a3a5-459f-ce83-08d7ec3b9633 x-ms-traffictypediagnostic: VI1PR05MB4829:|VI1PR05MB4829: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2512; x-forefront-prvs: 03883BD916 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB6718.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(346002)(136003)(39860400002)(396003)(366004)(55016002)(478600001)(26005)(9686003)(186003)(110136005)(6506007)(5660300002)(7696005)(316002)(53546011)(66476007)(76116006)(66946007)(4326008)(6636002)(52536014)(86362001)(8936002)(8676002)(66556008)(66446008)(2906002)(64756008)(33656002)(71200400001); DIR:OUT; SFP:1101; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WoGLIQyI+mgtwXpfdWqpjUVSXhxQ80azekF3ettRLM/fpDUPdbKeeZEfqoRzYRTSKSmAaA3s2ShNHYKJ2UWayfKw1tbL6eASqXTswBuc7cOcpjp5F+p9dEgN2AJwQ1vyxNPo5sKqSYXJBRj0pDp/C+Hc94r0dVTwGZKlJjoQSUEGwhpvY0RzA5bXjoED8rX6/WDkBHfefc3CxbXnEDEI3nU7oudk8BZN6Hvd8XduVqtLT9hMhqcimlHWUmMej+Li4A3deI2qNu1DK1iZ87H4H3avK4LRuEzv3mdjiFHgYkd4SSPGJWOPasD9NThWVw8RuQTRtSmhAhPWhUTHKmJ6hr81jOcfZa9NPDnAg0nn1WMGMLKkPHBbACX1kIwezpSne+JNAU6K/eT1zQuetQl1rzRs6PORNDLlANzyXj1I33l0Hi/IhUrlry2N3KuT0dSD x-ms-exchange-antispam-messagedata: 88qcdthvC+F6z9PvgNj/ptdztT4g8GdwTjaWfxLSGN5amtJXvOIz7Tc/qSJeKmiKAbaGbFACTzLi6CIQY2zQzFkWO/ulCJBb5l7P6Z8J25bLLh2JLk1mDiNS7lEgNU9XRG3uGq2E/cde8MyMbptEWNUWu2+baqZMbHuBYae0mtNBjNyQk959vbGGh1Tv9VuajX0aWJ7/DBWlVoNz24IilGalm0xXgAiSQTMj2xcY7Y4GcN/N2PDlmCg/FVleRHH8765gfQ1Qkj412+7Jsx6YWkuYgvRS3dX7YE42lQU5o4Q7myBJWKU3SmbMBqPsc+d8T1tuJf1I1FaNuF7jMLQTr/qZotbSM5WU01rBDo+ZeL1+jgjLk8sr3Evps6nT4lf/RFjfyc/oEml7jsSKlPtP2BwgvZdPsUXyUfWg8mpXBJ2o0sMv2bsVkZlqQJXY98UlEHIZjs0HePjic/+Beu7HsPKu4tSLThWbUMtKgxQo1rLb4A6TI8ys61nSvydGMVDpVSh8vcaLpqifv9bx0W/RtuC4Vmn4mgbRGDO9VlDFxEi3wkn/e3SNp9IujIKP5Xk9QNZH/Aqwj+t+e7ruWrIu99Z5xgI/h2c5TYWJKnToA/yKbja6Fi4phiJzdYMFPvmDxT6a5uLYNqslBFp+PrpvVk7KmEc159yTjqA42hnwVvt6gE3xBZOVJNQvgGsBpviv2fPOqflcQOrjj4J6+WhE/aQCvPz+f2/kHOa5wnZ0L8w4Lbd8seq3JrfGnIRZSLE+mmV2FPXmwH3uGViYA7yoFzROpsNIItj5Vfu7ufx6fXfEqzi/Sdzs37aZU4CUPm9y 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: c473ce51-a3a5-459f-ce83-08d7ec3b9633 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2020 12:48:16.1804 (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: dgB0d3hUoEx3NmKjgl9V+wS6mR+htpahC3yVmSgJzy9QJdPw362QzfBnQdaubRIcFh4Lj9hOz2XFLqVRJf17jA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4829 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: save meter index instead of meter id 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: Sunday, April 26, 2020 5:51 AM > To: Matan Azrad ; Shahaf Shuler > ; Slava Ovsiienko > Cc: dev@dpdk.org; Raslan Darawsheh > Subject: [PATCH] net/mlx5: save meter index instead of meter id >=20 > Currently, while creating the flow with meter, meter id is saved to the > rte flow. While destroying the flow, the meter object will be found by > the meter id, so the meter object will be released accordingly. But as > the meter id is configured by user, while the meter id is set to 0, it > doesn't make any sense to flow destroy since 0 means flow doesn't have > meter. The meter object with id 0 will be leaked. >=20 > As meter object is allocated from indexed memory, and the index starts > from 1, save the internal generated index instead of user defined meter > id will never meet the issue as above. >=20 > This patch saves meter index instead of meter id in rte flow. >=20 > Signed-off-by: Suanming Mou > --- > drivers/net/mlx5/mlx5_flow_dv.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index 6263ecc..2fdd403 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -7867,11 +7867,12 @@ struct field_modify_info modify_tcp[] =3D { > NULL, > "meter not found " > "or invalid parameters"); > - flow->meter =3D fm->meter_id; > + flow->meter =3D fm->idx; > } > /* Set the meter action. */ > if (!fm) { > - fm =3D mlx5_flow_meter_find(priv, flow- > >meter); > + fm =3D mlx5_ipool_get(priv->sh->ipool > + [MLX5_IPOOL_MTR], flow- > >meter); > if (!fm) > return rte_flow_error_set(error, > rte_errno, > @@ -8591,7 +8592,8 @@ struct field_modify_info modify_tcp[] =3D { > if (flow->meter) { > struct mlx5_flow_meter *fm; >=20 > - fm =3D mlx5_flow_meter_find(priv, flow->meter); > + fm =3D mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_MTR], > + flow->meter); > if (fm) > mlx5_flow_meter_detach(fm); > flow->meter =3D 0; > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh