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 8894DA0350; Tue, 23 Jun 2020 11:11:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 987711D5D3; Tue, 23 Jun 2020 11:11:54 +0200 (CEST) Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-eopbgr90090.outbound.protection.outlook.com [40.107.9.90]) by dpdk.org (Postfix) with ESMTP id 80E0E1D5B1 for ; Tue, 23 Jun 2020 11:11:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SLFptrJ/ljAyZDXy/nnAonuGlri9PeXTqANfZxf1dchGy9kGcOq2VRXZnh2MKgYvhDLgvQx4RzbugT3RfbYx1CEc3x5lXJfcJsHhAP18JUPrkYn1izwIE1UQUXzGkjZ2x5hQPkNZx8PW4xicT2QArBWCVIdlIStIW/xoNMR//FhdoxMhC1YFGImDvAaKsXZcaHPQPFg+1cgiEtGCR3Q/ZT2iqTO885bqAAdjGRAtz5hFOzTeqbdbK+XMrgMv7eBixFpYnZg+aNgd/qDrbMlw5XS19YHPM7sXd9Xrpvr4kegkIgbYJLIK6tDAh/mypifn4SI9Zmy35/fhBuCMHCOmvw== 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=bcfk24sQwJtdZhnaaEIgqyKlmf+6vLJjNOBTISY5dCk=; b=FYGI/lIwGXyIpK382R2z9VKaQUP7h8OE/XXIg8wC7NepAkvLY72PCFxewRZnd8dcTzeETjvgAOXPdhc7oDYfatqNpbc4uY7TALwUJRnxQBd/BgajJ3uqXn3fVEepwS8QGe/LHbc0fM4LEuqOcpAXZdYUP7ZXqEbBacT7FAyUwD++5bWkc9pMBTod66fIJKxmNwSHHYoXaPXD3m1ziuou8A3/aINz29KiR8kT+CWgplD+CwHktS0NXh0D5EvOSM9FB37MLX9B6aFDuXq2fW45/V3b82882gLbJFllJ+TgSZTtA21eaUEJIFngw6IXhVo90v+zgpI12r47eiMx9SntyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ekinops.com; dmarc=pass action=none header.from=ekinops.com; dkim=pass header.d=ekinops.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ekinops.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bcfk24sQwJtdZhnaaEIgqyKlmf+6vLJjNOBTISY5dCk=; b=i1CyWI8JFksMxZSrUhs5gLYlRjpUkWgMU+SuBbyEdnzF8u0GLkyvxY4jufANfnafkjO5KPFTHGABK4fwU5MO1vc9svvDV0Tw5hsPh8H7RFpCbDsqqIDudj46lM6IFmKbEyn3GXTjZT+nmcJrXBGwnYTyb8FJxN6urrRfVffTlME= Received: from MRXP264MB0120.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:1b::10) by MRXP264MB0023.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:1e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.23; Tue, 23 Jun 2020 09:11:50 +0000 Received: from MRXP264MB0120.FRAP264.PROD.OUTLOOK.COM ([fe80::b9c3:a77c:6837:2548]) by MRXP264MB0120.FRAP264.PROD.OUTLOOK.COM ([fe80::b9c3:a77c:6837:2548%6]) with mapi id 15.20.3109.027; Tue, 23 Jun 2020 09:11:50 +0000 From: Renata Saiakhova To: Ferruh Yigit , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 1/4] librte_ethdev: Introduce a function to release HW rings Thread-Index: AQHWSHtCwul4oJYRd0+z0vCJDwR3oKjk3s6AgAEMZe4= Date: Tue, 23 Jun 2020 09:11:50 +0000 Message-ID: References: <20200622095443.26136-1-Renata.Saiakhova@ekinops.com> <20200622095443.26136-2-Renata.Saiakhova@ekinops.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=ekinops.com; x-originating-ip: [109.131.239.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fa9358ab-7c9d-4ce2-a221-08d8175576e1 x-ms-traffictypediagnostic: MRXP264MB0023: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 04433051BF x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1v8stRb+hB67Nls5o0qE+n1Vdm/CUhqCzOoJ/hdIkKu7J+ONKE2KYXnS0XDvQeP6dAu0MivQuq4RQT8/mHHemHEn06L6RPNIMRaAfk8B/WPMRKWQMaSFEU3Mdzf2xXUbLULXIkv98qEAIMzQsRWD1CDIX6w2ntu0f6Qza1KBBxMypIuc3xw9TyXHWWAzue/ljattT4xRlqC/IRRJ3uNUpV2IsGz4WATDZVDvApfgwo+OfulEBWVvhg5Ftw9+FXdMLBJqkF8BClMJ2ftxWT5mt57aEKn3OdpqUia5f2VHhEGQHIr4zOvUVqdQ2mWyfzUd x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MRXP264MB0120.FRAP264.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(346002)(376002)(136003)(39850400004)(396003)(366004)(316002)(86362001)(8676002)(19627405001)(8936002)(110136005)(2906002)(76116006)(186003)(71200400001)(83380400001)(53546011)(6506007)(26005)(66946007)(44832011)(55016002)(33656002)(52536014)(66476007)(66556008)(64756008)(66446008)(9686003)(7696005)(5660300002)(478600001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: ML4y3Yvb2e0aYOu7bT+kTyKyB91BEWNDb7LtlbSjN1SZQ3gS1ywc9NDUzXJ0tHoWsP39Hjxs+wwVA/C+0+2W32jq4Cq+RVyP5ojmKZZzT0ijdLK+eT5BZ7wCfyu8i3OJQEMnnfr6ISBQl+Rf2NIMQykpnJY8avbIBd8ujJ2tAvo8PWHjxKJYco5pteHKPQ/j8oVQZ0+WiBENNbK8gvuciMW8i5ex/N1JDwdYGMKcFWkfob9EDhSyf7Px01SaZkqahO/PlceZVr0MJa8HHqfmxA+pUi4dMkItCtppfN3EtowN1rBBps2ENbd4fBocqJMBl1w+CI3p9GOWwgUzplfTKoJ93oYV36RrPPXZoCHMSemtFTN3Y0BJodhUOkcIL79qASJyDalbYeA4hOBKhPMHav4w4c4xB7a84ZwJOJaj5BxauPNZpgwCLaa9wUZKPc53O+A0Vn0azMBZTFZX12NyevF+Fm8c+ISUOGNtyZlA80I= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: ekinops.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa9358ab-7c9d-4ce2-a221-08d8175576e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jun 2020 09:11:50.6493 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f57b78a6-c654-4771-a72f-837275f46179 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: s2y7EEfwxgT+RUfurTqgoaKEXYmJ1MBVq6mMruMvqlbGaTMYQAMdo5jc1vad4FGVWEYdP+czYwr4QpvAw2ZMBujimc153x9Kj+8BJ9xEYJ4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MRXP264MB0023 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v4 1/4] librte_ethdev: Introduce a function to release HW rings 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 Ferruh, I added an INTERNAL block in .map file, that gives me an error: Build targets in project: 806 Found ninja-1.8.2 at /usr/bin/ninja [7/627] Linking target lib/librte_ethdev.so.20.0.3. FAILED: lib/librte_ethdev.so.20.0.3 ccache cc -o lib/librte_ethdev.so.20.0.3 'lib/lib@@rte_ethdev@sta/librte_e= thdev_ethdev_private.c.o' 'lib/lib@@rte_ethdev@sta/librte_ethdev_ethdev_pro= file.c.o' 'lib/lib@@rte_ethdev@sta/librte_ethdev_ethdev_trace_points.c.o' '= lib/lib@@rte_ethdev@sta/librte_ethdev_rte_class_eth.c.o' 'lib/lib@@rte_ethd= ev@sta/librte_ethdev_rte_ethdev.c.o' 'lib/lib@@rte_ethdev@sta/librte_ethdev= _rte_flow.c.o' 'lib/lib@@rte_ethdev@sta/librte_ethdev_rte_mtr.c.o' 'lib/lib= @@rte_ethdev@sta/librte_ethdev_rte_tm.c.o' -Wl,--no-undefined -Wl,--as-need= ed -Wl,-O1 -shared -fPIC -Wl,--start-group -Wl,-soname,librte_ethdev.so.20.= 0 -Wl,--no-as-needed -pthread -lm -ldl -lnuma lib/librte_eal.so.20.0.3 lib/= librte_kvargs.so.20.0.3 lib/librte_telemetry.so.0.200.3 lib/librte_net.so.2= 0.0.3 lib/librte_mbuf.so.20.0.3 lib/librte_mempool.so.20.0.3 lib/librte_rin= g.so.20.0.3 lib/librte_meter.so.20.0.3 -Wl,--end-group -Wl,--version-script= =3D/home/renata/work/dpdk/lib/librte_ethdev/rte_ethdev_version.map '-Wl,-rp= ath,$ORIGIN/' -Wl,-rpath-link,/home/renata/work/dpdk/build/lib /usr/bin/ld:/home/renata/work/dpdk/lib/librte_ethdev/rte_ethdev_version.map= :0: syntax error in VERSION script collect2: error: ld returned 1 exit status What could be an issue, is that I need to correct the version somewhere? KR, Renata ________________________________ From: Ferruh Yigit Sent: Monday, June 22, 2020 7:09 PM To: Renata Saiakhova ; dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v4 1/4] librte_ethdev: Introduce a function = to release HW rings On 6/22/2020 10:54 AM, Renata Saiakhova wrote: > Free previously allocated memzone for HW rings > > Signed-off-by: Renata Saiakhova > --- > lib/librte_ethdev/rte_ethdev.c | 30 ++++++++++++++++++++++-- > lib/librte_ethdev/rte_ethdev_driver.h | 20 ++++++++++++++++ > lib/librte_ethdev/rte_ethdev_version.map | 1 + > 3 files changed, 49 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethde= v.c > index 72aed59a5..ec1da2006 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -4181,6 +4181,10 @@ rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id,= uint16_t queue_id) > return fd; > } > > +#define ETH_DMA_MZONE_NAME(_name, _port_id, _queue_id, _ring_name) \ > + snprintf(_name, sizeof(_name), "eth_p%d_q%d_%s", \ > + _port_id, _queue_id, _ring_name) > + > const struct rte_memzone * > rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring= _name, > uint16_t queue_id, size_t size, unsigned align, > @@ -4190,8 +4194,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *= dev, const char *ring_name, > const struct rte_memzone *mz; > int rc; > > - rc =3D snprintf(z_name, sizeof(z_name), "eth_p%d_q%d_%s", > - dev->data->port_id, queue_id, ring_name); > + rc =3D ETH_DMA_MZONE_NAME(z_name, dev->data->port_id, queue_id, rin= g_name); > if (rc >=3D RTE_MEMZONE_NAMESIZE) { > RTE_ETHDEV_LOG(ERR, "ring name too long\n"); > rte_errno =3D ENAMETOOLONG; > @@ -4206,6 +4209,29 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev = *dev, const char *ring_name, > RTE_MEMZONE_IOVA_CONTIG, align); > } > > +int > +rte_eth_dma_zone_free(const struct rte_eth_dev *dev, const char *ring_na= me, > + uint16_t queue_id) > +{ > + char z_name[RTE_MEMZONE_NAMESIZE]; > + const struct rte_memzone *mz; > + int rc =3D 0; > + > + rc =3D ETH_DMA_MZONE_NAME(z_name, dev->data->port_id, queue_id, rin= g_name); > + if (rc >=3D RTE_MEMZONE_NAMESIZE) { > + RTE_ETHDEV_LOG(ERR, "ring name too long\n"); > + return -ENAMETOOLONG; > + } > + > + mz =3D rte_memzone_lookup(z_name); > + if (mz) > + rc =3D rte_memzone_free(mz); > + else > + rc =3D -EINVAL; > + > + return rc; > +} > + > int > rte_eth_dev_create(struct rte_device *device, const char *name, > size_t priv_data_size, > diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rt= e_ethdev_driver.h > index 99d4cd6cd..462e765d1 100644 > --- a/lib/librte_ethdev/rte_ethdev_driver.h > +++ b/lib/librte_ethdev/rte_ethdev_driver.h > @@ -180,6 +180,26 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *e= th_dev, const char *name, > uint16_t queue_id, size_t size, > unsigned align, int socket_id); > > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Free previously allocated memzone for HW rings. > + * > + * @param eth_dev > + * The *eth_dev* pointer is the address of the *rte_eth_dev* structure > + * @param name > + * The name of the memory zone > + * @param queue_id > + * The index of the queue to add to name > + * @return > + * Negative errno value on error, 0 on success. > + */ > +__rte_experimental > +int > +rte_eth_dma_zone_free(const struct rte_eth_dev *dev, const char *ring_na= me, > + uint16_t queue_id); > + Hi Renata, This API is not for applications, only for drivers, right? We recently (last release ?) introduced 'internal' (__rte_internal) attribu= te, we can use '__rte_internal' instead of '__rte_experimental' if the API is n= ot for applications. This requires adding 'INTERNAL' block in .map file (sampl= e 'lib/librte_eal/rte_eal_version.map') Also there are a few contribution conventions related issues which can be f= ixed while merging but please check them if you will be doing new version: subsystem is only libname without prefix: 'ethdev' Commit title description starts with lowercase: 'introduce'. sample =3D> "ethdev: add function to release HW rings" Thanks, ferruh