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 2F8AAA0C4D; Mon, 4 Oct 2021 16:03:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14D4C41320; Mon, 4 Oct 2021 16:03:33 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id BE5844131B for ; Mon, 4 Oct 2021 16:03:31 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 194BQkmY019463; Mon, 4 Oct 2021 07:03:29 -0700 Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2175.outbound.protection.outlook.com [104.47.57.175]) by mx0b-0016f401.pphosted.com with ESMTP id 3bg0ra0gg0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Oct 2021 07:03:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fJbZwz+5z+GI6bznvIrGkwEdW6qPIkJeP+l9fiRKakRS5JpZE36B6SW5JgesjQ+32Ssj0K7UX7/P6a6qbjlRVtyxJ5I6K3ty/icqkBwmYvc1CTg/rfZc5/aDCTwuii0NIoztetHqXDtFF6c1hTPuG4KJ5giSZ1Pq7SG2htbcHsaoybiO/7bI/wkJgl6EL+rzfOv2pSwjabPZCYPwUYSWnplwFytm1aI2Iw07G+tBEMblSiARnihz2zD7EHUGoxPU1wT7LBeaA1+Bm6NcZl2e/dyAkeVLMudQYeAot+07/ZNLFEb8jp7kJF6tWsg58yFmp78iAeHxjWxvPc6pTwH1aA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=10lylX2EBPlGijXdBubqKJ+BoiUHSiDuRMzcQZpaXpA=; b=ldcu/buyKY/OVK6Zh/cI07tcVgoXDi1D5IWoJfY4eb8CT5IVey5L8zdzeIV3TMf8U+uH2thU9ojh3B2dmy29Q54hdgEvV5+rF6GkaeLLvL9KXYMsPk+JvQ5IY/K3aldHkYEucS58PJ22B3Kvx6t50qW/Ew6YFskxoZ7DbTT6f7w8hr7fcQ41SUpP9uKBM0pAI/7bWzd/opvxFsC0I6Cq7F//CJlNqzD2JrnB+WDZiT2u+P+Efh9QetdP6X2NwAfibHweHDM29RjGu9TUKiIycRALPB6/JjXyFDwNE53GeTFrW3YvqaR7+fyVj/kGetHXgrOqekxWXR5wAWQbQqkYBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=10lylX2EBPlGijXdBubqKJ+BoiUHSiDuRMzcQZpaXpA=; b=jnrL+toiXCAnBI6CU0yp5xAu50tLUu3ztcm3Pu7dgYnu199xv0e1VauSMKSelELjukWOSAa9oy+hcJB03szYdvVJsG3fexxCUEYFYUjjIlVmjWtEL/rQk9TfdoZ3K9Nz6+jDdCvko4A/y4LFuDVMIu+KcenZt8MXhI5HvfDuOWw= Received: from BN9PR18MB4204.namprd18.prod.outlook.com (2603:10b6:408:119::18) by BN8PR18MB2753.namprd18.prod.outlook.com (2603:10b6:408:75::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.19; Mon, 4 Oct 2021 14:03:26 +0000 Received: from BN9PR18MB4204.namprd18.prod.outlook.com ([fe80::29f4:8e3d:264f:26b1]) by BN9PR18MB4204.namprd18.prod.outlook.com ([fe80::29f4:8e3d:264f:26b1%7]) with mapi id 15.20.4566.022; Mon, 4 Oct 2021 14:03:26 +0000 From: Harman Kalra To: Dmitry Kozlyuk CC: "dev@dpdk.org" , Ray Kinsella , David Marchand Thread-Topic: [EXT] Re: [dpdk-dev] [PATCH v1 2/7] eal/interrupts: implement get set APIs Thread-Index: AQHXoMEXRUmGnDOfBEuyfrELGqzD26vBwOCAgAEPZ9CAABFRgIAAKqsg Date: Mon, 4 Oct 2021 14:03:25 +0000 Message-ID: References: <20210826145726.102081-1-hkalra@marvell.com> <20210903124102.47425-1-hkalra@marvell.com> <20210903124102.47425-3-hkalra@marvell.com> <20211003210505.1c852bd4@sovereign> <20211004141827.4b36a12e@sovereign> In-Reply-To: <20211004141827.4b36a12e@sovereign> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7a001c11-9f51-49d3-73ef-08d9873fbc49 x-ms-traffictypediagnostic: BN8PR18MB2753: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SNyX45kRcJUqf9Wdj9G0yN8UtMU03BFt9Rrt4EHMFOEPGKORvkkr5k88GPSeMx3KaS5Z1NZ28+cP73NyVk5jgZwKGyyTJAWt/Fjl/zUw8geqe0ehoTA8XgKHsdA/oXd9n4qHHfKhYAV4yz+knlrSZS474PaUq50BFI4r6RveSj6/Su8L6Ii+DLUkowc0gY9LDs06fLr7FriQZmu9vBHtMe488Tq6p5czuNTNq5CnO/rC7DQkf2ekzGEK9diIvnV1p/ijjIclplpFZZCaomY1aDkCmr7mmhZUiwxml0H0GmRyHQAZ6LwNBDP7NYpA40WFxPj+WSBk+QuB2Uz+4lrJnt6c4ABJIibS1fAfohR+MmPu3qi8EgYinZ5VzKhmYL3OysUFmd6s3ikr4CQ5oHVV1iofGHuH9qxow+RN1IPgEcauH8sDHqO52dp3ziCSauvifFAKuA3mBRyVHLIJOS9vHzGe2zmG39EmfAaAV6Go+eGSPm5pul2VN38KUf31Jj91kaxyoBPWHC649ffprb0SoBhunEFDAE7E4p+DWpfUPDae/2Zjm3AGdb0z7HSUb42mFwNwMsSgT7thihsBHx7Z9d+kC9O1UZ+NEoh9CPtBqzcPrTkKOxQohFEoRCb/9+Wa29OMu78JdKhNYWmRH8TWLNzRiX6OLG9g0suS25Ex4eLw02qtW4L2/8EiVsN9fHcfWD2f61DxxSPzZRnMWFgeiQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR18MB4204.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66476007)(64756008)(2906002)(8936002)(7696005)(8676002)(33656002)(55016002)(6916009)(122000001)(86362001)(38100700002)(66946007)(76116006)(9686003)(66446008)(316002)(66556008)(508600001)(4326008)(5660300002)(186003)(83380400001)(38070700005)(52536014)(6506007)(54906003)(53546011)(71200400001)(26005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rJJAKYF/JJNZFl/g1piv8YNN9M00v7NoFdVcsnCkDiq8ZKit7Wk92orN2rLt?= =?us-ascii?Q?V8FuZeAo8ijmVJ68u9AnVlcvH7fi34/Jlqpau6gJprpS1Js9HJR1Lr2Pu0fK?= =?us-ascii?Q?aqxyttoG9Ie7XgoXEWDi9FILFw6+vIU6QbOO+PJUjLPFy9gT75/VWj52UVRr?= =?us-ascii?Q?uIy+9Z8kNoitEebeYLR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LGXi6t?= =?us-ascii?Q?hb5LCuZEnZp8gzINNKBT7zNt+QuM5FYoOF6VIcLHGzt0/76Bq02ifew7+JsY?= =?us-ascii?Q?z3gtm2FucEev17NFkGTV9OSIlxKVLQNGnFMu3JaBrM8vqK/ItrQiVijYMehs?= =?us-ascii?Q?+ch/NuJOwxheILeOCtpzKg3R5bka3vsxd/WlFxacFFobcw/SgZWQKFfNZAop?= =?us-ascii?Q?maecxBqrAdVmzWHbrs3/t6fzfeVFUHYiRlHzL+v/4IGRLfYUMj2NcZ5ljNK6?= =?us-ascii?Q?Vuwqm2g41wFokIPv/ueJjlMX?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR18MB4204.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a001c11-9f51-49d3-73ef-08d9873fbc49 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Oct 2021 14:03:25.8836 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mu3papXixxGAxGOzmypXRBRmfU0lLv1WK0TSjKptIpTREzuQzlBg1zhOc1tPXGWl2chYVF4QuzJ5RIcfRO+XXg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR18MB2753 X-Proofpoint-ORIG-GUID: AyVRN1qhWr5wmiLNo-MrR2NLrAkNf7vv X-Proofpoint-GUID: AyVRN1qhWr5wmiLNo-MrR2NLrAkNf7vv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-10-04_04,2021-10-04_01,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v1 2/7] eal/interrupts: implement get set APIs 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: Dmitry Kozlyuk > Sent: Monday, October 4, 2021 4:48 PM > To: Harman Kalra > Cc: dev@dpdk.org; Ray Kinsella ; David Marchand > > Subject: Re: [EXT] Re: [dpdk-dev] [PATCH v1 2/7] eal/interrupts: implemen= t > get set APIs >=20 > 2021-10-04 10:37 (UTC+0000), Harman Kalra: > > [...] > > > > +struct rte_intr_handle *rte_intr_handle_instance_index_get( > > > > + struct rte_intr_handle *intr_handle, int > > > index) > > > > > > If rte_intr_handle_instance_alloc() returns a pointer to an array, > > > this function is useless since the user can simply manipulate a point= er. > > > > User wont be able to manipulate the pointer as he is not aware of > size of struct rte_intr_handle. > > He will observe "dereferencing pointer to incomplete type" compilation > error. >=20 > Sorry, my bad. >=20 > > > If we want to make a distinction between a single struct > > > rte_intr_handle and a commonly allocated bunch of such (but why?), > > > then they should be represented by distinct types. > > > > Do you mean, we should have separate APIs for single allocation > > and batch allocation? As get API will be useful only in case of batch > > allocation. Currently interrupt autotests and ifpga_rawdev driver makes > batch allocation. > > I think common API for single and batch is fine, get API is required fo= r > returning a particular intr_handle instance. > > But one problem I see in current implementation is there should be > > upper limit check for index in get/set API, which I will fix. >=20 > I don't think we need different APIs, I was asking if it was your intenti= on. > Now I understand it and agree with you. >=20 > > > > +int rte_intr_handle_instance_index_set(struct rte_intr_handle > > > *intr_handle, > > > > + const struct rte_intr_handle *src, > > > > + int index) > > > > > > See above regarding the "index" parameter. If it can be removed, a > > > better name for this function would be rte_intr_handle_copy(). > > > > I think get API is required. >=20 > Maybe index is still not needed: "intr_handle" can just be a pointer to t= he > right item obtained with rte_intr_handle_instance_index_get(). This way y= ou > also don't need to duplicate the index-checking logic. In the current implementation, batch allocation of interrupt handle may lea= d to mem leak while freeing efds and elist array. I am only freeing efds/elist for intr_handle[= 0] in rte_intr_handle_instance_free(). To free efds/elist of all the intr_handles[], either I should cache the siz= e parameter passed during alloc. But where should I store it? In first instance of struct rte_intr_handle. I don= 't think it will be a good idea. Since batch allocation is only done in test suite and ifpga_rawdev.c, to ke= ep things simpler let's restrict rte_intr_handle_instance_alloc() to single instance allocation and user can= call this API in a loop and maintain array of handles locally.=20 With this approach get_index API is not required and set_index API can be r= enamed to rte_intr_handle_copy() Thoughts?=20 Thanks Harman