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 A5403A034F; Tue, 28 Apr 2020 10:02:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 844E31D58F; Tue, 28 Apr 2020 10:02:53 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2086.outbound.protection.outlook.com [40.107.21.86]) by dpdk.org (Postfix) with ESMTP id 215F11D57E for ; Tue, 28 Apr 2020 10:02:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CWak2e2uI0xjo21kEthoTI6eAqjWq/4CpkFV3ZhtjMwqPXfTU24idvQG+cL6gkjezntDvMm/LQsnWHlVXn8fslrR5OsjVNO/MAI3hROu56UHreZnwzfguuwwDP/y2A7UwUvYEiGSNZy7FdU9Pij9NzXhbFXsS1AM4ZSSUBTJ+KZCMemKqaORdY+RLtd2wqQtj2JXj6O3O03pR0KC+XGEH48aHlgbkwnAtBXErnWk31r6ZV8I2cqPS8SgSrywobevfPdWTeE4kq/6+Ag3KV0tP9wfiOr8CmpEt1PxaXb1nv+9VtyK7TefwCJNjM7XvAmryW2+3DUjBq1tCufCBvW1Vw== 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=84EjOHUoCUI/euoHXvOUoa3TFa1hzQeV3ttwM5KkBl8=; b=l1L88xqvredpmXu5ViOzO9PutAMdmCPoUPXVb4ZdTaHy5ZJmPT2wfNctjFMNAWQ4tkHa6xoc94EQQRlbUQkyXp8YqC1XIwpL6sQ3OzSWoj3Ynt0fA1ijJ2sQPrK0edIqAmIKiZzcThMR+97unYixLJje0jMfbadQj5IQqCaszHNqzlExEFDkLo+KC+oLmHHVbUEWmbe/bB2VGAsNAST+rz5r9pAwpS+EGiifqrdXm+TzCx/6PHIn54qebCnYRn3/yBdmb2j3o8zzooESYtNyZNTllMAzFGi3iRUMbtjwKJL3hTqFepvWNq9Xj7wQIVK0OVf1i7J4sTYLyKdlSn/EHg== 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=84EjOHUoCUI/euoHXvOUoa3TFa1hzQeV3ttwM5KkBl8=; b=bO2laTjZPl0WqoLSIA9fKfgm2OBXAItyxgQq3z6pPTyoZpxRy2IW/v7paJG6ASj8b7W1LRO3ah0Bb3zqNhdnbHX8McvWCAaZhojCM2nXBKDxl7XsWRmnrnmD/EsKV5VvlPk//i/KTM2XjC2ehj32f6pm2vPANoHGIDE7FWqmD+k= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (2603:10a6:205:8::26) by AM4PR05MB3250.eurprd05.prod.outlook.com (2603:10a6:205:10::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Tue, 28 Apr 2020 08:02:50 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::bdf0:88a3:3a39:4be4]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::bdf0:88a3:3a39:4be4%7]) with mapi id 15.20.2937.023; Tue, 28 Apr 2020 08:02:50 +0000 From: Slava Ovsiienko To: Suanming Mou , Matan Azrad , Shahaf Shuler CC: "dev@dpdk.org" , Raslan Darawsheh Thread-Topic: [PATCH] net/mlx5: save meter index instead of meter id Thread-Index: AQHWG3Wb90fHSJc680Stw1yFR/FI0KiOL6Yg Date: Tue, 28 Apr 2020 08:02:50 +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: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 71bdde04-1499-4939-078a-08d7eb4a8be5 x-ms-traffictypediagnostic: AM4PR05MB3250:|AM4PR05MB3250: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 0387D64A71 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM4PR05MB3265.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(376002)(346002)(366004)(136003)(39860400002)(107886003)(86362001)(316002)(54906003)(53546011)(9686003)(186003)(55016002)(110136005)(7696005)(6506007)(81156014)(4326008)(5660300002)(71200400001)(8936002)(52536014)(66446008)(66946007)(66476007)(33656002)(66556008)(64756008)(26005)(6636002)(478600001)(2906002)(76116006)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 24F8FvHlnKH93ALsmGLUDegfv1IyUKCdsvCEhDDW/6tYYYjG2dqyrQzZ6/dnW8i4CUkkybgE7zWK60mj4txDhwuEB1/MK1QHQ/sowxLVZGDGqX7qf6qAz7ZR6DUS3n/YJ0pyoWN/O0qtS8f/sgD7peO2MIeX3qGfKQBHVgRjqWHBLgUA06ZlwiN83lZzsCyGxEWSnQAs6yMZogsd/GOTYXEZ2Ov2Z+2Mr3yfAe7515c2yix8LX56ngWCisrFlJEwovqhGLEi6J+NCJNyOJczUgz/g0XMw/ThpDJ9QZ1hOAfiYf/Wv7MxXNQVD6dUf008sxmwpNm2iBdxKhSf6jMU45tyepVl/BmFKGaHFEZESlg9YklLSTtuRCmDYfA8knemV/Fwu1Cl6tXZplWv5u90H/TmNXPvGYzeZaSLE8PrPUczR2jHVxlh1OO33dgdk+j1 x-ms-exchange-antispam-messagedata: cQM6uIfzaZ4KBHKKrGEpi63JeSmFGu/b7LCZFBnmcugOwRKK24zn4GTRFxhjO943pPO1+86ew4kqDlvrpyjLSC3TAMeTrQMj9dA2nc04WT6S8d9EjXLO3NHoR6LqgAMi4zXbmdPssnONAxPSo1j+mpwUw7pqeSsPpVNsRyQCa5960U2Y2NCDhvuSty9Hozt6naYs27DKkNeVAlUJgDMjtI480iN3ZCTSGQT8pIc4LoPBbYswEapJH+vLC9sE5qVGib1euJlZ7t8RGFRzQt/4RfihDpCaBnBFzF1KH22+Iwoz1BjYxOM0lxJ4F3IiFG133FOk6Mz9Etqc2iWBkTk9BQ50ttNFCINRw6yCA/qK0ZSz75tOH2LEpxUimJIAAGSQWHTdY5zRclW6Blu3v3r/xlIsmEw1ZcLAD6HTPE5M5J8NWEM1c05zHSuKfoOAarSEhjmVLXt8Ny72o3tjMDGsYrvdAx8+Sxk++VHBBvCCdXLN5vEZgXSDNiJqgHLEfGSBfG2DDXkmPbtNUVH59FHyiDlV2H/JoS5TPOscovfirEUmp6Ohn8S6u+9vNiWJBvR9siUDiLEao656c4kFVHCiFC+QYQ78C8n+p+kUbFKo8tNGq2bVIm1D350cRVcczN0F36hD6g8D3NdKejcaWrukxRm93w6AEDacYvPRlg/aG+c09+WkJKXSoK2hSZGAeYkS/TIFxMunC1CobrgWDpUOrlkg19b7Gq5C6GCOEE4i4DYJFR4BFIy1pe5z3XY8oGw/x3375NhQj4nI78swMcws6NofRZv0ymn+K30GmvOKvTI= 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: 71bdde04-1499-4939-078a-08d7eb4a8be5 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Apr 2020 08:02:50.2475 (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: Hefo9IIqG1rJaf9qOlASyl2Wgbe8MhYMO0AuTdYMIEa2nPmf7LGKd8c1XlCUDwx08z+Zdqi/GTvGk9hJMbzuV0lUoc3DYAneCsZLehONeu4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3250 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" > -----Original Message----- > From: Suanming Mou > Sent: Sunday, April 26, 2020 5:51 > 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 r= te > flow. While destroying the flow, the meter object will be found by the me= ter > 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 s= ense > 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 fr= om > 1, save the internal generated index instead of user defined meter id wil= l > 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 Acked-by: Viacheslav Ovsiienko > --- > 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