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 AF363A04DD; Thu, 28 Nov 2019 17:45:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 249B129CB; Thu, 28 Nov 2019 17:45:53 +0100 (CET) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by dpdk.org (Postfix) with ESMTP id D52E0293C for ; Thu, 28 Nov 2019 17:45:51 +0100 (CET) Received: by mail-pl1-f195.google.com with SMTP id bb5so11807807plb.4 for ; Thu, 28 Nov 2019 08:45:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9rrK0/xJl4hr81QvI6q7pqcVgBqkggi0Yqs7gcPj3cg=; b=zXhcOLAYdf0CB+ZNY9lYB0amFBKZAeMq3ZTmn98C2xOdrG3CzN1OXasIHUS/EkZ9cr Jqkaz6G3fWBiLUfTTtZ1ljvAzdK7xOHkL1t3bLd2jtifhgVd0Ty5rtJDx0XouyBVv2AG ExKfGUh8c+t6aadRxAtZjb2pG5EpoBLPM8QBt/YVMz2qp5r10EXxG31bAe9v3ixcxyUN xe0vOyNXh/G4lrd1cpJk9fQMOHl8QVNC7VZqTTupSHTqS2zqV0ojmEQ8ab5dy8JUodEa tII31y/Q/R9YB0NV3olyNDhxOzC0zigMSDK/eG6j8GddUXsAYRjPNzE5LybWj8pEqYu2 MCGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9rrK0/xJl4hr81QvI6q7pqcVgBqkggi0Yqs7gcPj3cg=; b=lCDspXoy8EuaJ3vzhUklFmTDDVbDkqujjtwCPM8FKc9q3tyaunNUDOJ8psb/4SNEOh UQmUFMhOqU9Yxk+Jx6iA1Xw1J2sXWRhLNKwz8GmxsNftaP59c4nnQOO3bg77fBf0c+Yn bWml2aJa8+nJCKP+Wy0OZzREtp2Jl/9qhAMQJHgy+3acLDFtxBL11hYndGek5odx6PA8 jRcpng6SZKw9jcAek/tfr/D6uv3bmhPV/yNN6cZhkclNfRWkl5s4VX4oau4xLuP7YU3P lZTcPbkt/IEGJkO07rzIFQXCqgKh0ueQOEU48QHYygEAeEOv2JJt2xoCayeUp0c+1dZI MYOw== X-Gm-Message-State: APjAAAXQ1Qbtn4Tj21KebbAwflNN98uTgqyh9BmY7f9wKl8Vld+OgtR3 hrweLYvvYpIAgwOeA2iw9pap/Q== X-Google-Smtp-Source: APXvYqxYlux23gxJboIpJqyhyvKzB1haIAvsJW6SqyXka9yjtr/ZDP6J4A59VeB5cBaPdmlefj7hKw== X-Received: by 2002:a17:90a:8d0d:: with SMTP id c13mr13429835pjo.68.1574959550838; Thu, 28 Nov 2019 08:45:50 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id o20sm21711237pfp.16.2019.11.28.08.45.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:45:50 -0800 (PST) Date: Thu, 28 Nov 2019 08:45:42 -0800 From: Stephen Hemminger To: Harman Kalra Cc: Sunil Kumar Kori , Bruce Richardson , "dev@dpdk.org" Message-ID: <20191128084542.3e293ce4@hermes.lan> In-Reply-To: <20191128081006.GA50093@outlook.office365.com> References: <20191126061525.28507-1-skori@marvell.com> <20191127102222.31940-1-skori@marvell.com> <20191127160319.27915b22@hermes.lan> <20191128081006.GA50093@outlook.office365.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v2 1/4] eal: add API to check if its interrupt context 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" On Thu, 28 Nov 2019 08:10:23 +0000 Harman Kalra wrote: > On Wed, Nov 27, 2019 at 04:03:19PM -0800, Stephen Hemminger wrote: > > External Email > > > > ---------------------------------------------------------------------- > > On Wed, 27 Nov 2019 15:52:19 +0530 > > Sunil Kumar Kori wrote: > > > > > > > > +/** > > > + * @warning > > > + * @b EXPERIMENTAL: this API may change without prior notice > > > + * > > > + * Check if currently executing in interrupt context > > > + * > > > + * @return > > > + * - positive in case of interrupt context > > > + * - zero in case of process context > > > + * - negative if unsuccessful > > > + */ > > > +__rte_experimental > > > +int > > > +rte_thread_is_intr(void); > > > > If you only need this in drivers, it should be internal not exposed > > as part of API > > Sorry, but can you please help me understand the query. Do you mean: > * Since "rte_thread_is_intr" would be used only used by > libraries/drivers and not by any external application, rather having > it in "rte_interrupt.h", we should have it in some internal header > file like "eal_private.h" ?? > > ANS - Yes we can do that but since all other related APIs like > "rte_intr_ack", "rte_intr_enable/disable" which are also used by > drivers/lib and not application, are prototyped in "rte_interupt.h". > > OR do u mean > * Since only octeontx2 driver is using this, why it is exposed as an API > rather it should be defined as some driver internal function ?? > > ANS - "rte_thread_is_intr" is an counter part of "in_interrupt()" in > DPDK, which will return whether the current execution is in interrupt > context. This helps in dealing with nested interrupts case. We faced a > similar case while handling hotplug probing initiated via secondary > process. > We believe this API could be very useful for many drivers which might > end up in handling nested interrupts case. > > Thanks > Harman What I meant was that some functions in EAL are documented as being internal (flagged with @internal) and don't show up in the documented API. My concern is that if we make this part of the public API, it makes it harder to change structural things like the interrupt thread later. The interrupt thread is already problematic for several other usages.