From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id AB03793FC for ; Fri, 30 Oct 2015 19:57:46 +0100 (CET) Received: by wmff134 with SMTP id f134so18799512wmf.0 for ; Fri, 30 Oct 2015 11:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JsEWsZQ4w90tyoJHEyD7PC8aiA2OoBhIWwPIJ88yRDk=; b=Xz/5PwIg83azOcR7t0PeUP/wwW+8448lLYNk+ZWZZBNczxAphG18JDYVNeH212cIAN RIbWWFnWYmAFkQfKgJWF1PraxOl64a3cNAFhVdWJUCJgU/e3Ofd/fG5c6gtvXB2MmFuf tIjlve3EzSBzy72oHRpSUEdZ9Xx3NC5EHVrUjjuZDeStpuYRSffSnEHFQTXslBeDJPYM wm5QFalJVXQfLKvdQC9UZZIK2oVnmEz/1HW9ozRt86SLLHS4VxqmjPw+nq1CKLfgGmUh QFT4ps8sS+bbbFQytgQdeVQ8qmt0DqklF/uyZJWUa1Lrdtz8+VqUkHfetEQnu/OzPimG JbTQ== 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=UiCh3CZ9dYhkmF6Fq7bp7QklJxEnu2ZSpOnvLHpgmA2Q7+TPacuCBvY5vtRjmABJwX Xnh3CZYd0DRkMUOZDoH4RUfSjNKIODURHSXAk5hMVX+YMxqr8VbR0VCdsUtB2UXm49gQ fs0LZeMcMbZFntuAoyn88yrCRGW+FocvjkI+B6Rj02dHYG2JUdtGruS4wgVubcLzngVQ fpZAN6g4ODvigf2R7/xQp5ZgLW6SNCPrJTWhmAO8W5BAawsjt0LrUgEMo2risdzvLOKH yt2G9PNE5molvHrc9dlFY3BJmkvduAnGNfDGPF7+ShYp8W8L40nMZvNclIdryKoff2gs DMqA== X-Gm-Message-State: ALoCoQngJ1gYTGsw+aUxCtBPe+1zPZQ6976y5/0SmwlrNDa/bGWLqHWUXvTW1W89g5zrD8WBUeE/ X-Received: by 10.28.21.17 with SMTP id 17mr5341395wmv.82.1446231466549; Fri, 30 Oct 2015 11:57:46 -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 z4sm8380160wjz.29.2015.10.30.11.57.45 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 30 Oct 2015 11:57:45 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Fri, 30 Oct 2015 19:57:21 +0100 Message-Id: <1446231443-8285-2-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1446231443-8285-1-git-send-email-adrien.mazarguil@6wind.com> References: <1444067795-29748-1-git-send-email-adrien.mazarguil@6wind.com> <1446231443-8285-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH v2 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: Fri, 30 Oct 2015 18:57:46 -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