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 49E85A0C4C; Mon, 4 Oct 2021 13:18:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBDE64132C; Mon, 4 Oct 2021 13:18:29 +0200 (CEST) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by mails.dpdk.org (Postfix) with ESMTP id 2D99341325 for ; Mon, 4 Oct 2021 13:18:29 +0200 (CEST) Received: by mail-lf1-f53.google.com with SMTP id x27so69597029lfa.9 for ; Mon, 04 Oct 2021 04:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2Nwe7DeARZq2K6xPVPphWHB4LKsXEC/f8bScNXMcUmo=; b=mpGWUOEuVdVte57IpVdYS1KLJZifAgxmnFE9QN7Gwk8lKISj64/LmmCv6tcWY43pj7 DaghWAg4ztiObDdnChY5gh5Twj1l4tAVeyNqSdDBRgflPg6uyN2ZG16PyL2ltneWsouN SPPZBWwbcrxP95XtCSVUWmqfOTudf4QtL7jIl7tSNZ4F6Iw5Uigdgltban68dVOwjvFh 5/+/pZz0regn7jNW7X/Mv57I57TJJvangTGyzIKoU/+ZnsIhebnli+YdhsXwhDXhmgX7 +GKLeld/qqDj2dSNSkhA708oYInsbCe+5L5emhbrQ/mTt+I4XupPGnUxBG9hWxXdUgv4 RGVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2Nwe7DeARZq2K6xPVPphWHB4LKsXEC/f8bScNXMcUmo=; b=uvFDrjNhbPAZRx1QuYy+FHljjtLnSIIiUIFtJfr3N9ZI5fgi6HmFp+IiIWdU/j8c6H n4ewitnBIOSocy5LmjqyYxH6S1jEJ0Ax+D/KbJYNvhJaMtO9vXLFaBM6vemdz0t1t+rv 1gIQVTPD2uqOvwgia0eKBkv0dqdVEgFG/db9l4feWFcLiIfVuNzOsXOA7qCYqOPw8oxS m/XBFpqQTCo3DXtZwbbShPQj5xCtPaBd86CrKyCrCkMv1XqfRw609Spx/JH7Yrj9dYNu mFA2xj1mrz9wAQljOJNJx2WNH07+x8cyurs+WylqjWjcIHsTeEqUlr8XeQuOM5BFsnmK X0ig== X-Gm-Message-State: AOAM531nn8+YJZgFq84mPwBWiXrvae7ZDTUGJy5H8IP7++Ib0BviSEr7 DETpufrUskYiUHzoGmuIYFA= X-Google-Smtp-Source: ABdhPJy85D9xWrPKwSeoO5TEl7bq8kgwEO63LYPr/VRFdMaPaEIVFDl8YCI4PozV8fa/6FsDGh84RA== X-Received: by 2002:a2e:7401:: with SMTP id p1mr14805849ljc.531.1633346308624; Mon, 04 Oct 2021 04:18:28 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id r22sm1613461lji.5.2021.10.04.04.18.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 04:18:28 -0700 (PDT) Date: Mon, 4 Oct 2021 14:18:27 +0300 From: Dmitry Kozlyuk To: Harman Kalra Cc: "dev@dpdk.org" , Ray Kinsella , David Marchand Message-ID: <20211004141827.4b36a12e@sovereign> In-Reply-To: References: <20210826145726.102081-1-hkalra@marvell.com> <20210903124102.47425-1-hkalra@marvell.com> <20210903124102.47425-3-hkalra@marvell.com> <20211003210505.1c852bd4@sovereign> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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" 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 pointer. > > 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. Sorry, my bad. > > 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 for 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. I don't think we need different APIs, I was asking if it was your intention. Now I understand it and agree with you. > > > +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. Maybe index is still not needed: "intr_handle" can just be a pointer to the right item obtained with rte_intr_handle_instance_index_get(). This way you also don't need to duplicate the index-checking logic.