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 C93A5A0471 for ; Thu, 18 Jul 2019 15:13:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5884C152A; Thu, 18 Jul 2019 15:13:24 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id A1F5C137C for ; Thu, 18 Jul 2019 15:13:22 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jul 2019 06:13:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,278,1559545200"; d="scan'208";a="158778190" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.251.81.9]) ([10.251.81.9]) by orsmga007.jf.intel.com with ESMTP; 18 Jul 2019 06:13:18 -0700 To: Nithin Dabilpuram , Hyong Youb Kim , David Marchand , Thomas Monjalon , Ferruh Yigit , Bruce Richardson Cc: jerinj@marvell.com, John Daley , Shahed Shaikh , dev@dpdk.org References: <20190717115852.171416-1-ndabilpuram@marvell.com> <20190718084628.134290-1-ndabilpuram@marvell.com> <20190718084628.134290-3-ndabilpuram@marvell.com> From: "Burakov, Anatoly" Message-ID: Date: Thu, 18 Jul 2019 14:13:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190718084628.134290-3-ndabilpuram@marvell.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 2/3] eal: add ack interrupt API 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 18-Jul-19 9:46 AM, Nithin Dabilpuram wrote: > Add new ack interrupt API to avoid using > VFIO_IRQ_SET_ACTION_TRIGGER(rte_intr_enable()) for > acking interrupt purpose for VFIO based interrupt handlers. > This implementation is specific to Linux. > > Using rte_intr_enable() for acking interrupt has below issues > > * Time consuming to do for every interrupt received as it will > free_irq() followed by request_irq() and all other initializations > * A race condition because of a window between free_irq() and > request_irq() with packet reception still on and device still > enabled and would throw warning messages like below. > [158764.159833] do_IRQ: 9.34 No irq handler for vector > > In this patch, rte_intr_ack() is a no-op for VFIO_MSIX/VFIO_MSI interrupts > as they are edge triggered and kernel would not mask the interrupt before > delivering the event to userspace and we don't need to ack. > > Signed-off-by: Nithin Dabilpuram > Signed-off-by: Jerin Jacob > Tested-by: Shahed Shaikh > --- > */ > int rte_intr_disable(const struct rte_intr_handle *intr_handle); > > +/** > + * It acks an interrupt raised for the specified handle. > + * > + * Call this function to ack an interrupt from interrupt > + * handler either from application or driver, so that > + * new interrupts are raised. > + * > + * @note PMD generally calls this function at the end of its IRQ callback. > + * Internally, it unmasks the interrupt if possible. For INTx, unmasking > + * is required as the interrupt is auto-masked prior to invoking > + * callback. For MSI/MSI-X, unmasking is typically not needed as the > + * interrupt is not auto-masked. In fact, for interrupt handle types > + * VFIO_MSIX and VFIO_MSI, this function is no-op. I've added this comment in previous revision's discussion, but i'll copy it here as well. Does the user of this API even cares about these details? I would think that it would be easier to just mandate calling this function at the end of each interrupt callback, regardless of which interrupt mode is used. IMO internal details (about no-ops and such) are better explained in the implementation, not in the public-facing API header. -- Thanks, Anatoly