DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: Harman Kalra <hkalra@marvell.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Sunil Kumar Kori <skori@marvell.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v2 1/4] eal: add API to check if its interrupt context
Date: Wed, 4 Dec 2019 16:23:25 +0000
Message-ID: <20191204162302.GA183703@outlook.office365.com> (raw)
In-Reply-To: <20191128084542.3e293ce4@hermes.lan>

On Thu, Nov 28, 2019 at 08:45:42AM -0800, Stephen Hemminger wrote:
> On Thu, 28 Nov 2019 08:10:23 +0000
> Harman Kalra <hkalra@marvell.com> 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 <skori@marvell.com> 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.
> 

I think now I understood your point, I will move prototype of this API to
"common/include/rte_eal_interrupts.h", flag it as @internal
and resend next version. I think this file was created for such
APIs only as its description says.

/**
 * @file rte_eal_interrupts.h
 * @internal
 *
 * Contains function prototypes exposed by the EAL for interrupt handling by
 * drivers and other DPDK internal consumers.
 */

Thanks
Harman

      reply index

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 11:35 [dpdk-dev] [PATCH 1/5] drivers/octeontx2: allow experimental symbols Sunil Kumar Kori
2019-11-25 11:35 ` [dpdk-dev] [PATCH v3 2/5] eal: add API to check if its interrupt context Sunil Kumar Kori
2019-11-25 11:35 ` [dpdk-dev] [PATCH 3/5] common/octeontx2: add interrupt offset to mbox structure Sunil Kumar Kori
2019-11-25 11:35 ` [dpdk-dev] [PATCH 4/5] common/octeontx2: add polling based response mbox message Sunil Kumar Kori
2019-11-25 11:35 ` [dpdk-dev] [PATCH 5/5] common/octeontx2: enhancing mbox APIs to get response Sunil Kumar Kori
2019-11-26  6:15 ` [dpdk-dev] [PATCH v2 1/5] drivers/octeontx2: allow experimental symbols Sunil Kumar Kori
2019-11-26 16:21   ` Thomas Monjalon
2019-11-27  8:34     ` [dpdk-dev] [EXT] " Sunil Kumar Kori
2019-11-27  9:42       ` Thomas Monjalon
2019-11-27 10:22   ` [dpdk-dev] [PATCH v2 1/4] eal: add API to check if its interrupt context Sunil Kumar Kori
2019-11-27 10:22     ` [dpdk-dev] [PATCH v2 2/4] common/octeontx2: add interrupt offset to mbox structure Sunil Kumar Kori
2019-11-27 10:22     ` [dpdk-dev] [PATCH v2 3/4] common/octeontx2: add polling based response mbox message Sunil Kumar Kori
2019-11-27 10:22     ` [dpdk-dev] [PATCH v2 4/4] drivers/octeontx2: enhancing mbox APIs to get response Sunil Kumar Kori
2019-11-28  0:03     ` [dpdk-dev] [PATCH v2 1/4] eal: add API to check if its interrupt context Stephen Hemminger
2019-11-28  8:10       ` [dpdk-dev] [EXT] " Harman Kalra
2019-11-28 16:45         ` Stephen Hemminger
2019-12-04 16:23           ` Harman Kalra [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191204162302.GA183703@outlook.office365.com \
    --to=hkalra@marvell.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=skori@marvell.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git