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 A03B3A0C45; Wed, 22 Sep 2021 09:04:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36C494003F; Wed, 22 Sep 2021 09:04:57 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id E58504003C for ; Wed, 22 Sep 2021 09:04:54 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10114"; a="223177863" X-IronPort-AV: E=Sophos;i="5.85,313,1624345200"; d="scan'208";a="223177863" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2021 00:04:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,313,1624345200"; d="scan'208";a="454645409" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga002.jf.intel.com with ESMTP; 22 Sep 2021 00:04:53 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 22 Sep 2021 00:04:53 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 22 Sep 2021 00:04:53 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.43) 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; Wed, 22 Sep 2021 00:04:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jFH0gD5anQOtgcKLER6Zb6Id2GA+1/QTSU8OQXVlByaLqaopxIiHDsefDkqdN/hHVen24h34qKF21VrqQxa0o/lAMH0FoLoj3c1b2WR3HRgewxAtwJyXsKwVxzNzSE5SnF74JSTtiG0eYrF1Q/RQdqzOU70e7Y19E6K/sDX3gb8uW7xH74TMIIfRQzgde6bJBkAGjVIu3t3nt+Cm2Jnon5bfrhV7ehzJKMyL2RiX2hzsbjIZWMo0QLygzWxrVfosaMsrdz9/JRNCuf5VpFP9rUXH0qd/4dEDbdiKGLoSyDTw1lbzXZdAKRdEilcfwD0Q7GdA0tTPuob1Q1Uxncmo5g== 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=e065TuQUeLLyXh/x4me1oAn2lTXSGdCBOPodpcFegBM=; b=lt3Y7DeTpjCoeGZr/9cF6CgMIT2vA02wJNiMZYHK++YG2kD1eiRGDkDxf8YFUokry9Rt7/mFAyPIY6F+RGkq3At4ngDLNcOX6FVyFqYR8GOEvjBiRmBE3oCG0uy9pd+JBZzNLFuyNIXFqV9PkOHVkyRuAxgPjPjRmHjJJVYuVJy4vrQX5ZtbPMLsytJ157KdQumZXUAJC+Ojo8WG+lP2A/hzEpAZZ1OALMQhyej4tmBZ50Sb4WxNCza6wDI1/S07ArAZ7o6ecar6VcjuxUqRMPIII1wwP66uZI9K+mYLbp+JxXi5RDX9pIFy4X1pjsBe8Qm7Zi0UsFR/Odv6Xp11tg== 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=e065TuQUeLLyXh/x4me1oAn2lTXSGdCBOPodpcFegBM=; b=M9ZUj4trcwqGTpcO8FZpPOURcUT3v9A+1UP05RE/3aRd9us4si5vs7afXQnlOwHzxLI27lIYqAFqhHrilG+AyquDOsLXpPvSwpOoXaAaU+MctnkAjNQ/dSaJok8XsTWdcCz62DdboFv75yCLZbBnk37gl8i40eEidG9INgOYxMU= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN6PR11MB3972.namprd11.prod.outlook.com (2603:10b6:405:7f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Wed, 22 Sep 2021 07:04:51 +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 07:04:50 +0000 From: "Wang, Haiyue" To: wangyunjian , "dev@dpdk.org" CC: "Xing, Beilei" , "Yang, Qiming" , "Zhang, Qi Z" , dingxiaoxiong Thread-Topic: [dpdk-dev] [PATCH v2 4/4] net/ixgbe: delete HW rings when releasing queues Thread-Index: AQHXrGkUzUqutX+q7k6clHAnH8OlaKuvmn6QgAALJYCAAAE4EA== Date: Wed, 22 Sep 2021 07:04:50 +0000 Message-ID: References: <22811a29652fba4827277ddebc578596ee2e766d.1631953295.git.wangyunjian@huawei.com> <06c01dbba1db46a8970ded089ae05229@huawei.com> In-Reply-To: <06c01dbba1db46a8970ded089ae05229@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: a6af908a-7282-4e5e-9f53-08d97d974589 x-ms-traffictypediagnostic: BN6PR11MB3972: 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:7219; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PDTbsGEpJCkTXXuxfyAsEvm/AMUNOas1wKIT3SPI2nysiD/CTNjwz8H5M7zq+rPXWy+OWpqW03uWbewkmzlt1tlbNvUNFX5aAyyTK/qCsI+Uen6uwC9imM0YT1Fcdtb4XjrWw1OKEOOVVFJiXAp2Wd5rObMsZx2yjkdfvHI1y5+9uyv3LAjBX8MBo9Oaq3bdSqRfLdNaGisMjtIISvQZ1/cgUQqZXyDNhFZYAWol5S7ZilXSSCjtLmCw5qiTHjQbpoE5stkWO7cOxERJ9ynvOlaLavaPCoILvDJWm1KTQvEYO3zaJpHlEUQ37uvZnCcxTIDDAZglySkdjOMqv7hSR7i+NX5P44MHIKsTHJAPmEaxJiyCEcUXc9ANH5fdpif+bV/AgekELn4hcEmevFtJlCs/gPqS2LLVsgafbe7vZp5lJGbq0VQ/QaVnMAKXN3Z0D4KYM/07b8IOBdlHyLN8ziXSp98nI4/yuTPNjcNxEUa0RhPNBr5GeKZ4nFU9k5LRhjtx/6kpi17rEli55H41BYod4g9h/8F50tKal2GDJV96AngCHdvIBN/D66bUtS7wDOVy8Q8QRCDMZ2NGX8FcNbWmf5bknU64Nd4ObpH65XlzYn6W8fd7LXj0RIQqLWp87OCHKKzpqx7cK+QQea0NCtwu7rpXcEe8Q53BbRt6Kkwm3ozsCMMacrTskfQp5jez0r4oMwYZ2xiQFqf8L7nLQNUQcL7vsndLqTY/+Nc+r36j72BaPvxvec8w3CiPjH/9kcUrHre6kpCFDLT2N/mIN4VOu9criSn8n9Q1lLrl4wI= 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)(966005)(9686003)(186003)(55016002)(54906003)(52536014)(316002)(71200400001)(26005)(110136005)(33656002)(8936002)(38100700002)(122000001)(86362001)(7696005)(66476007)(66446008)(66556008)(2906002)(64756008)(66946007)(76116006)(8676002)(38070700005)(5660300002)(4326008)(6506007)(53546011)(83380400001)(508600001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BPgmHSYSf0l785XpOcsrA8/hzmssQzvzUTz+LNBxvb/dxUyRfzq8YvCMijQL?= =?us-ascii?Q?njgplBuk6YhQSXa2Jw8PAGyLWWF07TZzg/qZ5kAHBVNPiIr///+OcsIk8Tmu?= =?us-ascii?Q?aZIeM7AsXsibmXZCMUHe9fVJmqSr2TiNMRjO8OmBKbRx0Hm7cazyQAkI1mqG?= =?us-ascii?Q?+G9LXabMR62FEnB66+2LbZs0YJpxZV0TmSwfML9xT7S1qbvvGUNZ7TeUIsis?= =?us-ascii?Q?DUTFF5NJs/wRUo6rCr7cPJBna+e88FAD1VxbsvhQhxQJUb5q2PFmJP+5Tfo1?= =?us-ascii?Q?rzy2PgnNXg39qxl0CzcBkUZNvNtnWMa1C3fUqgvrkihGZN+H+sws3/QMghHI?= =?us-ascii?Q?Nrx9u/qTHsZ0s6aZN0221XleURFY3VnjhQlifaGaNFemFv7gDzxLgfltyGn/?= =?us-ascii?Q?YOxh5kmWbRNIVxfH7CJB9Ue1CalUluResxs1hf07kKYQuItvazi7nYNIgIMB?= =?us-ascii?Q?nLi8I1HRBWEqtse9iL8PAawE7DU0zgKK4G8A3NXbCSpIqdm4G2Jqckjse5Y9?= =?us-ascii?Q?sphiZeoAhJWSINuvk9gIuv2UZ87wnSdygXBZ5HDTpvvb/eGeJ7iJQlTauRJy?= =?us-ascii?Q?VxTYywQRLf2rCkRuL/YNx217TayzRzjRucOp+A701+7cjgcb+nBkF5hOIVtF?= =?us-ascii?Q?EfllwLdpvK6Jd+bN/HVR3kRk9CZ7KGC0bRm1pPrEPqS3SEPALseu/3Of9g7N?= =?us-ascii?Q?+eBCeT97oOQdi2iyDEIUXiM/AvBjqBWhJUGr+bvPCX6y8CkWiXYUp7ZPXWHf?= =?us-ascii?Q?E/LhILuX5GfkZRoPc0CHmJtMrmpzp4+TBp8gefzei0+bJ3DSU9o7YssaTI+p?= =?us-ascii?Q?UX/9KrzUGDZhw93SYVTfBVclJSePL3XsBNgPlbTpI6xZ05je1gPQYW7eSE/0?= =?us-ascii?Q?yGZI49IQtfbkVEuqafkNLh2tlFc0Ng83LcK4OCHAT1F57Evh09qWpco9ULmz?= =?us-ascii?Q?40LAHTXPo+uX+ljRbLEsXiKNfHHi78HxSxqfA635wo9f0+fUs/vIewqc/cKx?= =?us-ascii?Q?/zmbF3rQ6Kip+A95FKhQnUvgFJvX/RsPs2TWG6Bntj1DjgWlawtXQe4oZZxI?= =?us-ascii?Q?x0NHNj48BN1R2JmM2X8k7VqSWx7bjb1bTatRlIuZtgDmE10cRoB8o1Os6Eo+?= =?us-ascii?Q?Qayc7TljffmFqN3zCzPVtQzq9MO0DGrVZc4wYFRB1B1SCtbc6L7U+PIIbYCc?= =?us-ascii?Q?LOz/nmVRX4AXITPynLrGzFC/l4qDteY5YLuAcDtwzrLjfJeIciL/TAHTxXfN?= =?us-ascii?Q?nbYemtI1ySv+AOomMW6YTC0+/Yg1d1PLRPYsp6F6bio2dTujhGd/UjfvGfXC?= =?us-ascii?Q?C4k90x2xePoEOYN0GyP9+OMv?= 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: a6af908a-7282-4e5e-9f53-08d97d974589 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Sep 2021 07:04:50.8017 (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: YGRFWAH8gXQM4ICkglj4c59KrU8PehsALOcpHei3huGu+61OuENrD5kcF3e7BTFIEM0vw/Ud4Z3XsCCmw02P4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB3972 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: wangyunjian > Sent: Wednesday, September 22, 2021 14:58 > To: Wang, Haiyue ; dev@dpdk.org > Cc: Xing, Beilei ; Yang, Qiming ; Zhang, Qi Z > ; dingxiaoxiong > Subject: RE: [dpdk-dev] [PATCH v2 4/4] net/ixgbe: delete HW rings when re= leasing queues >=20 > > -----Original Message----- > > From: Wang, Haiyue [mailto:haiyue.wang@intel.com] > > Sent: Wednesday, September 22, 2021 2:23 PM > > To: wangyunjian ; dev@dpdk.org > > Cc: Xing, Beilei ; Yang, Qiming > > ; Zhang, Qi Z ; dingxiaoxi= ong > > > > Subject: RE: [dpdk-dev] [PATCH v2 4/4] net/ixgbe: delete HW rings when > > releasing queues > > > > > -----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 ; dingxiaoxiong@huawei.com; Yunjian Wang > > > > > > Subject: [dpdk-dev] [PATCH v2 4/4] net/ixgbe: delete HW rings when > > > releasing queues > > > > > > Normally when closing the device the queue memzone should be freed. > > > But the memzone will be not freed, when device setup ops like: > > > > > > 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) > > > > > > In order to free the memzone, we can release the memzone when > > > releasing queues. > > > > > > > After re-check the eth dev API, I think we can simplify the commit mess= age 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 sma= ll > > 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 ? >=20 > OK, thanks for your suggestion, will include them in next version. >=20 Also, please fix the patch format warnings. You can get this from patchwork CI. FYI: https://doc.dpdk.org/guides/contributing/patches.html 6.9. Checking the Patches > > > > > 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(-) > > > > > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c > > > b/drivers/net/ixgbe/ixgbe_rxtx.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; > > > } > > > > > > + 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; > > > } > > > > > > + 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; > > > > > > 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_rxtx.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; > > > }; > > > > > > /** > > > @@ -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; > > > }; > > > > > > struct ixgbe_txq_ops { > > > -- > > > 2.23.0