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 6CB6EA0C53; Thu, 14 Oct 2021 09:31:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1683D40042; Thu, 14 Oct 2021 09:31:32 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 849B040041 for ; Thu, 14 Oct 2021 09:31:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634196691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=L1rnlZOtMp0gSamr55TuojdiuLYgapcIKeHj3WF3AQM=; b=h8+GSm71tFXkcPgr3dQjUrVlEJSZxp2yxDTgGLAR3qsWnB7yYIcEdlOKVk0f5AhS2BGCHO egQ9fOKRktCPmI1aBUsqYnEZX8N7dNNZRLdRUDWeDF4QmYNRIeKqDl67fjmBeXs5/aSVxo SVJmdT0AkSHR3Vo5bXgTWn1kVsID8HQ= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-593-w6izT6CTP7G44Uc1LJl-XQ-1; Thu, 14 Oct 2021 03:31:30 -0400 X-MC-Unique: w6izT6CTP7G44Uc1LJl-XQ-1 Received: by mail-lf1-f72.google.com with SMTP id z29-20020a195e5d000000b003fd437f0e07so3687293lfi.20 for ; Thu, 14 Oct 2021 00:31:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=L1rnlZOtMp0gSamr55TuojdiuLYgapcIKeHj3WF3AQM=; b=v8FOrIDDwtLD0dYskABy2t3f+s1gzGk5A8qLZDbeEN6/SjtbvMrPyoDyvAJxv8BUkn kCsZ6YKBvWhzhc11jcUf0MyDV8T6jepoUqdiYlrdbjEPQ1068ocWLr3vba2GjJur5M7c c0BTLbOhfF+d+8jD07je1nhNVDWDBn6AtrQlr10U4ZVrmxZfu+hIWbwAPpXtvUtQoLzU R01YiNKCkFkHcKEgkaH5dzSCp2KWNJTbkzUzqFpUqqTuWMUYN0eZgvi9LoZU5UD82y0D QplSQzAdST4zPKjLpy51xkN2xhkrhExHlaJnhas9FFn/RKcqY7IUCd0Ui83eMnNtuger 8h9w== X-Gm-Message-State: AOAM5301LltUe3+eKu+tmkEM0YCghIeigCl7HDPQI9rvTxBUGiVXVP1Q joHr7S9WWZxp/3meVszl7wwzQcmZmlxp8ZXOMg4+/zbopp8LU2JphG3BTwUJJg8/5tUf8Kgiwjv f4udTypa1tpCKM02UYhQ= X-Received: by 2002:a19:c514:: with SMTP id w20mr629239lfe.265.1634196688428; Thu, 14 Oct 2021 00:31:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKLIPiKGlPaUq/ZvOCVF8KWUgKdR+WBz8wiTlvJLKoQnjaQT1UAy7nYtKYYwrNhcj45+2pkDBvb1tY/rJ+BN4= X-Received: by 2002:a19:c514:: with SMTP id w20mr629215lfe.265.1634196688194; Thu, 14 Oct 2021 00:31:28 -0700 (PDT) MIME-Version: 1.0 References: <20210826145726.102081-1-hkalra@marvell.com> <20211005121502.66964-1-hkalra@marvell.com> <20211005121502.66964-2-hkalra@marvell.com> In-Reply-To: <20211005121502.66964-2-hkalra@marvell.com> From: David Marchand Date: Thu, 14 Oct 2021 09:31:17 +0200 Message-ID: To: Harman Kalra Cc: dev , Thomas Monjalon , Ray Kinsella , Dmitry Kozlyuk Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 1/6] 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" On Tue, Oct 5, 2021 at 2:17 PM Harman Kalra wrote: > +struct rte_intr_handle *rte_intr_instance_alloc(uint32_t flags) > +{ > + struct rte_intr_handle *intr_handle; > + bool mem_allocator; Regardless of the currently defined flags, we want to have an ABI ready for future changes, so if there is a "flags" input parameter, it must be checked against valid values. You can build a RTE_INTR_ALLOC_KNOWN_FLAGS define that contains all valid flags either in a private header or only in this .c file if no other unit needs it. Next, in this function: if ((flags & ~RTE_INTR_ALLOC_KNOWN_FLAGS) != 0) { rte_errno = EINVAL; return NULL; } A check in unit tests is then a good thing to add so that developpers adding new flag get a CI failure. This is not a blocker as this API is still experimental, but please let's do this from the start. > + > + mem_allocator = (flags & RTE_INTR_ALLOC_DPDK_ALLOCATOR) != 0; > + if (mem_allocator) > + intr_handle = rte_zmalloc(NULL, sizeof(struct rte_intr_handle), > + 0); > + else > + intr_handle = calloc(1, sizeof(struct rte_intr_handle)); -- David Marchand