From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4EE7CA0C45; Wed, 22 Sep 2021 08:22:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19A5C4003F; Wed, 22 Sep 2021 08:22:53 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 67D464003C for ; Wed, 22 Sep 2021 08:22:51 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10114"; a="284537824" X-IronPort-AV: E=Sophos;i="5.85,313,1624345200"; d="scan'208";a="284537824" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2021 23:22:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,313,1624345200"; d="scan'208";a="484429637" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga008.jf.intel.com with ESMTP; 21 Sep 2021 23:22:50 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 21 Sep 2021 23:22:50 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 21 Sep 2021 23:22:50 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.102) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 21 Sep 2021 23:22:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jkTvtSkurmOoQTsTroy5Ww+DiBwvGnckGBWc2KyZwgQ7dLlfptOvARsLWjTTTIAdgULVfgcuvy42xrekQU+FdGBVN3bmFhzWXxEOTFB2tKq32hzHo+u3jQ2hQguZH6gLKhuD2gKLnY43ju5SEsNW6Np/lJ1y8Z2nXpOFC7MWJMcbC+cl4D31wDtfR3rqY43RT6mv5PPAuWCtZMeAzd/JEf/ImJhEtL8Q1p8A4Ia+ryINL3dphLW8l0E/NfwhWwpHdbWNDw8mi06+Ixo21IEMYuI6CcqSsYSBmLHAp1BPiRVcsm2VjnJ5ga6ri9+tq7ddsK2CTjXiPEOrRHEx4jL/9A== 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; bh=za72p9kU/Tv9WhlIIWTd4LrZOFVRTrSasaAQ6JGdbgE=; b=USseXqa55Nf8OHvyI2/raIdnZaBkDXGMwOIiza2ytuM3CgKhmMue/J3sQY3+H1baYUnCBcAoLG21/ZrP5VoPd5wNovSU4Yr94rxAsplRh7wJPj/3FvOimPobQiYd3dIs+jfTGsMEtwwd635RywFlWIW7I5msXkQMsUOEAm+3hEn4qGevEIqkmTBuiAYU6ZPRbTGvPslU3vOHx0ReVZhpITuOXFXkKu8HZZCJyCYHpBJv5hHQlPeiSl6M7qro37/yI3nn9Z2rbsWwp0rTB05izFBZwy8ik+Gmeuf5UlOS3L5SPfqqEEFcQkJKuNWACL2jSyjekcJi0J8v+tTRrBwyDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=za72p9kU/Tv9WhlIIWTd4LrZOFVRTrSasaAQ6JGdbgE=; b=ZBV6n9TyAFUbwwhMJt7dtKXKGGIK7ZKORZ7u6wliU3KjNg8OubidNcgVYzU8lelVxp0Ywrb7c7/wJV4RX6r1j0qeNfANSkTpQoSdsN+MEdvR1B/uLFkQ8W9WeVyE7mD5MnAbK6DKyV2+4BcM17ZO6rWAIvWxmjN1/g0Wy0W2pdM= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN6PR11MB1844.namprd11.prod.outlook.com (2603:10b6:404:103::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Wed, 22 Sep 2021 06:22:45 +0000 Received: from BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::a437:5cee:7df:1fa7]) by BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::a437:5cee:7df:1fa7%3]) with mapi id 15.20.4544.014; Wed, 22 Sep 2021 06:22:45 +0000 From: "Wang, Haiyue" To: Yunjian Wang , "dev@dpdk.org" CC: "Xing, Beilei" , "Yang, Qiming" , "Zhang, Qi Z" , "dingxiaoxiong@huawei.com" Thread-Topic: [dpdk-dev] [PATCH v2 4/4] net/ixgbe: delete HW rings when releasing queues Thread-Index: AQHXrGkUzUqutX+q7k6clHAnH8OlaKuvmn6Q Date: Wed, 22 Sep 2021 06:22:45 +0000 Message-ID: References: <22811a29652fba4827277ddebc578596ee2e766d.1631953295.git.wangyunjian@huawei.com> In-Reply-To: <22811a29652fba4827277ddebc578596ee2e766d.1631953295.git.wangyunjian@huawei.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b31c1a73-deb5-4254-71ae-08d97d916440 x-ms-traffictypediagnostic: BN6PR11MB1844: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:751; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: V1M52Bi7oAnt3sg5w7J7PGDWLycpzbWD9rH+GWdAfJVql1F6nWWSyVpur8Qt14xEgAT9EJ+K8TzIxeY/nfJeUKpTvSbih0cju52Sc0Oy0YcGkAojVy3VOSD7XUYI8nRTQtuhIyATvDr0Ka+VrknCdcPqkl9lPvqmD+2a1myx+ns9cqklN+t/G+w6F3WgTix39lJTfTsyWsqxvV0SCBNjoSQR6TV/n7ePm2jDgPT4/hm3TUaPg4lPbtiYGXYklndyXwaojqqB43s11S8MCFW2/FXiS5bdBWPNDH/URcQ68BVYB8AV2pUAFzUybg7HtuNbHnhzsYzFDXwapPltzkoCc669CW2kv25h1+j18ucIvafn/xZ24cIZRzxJfv1F5i/qCw7Iozw9A5j2CUJJ7U0h27lZRGXklsTYwmXPb4867Q76Z/eYwV4rW5IuoYg7SUA4ZjYuG7plVqR9ea+2onOHAYPz7pSi760akgcHPZZ0qqzHWO2U2Qa0Z7KZQIr9E7jpY5jVTS0oBxIb3XPqqk/SKphncesz8jMs6N3UlRBEjH9lRRxSp5hupN0JlmGY4p2LjeifkWFSaoictjMAU9sujcWe6T+DjfPYj03ScAzUetG+TnFHdUH6LJoy7m/uPUi6vVw6xD0HDBVJrOctFQRnRxFaH9kjghV917feThmY0NyF7kKbLuXtVz7aloLipBMCVbhdYIP9fbnql6GS+IRAGg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR11MB3795.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(53546011)(55016002)(6506007)(8936002)(76116006)(2906002)(64756008)(8676002)(186003)(38070700005)(83380400001)(33656002)(71200400001)(4326008)(9686003)(66556008)(66476007)(5660300002)(26005)(52536014)(7696005)(66446008)(316002)(38100700002)(110136005)(54906003)(122000001)(508600001)(66946007)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Di1K0JDd/sqhlul4sSrFFd9V5jrJh3fP7dWeIgUAgu0MUmjJqY0f1q5EOPk5?= =?us-ascii?Q?6HK1u1FSzQNzYya6oYz5SyDD8qFQFDQYP1fAeh6KoDxV7bCRbqzEl8Or5XBk?= =?us-ascii?Q?AtAxKSNUgMDsVvtTW+kOT2jgmxyz5RUucwjaNaZHBwGtXmq8qUk7zfxDoEPD?= =?us-ascii?Q?NfFv9iXtattD7LeOOc6HyPw38BkM9r7M3U7byjV3JRUch3HXwXz+qZzZWzjY?= =?us-ascii?Q?UoZ7DPHerUnMP8Ponyz1snJOCTpvYCwj8BoDpU66YlZALiEe/rrwXaghIr/0?= =?us-ascii?Q?9dGu5Ls+nOeGhYshMW6JW22e78lRbwX01AGBxZku9EedBqyWm5ZjHReEkwBL?= =?us-ascii?Q?QODOocdiwUvLp1JMdoj7zKj6l5BdMLnX2xM3hFYAz1D70W5TAVED0pV4IT9e?= =?us-ascii?Q?C3FlOiAeKkuBpYdEL0nZReLqwwnW1hPpDlik3kDgU8VzKKIGfFQEgDJEtXzQ?= =?us-ascii?Q?aTY1NGmOHLGmByL6bgwoI9AhHlDsQ3F9pjV8pS45jpVVr2fHzW3iJSles+9n?= =?us-ascii?Q?+qYjp2wBsIfh+9sZ+rRwypufn76t6OLtWOzLViXmj+YBQDB+eopWSR9xqoYe?= =?us-ascii?Q?AjrSBHuBYwNwXpo0U4bUMyWncA63MH8jXivvh/P58ACn92/b2RobPOsXBZzZ?= =?us-ascii?Q?T/LOwT478G0UCzJt64YJiyxXYvj85kKJlCbeUfGqhESuvsrqKRChnc4+CVdu?= =?us-ascii?Q?K8rwXLKZ+MBHAxNvin+MhD6QTeM6BX7b/iDfwzff8Zdk6Uo9DWYKAgBun5/O?= =?us-ascii?Q?q8SSnegM3+tQn6Gii4q/EY2HczwNapam54719hjF69wXnPOze2pLzE9GiXkz?= =?us-ascii?Q?q3MKlfWvaWvWQ5u9TWHbLF2ncCKapqymG9Z/48vdOavvt8Hp1aEQSllIMbQ7?= =?us-ascii?Q?u/f62vQOsfxgPHzqskOya8rjSZY8lofIGhya9fiw8r7xALbV0KJ9M0uzh1w+?= =?us-ascii?Q?KQWuwouVAVgDv0oM0aKfIEy7eGFr9JWJ2dq0HJMEM9UL1ky69FJxN1ailog+?= =?us-ascii?Q?bWc/5Ldba2kwGl7usSW/kLYz7vZRLBa16J6E7tWxK5WIhh1O+CHgzhb3OvMt?= =?us-ascii?Q?OmfYD3+wVetgkfIVGfVVz9+bTLN6zCNUlft4DJdlz9XBY5TZJtPPHNl+6o5Y?= =?us-ascii?Q?UkdGxLrXslSRmfY4Z20WyQ0V/eT5yyB2vwGjYv7eCA0u63vXVFa5wJXSlg5R?= =?us-ascii?Q?3wbFhgihlpqiJKR88g8Q9IPY3KWzf7Lmn4Of0UM96KvKGaqnlrxPRhaILPQh?= =?us-ascii?Q?5hlTakJLtQfo+4Z9WW2BvzSQj+gLepiDamHVLcheX/Ni1wu+g+00MtUgNpkH?= =?us-ascii?Q?AMX+y+0zUzWcXpSjBDdOmnJL?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3795.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b31c1a73-deb5-4254-71ae-08d97d916440 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Sep 2021 06:22:45.0453 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5qmpTV8h50ho+LZbU8omP7VjanUmZiGAfxq+7K5+O5EFklBIJOQi2A/dGtC1WOfB9sjjfo8S6RYP7pUuZmZMvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1844 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 4/4] net/ixgbe: delete HW rings when releasing queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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: Yunjian Wang > Sent: Saturday, September 18, 2021 16:42 > To: dev@dpdk.org > Cc: Wang, Haiyue ; Xing, Beilei ; Yang, Qiming > ; Zhang, Qi Z ; dingxiaoxion= g@huawei.com; Yunjian Wang > > Subject: [dpdk-dev] [PATCH v2 4/4] net/ixgbe: delete HW rings when releas= ing queues >=20 > Normally when closing the device the queue memzone should be > freed. But the memzone will be not freed, when device setup > ops like: >=20 > rte_eth_bond_slave_remove > -->__eth_bond_slave_remove_lock_free > ---->slave_remove > ------>rte_eth_dev_internal_reset > -------->rte_eth_dev_rx_queue_config > ---------->eth_dev_rx_queue_config > ------------>ixgbe_dev_rx_queue_release > rte_eth_dev_close > -->ixgbe_dev_close > ---->ixgbe_dev_free_queues > ------>ixgbe_dev_rx_queue_release > (not been called due to nb_rx_queues and nb_tx_queues are 0) >=20 > In order to free the memzone, we can release the memzone > when releasing queues. >=20 After re-check the eth dev API, I think we can simplify the commit message to such as: Fix memzone leak when re-configure the RX/TX queues. Please see 'rte_eth_dev_configure', when queue number is changed to small size, the BIG memzone queue index will be lost. This will make it is a MUST fix. ;-) And add the Fixes tag and CC to stable. What do you think ? > Signed-off-by: Yunjian Wang > --- > drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++++-- > drivers/net/ixgbe/ixgbe_rxtx.h | 2 ++ > 2 files changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxt= x.c > index bfdfd5e755..1b6e0489f4 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > @@ -2482,6 +2482,7 @@ ixgbe_tx_queue_release(struct ixgbe_tx_queue *txq) > if (txq !=3D NULL && txq->ops !=3D NULL) { > txq->ops->release_mbufs(txq); > txq->ops->free_swring(txq); > + rte_memzone_free(txq->mz); > rte_free(txq); > } > } > @@ -2763,6 +2764,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, > return -ENOMEM; > } >=20 > + txq->mz =3D tz; > txq->nb_tx_desc =3D nb_desc; > txq->tx_rs_thresh =3D tx_rs_thresh; > txq->tx_free_thresh =3D tx_free_thresh; > @@ -2887,6 +2889,7 @@ ixgbe_rx_queue_release(struct ixgbe_rx_queue *rxq) > ixgbe_rx_queue_release_mbufs(rxq); > rte_free(rxq->sw_ring); > rte_free(rxq->sw_sc_ring); > + rte_memzone_free(rxq->mz); > rte_free(rxq); > } > } > @@ -3162,6 +3165,7 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, > return -ENOMEM; > } >=20 > + rxq->mz =3D rz; > /* > * Zero init all the descriptors in the ring. > */ > @@ -3433,14 +3437,12 @@ ixgbe_dev_free_queues(struct rte_eth_dev *dev) > for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > ixgbe_dev_rx_queue_release(dev->data->rx_queues[i]); > dev->data->rx_queues[i] =3D NULL; > - rte_eth_dma_zone_free(dev, "rx_ring", i); > } > dev->data->nb_rx_queues =3D 0; >=20 > for (i =3D 0; i < dev->data->nb_tx_queues; i++) { > ixgbe_dev_tx_queue_release(dev->data->tx_queues[i]); > dev->data->tx_queues[i] =3D NULL; > - rte_eth_dma_zone_free(dev, "tx_ring", i); > } > dev->data->nb_tx_queues =3D 0; > } > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxt= x.h > index 476ef62cfd..a1764f2b08 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx.h > +++ b/drivers/net/ixgbe/ixgbe_rxtx.h > @@ -138,6 +138,7 @@ struct ixgbe_rx_queue { > struct rte_mbuf fake_mbuf; > /** hold packets to return to application */ > struct rte_mbuf *rx_stage[RTE_PMD_IXGBE_RX_MAX_BURST*2]; > + const struct rte_memzone *mz; > }; >=20 > /** > @@ -236,6 +237,7 @@ struct ixgbe_tx_queue { > uint8_t using_ipsec; > /**< indicates that IPsec TX feature is in use */ > #endif > + const struct rte_memzone *mz; > }; >=20 > struct ixgbe_txq_ops { > -- > 2.23.0