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 08516A0C43; Wed, 20 Oct 2021 11:52:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E1B6240687; Wed, 20 Oct 2021 11:52:07 +0200 (CEST) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by mails.dpdk.org (Postfix) with ESMTP id 97E3140142 for ; Wed, 20 Oct 2021 11:52:06 +0200 (CEST) Received: by mail-lf1-f46.google.com with SMTP id x27so13823490lfa.9 for ; Wed, 20 Oct 2021 02:52:06 -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=CnwVlh1/11veHd/HbC3478vCDuw9gboinmfE9psr9SU=; b=RwJCMz9DeTMlxHth3tGC2axG9ZEYLqDer7JfHV1ZkYdQpMlY9l2wFQwWK2EsGvqlG0 PPnoRIAdt7wvvKOVoPgukm59zQvVC4jbNBqQiE/V1dMWsAMZsqizFTkIvtyecAH9Msxt i9kwtrRtvgTXfM0busMqyaZbJxzys+W2xgfqBCrtNmrUgakR+cuMyjgTCGZBRInAaj/y rW0tbE/7RvbJP8xDC1YC9sYlk97v8YrgfbN41KzIDSMoHL4ZSpGgeSM5MmmZ/17V/0RY XTkdyAKDBFSS6GB8kmcnZB4ROucq9cNVBWjvN2LRyTBcjq0WmmlCX1WkMJ56YH7o/zpU nLOQ== 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=CnwVlh1/11veHd/HbC3478vCDuw9gboinmfE9psr9SU=; b=ajjrYIebcD/5M/61WgNDn7GPn0wgsZx8KZw2+aAsZ5/72xtyjxkc5DEHgazz2NYYQf dF12dsQK1abL4a1FV9D6aiuL8PcVDH+pwtmn2FSP9+hcPZuuiCKnDL9NztRlYVvsPJbG sPvwwiuLegxafpSYytGEqne+EN4TRg3AlzciKP77SZZC7VTzZMa27bM8qXiXlLAUnENc TlPHC9Q4dBM7iQ4XwZ2vLjXsro7og+ZMtgEx2STlZY2m+SmJSa1HjC7go3Esa8Qbx8Jg 1g8DX//TOMe7KjspDy5iHAAKt2ab1z1QY0ysi5Fdn3Y+3hlsSNyeXq+/FbFEESF+23QK UUCA== X-Gm-Message-State: AOAM533Nwe4sHOzG1RhsZXPTBItCueIhY86stmF4UwCO660wO+2VjsSH bRgB42uDyRSqFHSpOxwOiV4= X-Google-Smtp-Source: ABdhPJxz6BmfG9Z1oCgTLde96eb6a1bh9W1Q6EuImRLK/ywg9h+R5cpHG6XVrNDjCjPz7xzQwoGaig== X-Received: by 2002:a05:6512:2203:: with SMTP id h3mr11152231lfu.44.1634723526152; Wed, 20 Oct 2021 02:52:06 -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 q15sm150056lfm.276.2021.10.20.02.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 02:52:05 -0700 (PDT) Date: Wed, 20 Oct 2021 12:52:05 +0300 From: Dmitry Kozlyuk To: Harman Kalra Cc: "dev@dpdk.org" , Bruce Richardson , "david.marchand@redhat.com" , "mdr@ashroe.eu" , "thomas@monjalon.net" Message-ID: <20211020125205.034efb5c@sovereign> In-Reply-To: References: <20210826145726.102081-1-hkalra@marvell.com> <20211019183543.132084-1-hkalra@marvell.com> <20211019183543.132084-4-hkalra@marvell.com> <20211020002758.47063c5a@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 v4 3/7] eal/interrupts: avoid direct access to interrupt handle 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-20 09:25 (UTC+0000), Harman Kalra: > [...] > > > diff --git a/lib/eal/freebsd/eal_interrupts.c > > > b/lib/eal/freebsd/eal_interrupts.c > > [...] > > > @@ -135,9 +137,18 @@ rte_intr_callback_register(const struct > > rte_intr_handle *intr_handle, > > > ret = -ENOMEM; > > > goto fail; > > > } else { > > > - src->intr_handle = *intr_handle; > > > - TAILQ_INIT(&src->callbacks); > > > - TAILQ_INSERT_TAIL(&intr_sources, src, next); > > > + src->intr_handle = rte_intr_instance_alloc(); > > > + if (src->intr_handle == NULL) { > > > + RTE_LOG(ERR, EAL, "Can not create > > intr instance\n"); > > > + free(callback); > > > + ret = -ENOMEM; > > > > goto fail? > > I think goto not required, as we not setting wake_thread = 1 here, > API will just return error after unlocking the spinlock and trace. Just to emphasize, we're talking about FreeBSD implementation. There is no "wake_thread" variable there, so "goto fail" is needed. Your consideration would be valid for similar code in Linux EAL.