From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by dpdk.org (Postfix) with ESMTP id 674A29368 for ; Mon, 5 Oct 2015 19:56:55 +0200 (CEST) Received: by wiclk2 with SMTP id lk2so126068023wic.1 for ; Mon, 05 Oct 2015 10:56:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JsEWsZQ4w90tyoJHEyD7PC8aiA2OoBhIWwPIJ88yRDk=; b=BXO56DJXM2gvixR5IZYE15zwJgD6C9gfD6TDU/YEaN+nyqvPzVJNjoSo4dUNqHrHRB bWljHnFWSJ07yqfqISuHn/4ZSwS1OwU4vl0hKsukvr5Dr5CE0yRy8VimixtrQnn//vBM Yykf6LpzerMSL05wloxLIhTbCr93ushTBZYSfBzzLLySxnCEFWGUu92WJgQe6n1chjzS ufE0gp5ez8UFNSnRBPqTnXrYocIRXWuzkiJOAyMYruwgSfPR4P7WTzRxFBWeOfdsIX/+ z94095vVuXFFrXc/+X0//9vocOU3d+1PC2+SnCQB8dRu3N8+mJt0zBDsxmef//YYF8fd zFuA== X-Gm-Message-State: ALoCoQlpyy298KI3gSS/D2jfS4dDvtuDZS0NRgE+H8mDKnyskWsUiz5mMrV8cH6CT11BNrPNWtGx X-Received: by 10.180.75.38 with SMTP id z6mr11931533wiv.36.1444067814980; Mon, 05 Oct 2015 10:56:54 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id jj8sm15858017wid.2.2015.10.05.10.56.54 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 05 Oct 2015 10:56:54 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Mon, 5 Oct 2015 19:56:33 +0200 Message-Id: <1444067795-29748-2-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1444067795-29748-1-git-send-email-adrien.mazarguil@6wind.com> References: <1444067795-29748-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH 1/3] eal: new interrupt handler type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2015 17:56:55 -0000 From: Nelio Laranjeiro Add RTE_INTR_HANDLE_EXT handler type for PMDs that do not support VFIO or UIO. Those are expected to manage the file descriptor themselves. Signed-off-by: Nelio Laranjeiro --- lib/librte_eal/linuxapp/eal/eal_interrupts.c | 34 ++++++++++++---------- .../linuxapp/eal/include/exec-env/rte_interrupts.h | 1 + 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c index 078318c..79eedaf 100644 --- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c +++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c @@ -691,26 +691,30 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds) bytes_read = sizeof(buf.vfio_intr_count); break; #endif + case RTE_INTR_HANDLE_EXT: default: bytes_read = 1; break; } - /** - * read out to clear the ready-to-be-read flag - * for epoll_wait. - */ - bytes_read = read(events[n].data.fd, &buf, bytes_read); - if (bytes_read < 0) { - if (errno == EINTR || errno == EWOULDBLOCK) - continue; - - RTE_LOG(ERR, EAL, "Error reading from file " - "descriptor %d: %s\n", events[n].data.fd, - strerror(errno)); - } else if (bytes_read == 0) - RTE_LOG(ERR, EAL, "Read nothing from file " - "descriptor %d\n", events[n].data.fd); + if (src->intr_handle.type != RTE_INTR_HANDLE_EXT) { + /** + * read out to clear the ready-to-be-read flag + * for epoll_wait. + */ + bytes_read = read(events[n].data.fd, &buf, bytes_read); + if (bytes_read < 0) { + if (errno == EINTR || errno == EWOULDBLOCK) + continue; + + RTE_LOG(ERR, EAL, "Error reading from file " + "descriptor %d: %s\n", + events[n].data.fd, + strerror(errno)); + } else if (bytes_read == 0) + RTE_LOG(ERR, EAL, "Read nothing from file " + "descriptor %d\n", events[n].data.fd); + } /* grab a lock, again to call callbacks and update status. */ rte_spinlock_lock(&intr_lock); diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h index 45071b7..b095b86 100644 --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h @@ -48,6 +48,7 @@ enum rte_intr_handle_type { RTE_INTR_HANDLE_VFIO_MSI, /**< vfio device handle (MSI) */ RTE_INTR_HANDLE_VFIO_MSIX, /**< vfio device handle (MSIX) */ RTE_INTR_HANDLE_ALARM, /**< alarm handle */ + RTE_INTR_HANDLE_EXT, /**< external handler */ RTE_INTR_HANDLE_MAX }; -- 2.1.0