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 82141A053B; Thu, 6 Feb 2020 16:35:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E15C91C18E; Thu, 6 Feb 2020 16:35:21 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 949851C133 for ; Thu, 6 Feb 2020 16:35:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581003319; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8t03eNkw1C16UCUqwtq3UxKRW3cRTysPCFPJFPQsJi4=; b=gayFeklEPaPbpZebkjwgALItSv0bAscU5VaBD3B7P+CqGllE+fDc2vXP70J6jgDagA/MPd lvpWuQClynFsYSI5zuy00geZH9AdSjmtIwGqXwJEhaWnr1w0o3yU6dhs51GMIKik9tLze7 O8y3dU+EkpKZFJncXE13/mbnYQMePq4= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-263-EQfkLI94N-yGxZaIwdO55A-1; Thu, 06 Feb 2020 10:35:16 -0500 Received: by mail-vk1-f200.google.com with SMTP id m72so2089399vka.20 for ; Thu, 06 Feb 2020 07:35:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aZ13xqbPa+kTcJLckMU12HgPw4ysQGn2U0MxPDIycP8=; b=FG+HcUuDxYTOpxkP6JUhzg7Q9ietLeM6e+LHthbkD0TUcQ4C/Ab8nERM1ni37SPr6Z uPnFK0A+c57J3Y6nkN1KnN+eDus4sOZAQVa7mgOVFl8OkB39IVUa8PW7sdChhAkK96di EPkmr5xJJdGtOlSYH6Tix/G/Mm6G4Sb3lJikHMHlCqk7zCKsjWGDyU7Y/SFHQJRfeMlx 9nQwTgs8qxi9q19HGVBk0mt/O+PVIFLp+Kyafzw91FwDJOATu8g/fZ0Seuhx0N4DaFxC 13g+s2WOz3rz7oSDiiOWT4JL4WBY0ZByAaIkHYrepTL8tKwyrRPfOATvDt5atOGsfmbX 4lzA== X-Gm-Message-State: APjAAAWvva9Y4Qtng1mKNhM/9V9DVcwm+EoBc7mBfSjospf63TZbtRQT 3RqKec6KWJmsN9RUfvKSt+9Ur6knb7GUlY8gfzJi8nAFJmTzBmOlvfRVJHpRoXUXpmAu0nW9uH+ 7At+wkQXZ9/TGOxzaur8= X-Received: by 2002:a1f:4104:: with SMTP id o4mr2109447vka.80.1581003315663; Thu, 06 Feb 2020 07:35:15 -0800 (PST) X-Google-Smtp-Source: APXvYqxzxhzy7y17z2iHFcNsaLiwlJz0crtrxs8koWcbstiJkZl8/wcGXYTnC53tf04nOHxhexTLBVfQ2OpekEJh7Nw= X-Received: by 2002:a1f:4104:: with SMTP id o4mr2109408vka.80.1581003314998; Thu, 06 Feb 2020 07:35:14 -0800 (PST) MIME-Version: 1.0 References: <20191220065645.22858-2-skori@marvell.com> <20200114090453.4548-1-skori@marvell.com> In-Reply-To: <20200114090453.4548-1-skori@marvell.com> From: David Marchand Date: Thu, 6 Feb 2020 16:35:04 +0100 Message-ID: To: Sunil Kumar Kori Cc: Bruce Richardson , dev , Harman Kalra X-MC-Unique: EQfkLI94N-yGxZaIwdO55A-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v7 1/2] 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 Tue, Jan 14, 2020 at 10:05 AM Sunil Kumar Kori wrote= : > > From: Harman Kalra > > Added an API to check if current execution is in interrupt > context. This will be helpful to handle nested interrupt cases. > > Signed-off-by: Harman Kalra > Signed-off-by: Sunil Kumar Kori > Reviewed-by: Jerin Jacob > --- > v7: > - No changes. > v6: > - No changes. > v5: > - Fix shared library compilation error > v4: > - No changes. > v3: > - API Comment is updated as per man page. > - Scope updated within the library/driver only. > - Remove experimental tag > v2: > - Rebased patch on 19.11-rc4 > > lib/librte_eal/common/include/rte_eal_interrupts.h | 11 +++++++++++ > lib/librte_eal/freebsd/eal/eal_interrupts.c | 5 +++++ > lib/librte_eal/linux/eal/eal_interrupts.c | 5 +++++ > lib/librte_eal/rte_eal_version.map | 1 + > 4 files changed, 22 insertions(+) > > diff --git a/lib/librte_eal/common/include/rte_eal_interrupts.h b/lib/lib= rte_eal/common/include/rte_eal_interrupts.h > index b370c0d26..19d1d45ab 100644 > --- a/lib/librte_eal/common/include/rte_eal_interrupts.h > +++ b/lib/librte_eal/common/include/rte_eal_interrupts.h > @@ -220,4 +220,15 @@ rte_intr_allow_others(struct rte_intr_handle *intr_h= andle); > int > rte_intr_cap_multiple(struct rte_intr_handle *intr_handle); > > +/** > + * @internal > + * Check if currently executing in interrupt context > + * > + * @return > + * - non zero in case of interrupt context > + * - zero in case of process context > + */ > +int > +rte_thread_is_intr(void); > + > #endif /* _RTE_EAL_INTERRUPTS_H_ */ > diff --git a/lib/librte_eal/freebsd/eal/eal_interrupts.c b/lib/librte_eal= /freebsd/eal/eal_interrupts.c > index f6831b790..ce2a27b4a 100644 > --- a/lib/librte_eal/freebsd/eal/eal_interrupts.c > +++ b/lib/librte_eal/freebsd/eal/eal_interrupts.c > @@ -671,3 +671,8 @@ rte_intr_free_epoll_fd(struct rte_intr_handle *intr_h= andle) > { > RTE_SET_USED(intr_handle); > } > + > +int rte_thread_is_intr(void) > +{ > + return pthread_equal(intr_thread, pthread_self()); > +} > diff --git a/lib/librte_eal/linux/eal/eal_interrupts.c b/lib/librte_eal/l= inux/eal/eal_interrupts.c > index 14ebb108c..cb8e10709 100644 > --- a/lib/librte_eal/linux/eal/eal_interrupts.c > +++ b/lib/librte_eal/linux/eal/eal_interrupts.c > @@ -1488,3 +1488,8 @@ rte_intr_cap_multiple(struct rte_intr_handle *intr_= handle) > > return 0; > } > + > +int rte_thread_is_intr(void) > +{ > + return pthread_equal(intr_thread, pthread_self()); > +} > diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_= version.map > index e38d02530..06ed2e9dc 100644 > --- a/lib/librte_eal/rte_eal_version.map > +++ b/lib/librte_eal/rte_eal_version.map > @@ -91,6 +91,7 @@ DPDK_20.0 { > rte_intr_free_epoll_fd; > rte_intr_rx_ctl; > rte_intr_tls_epfd; > + rte_thread_is_intr; > rte_keepalive_create; > rte_keepalive_dispatch_pings; > rte_keepalive_mark_alive; > -- > 2.17.1 We can't put this symbol in the stable ABI and just flag it as internal in the function description. Users won't notice this warning. I moved this as an experimental API and enabled the use of experimental api in octeontx2 common driver. We can revisit once we have the rte_internal tag Neil had proposed. Series applied, thanks. -- David Marchand