From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 6D58B1D631 for ; Fri, 15 Jun 2018 16:25:13 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jun 2018 07:25:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,227,1526367600"; d="scan'208";a="64867030" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 15 Jun 2018 07:25:09 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w5FEP9eH028188; Fri, 15 Jun 2018 15:25:09 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w5FEP9eV019475; Fri, 15 Jun 2018 15:25:09 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w5FEP9Qm019471; Fri, 15 Jun 2018 15:25:09 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: Jianfeng Tan , konstantin.ananyev@intel.com, thomas@monjalon.net, bruce.richardson@intel.com Date: Fri, 15 Jun 2018 15:25:05 +0100 Message-Id: <48d3d56fde9f0d20d9baf8f260873d0198e7cd70.1529071026.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 5/8] eal: add IPC type for interrupt thread 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: , X-List-Received-Date: Fri, 15 Jun 2018 14:25:14 -0000 From: Jianfeng Tan We are going to merge IPC into interrupt thread. This patch adds IPC type for interrupt thread. Signed-off-by: Jianfeng Tan Signed-off-by: Anatoly Burakov --- Notes: RFC->RFCv2: - Fixed typo in test app .../common/include/rte_eal_interrupts.h | 1 + lib/librte_eal/linuxapp/eal/eal_interrupts.c | 5 ++++ test/test/test_interrupts.c | 29 ++++++++++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/include/rte_eal_interrupts.h b/lib/librte_eal/common/include/rte_eal_interrupts.h index 6eb493271..344db768d 100644 --- a/lib/librte_eal/common/include/rte_eal_interrupts.h +++ b/lib/librte_eal/common/include/rte_eal_interrupts.h @@ -35,6 +35,7 @@ enum rte_intr_handle_type { RTE_INTR_HANDLE_EXT, /**< external handler */ RTE_INTR_HANDLE_VDEV, /**< virtual device */ RTE_INTR_HANDLE_DEV_EVENT, /**< device event handle */ + RTE_INTR_HANDLE_IPC, /**< IPC event handle */ RTE_INTR_HANDLE_MAX /**< count of elements */ }; diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c index 180c0378a..390672739 100644 --- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c +++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c @@ -560,6 +560,8 @@ rte_intr_enable(const struct rte_intr_handle *intr_handle) /* not used at this moment */ case RTE_INTR_HANDLE_DEV_EVENT: return -1; + case RTE_INTR_HANDLE_IPC: + return -1; /* unknown handle type */ default: RTE_LOG(ERR, EAL, @@ -610,6 +612,8 @@ rte_intr_disable(const struct rte_intr_handle *intr_handle) /* not used at this moment */ case RTE_INTR_HANDLE_DEV_EVENT: return -1; + case RTE_INTR_HANDLE_IPC: + return -1; /* unknown handle type */ default: RTE_LOG(ERR, EAL, @@ -679,6 +683,7 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds) call = true; break; case RTE_INTR_HANDLE_DEV_EVENT: + case RTE_INTR_HANDLE_IPC: bytes_read = 0; call = true; break; diff --git a/test/test/test_interrupts.c b/test/test/test_interrupts.c index dc19175d3..fa18ddf75 100644 --- a/test/test/test_interrupts.c +++ b/test/test/test_interrupts.c @@ -21,6 +21,7 @@ enum test_interrupt_handle_type { TEST_INTERRUPT_HANDLE_VALID_UIO, TEST_INTERRUPT_HANDLE_VALID_ALARM, TEST_INTERRUPT_HANDLE_VALID_DEV_EVENT, + TEST_INTERRUPT_HANDLE_VALID_IPC, TEST_INTERRUPT_HANDLE_CASE1, TEST_INTERRUPT_HANDLE_MAX }; @@ -85,6 +86,10 @@ test_interrupt_init(void) intr_handles[TEST_INTERRUPT_HANDLE_VALID_DEV_EVENT].type = RTE_INTR_HANDLE_DEV_EVENT; + intr_handles[TEST_INTERRUPT_HANDLE_VALID_IPC].fd = pfds.readfd; + intr_handles[TEST_INTERRUPT_HANDLE_VALID_IPC].type = + RTE_INTR_HANDLE_IPC; + intr_handles[TEST_INTERRUPT_HANDLE_CASE1].fd = pfds.writefd; intr_handles[TEST_INTERRUPT_HANDLE_CASE1].type = RTE_INTR_HANDLE_UIO; @@ -263,6 +268,14 @@ test_interrupt_enable(void) return -1; } + /* check with specific valid intr_handle */ + test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID_IPC]; + if (rte_intr_enable(&test_intr_handle) == 0) { + printf("unexpectedly enable a specific intr_handle " + "successfully\n"); + return -1; + } + /* check with valid handler and its type */ test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_CASE1]; if (rte_intr_enable(&test_intr_handle) < 0) { @@ -327,6 +340,14 @@ test_interrupt_disable(void) return -1; } + /* check with specific valid intr_handle */ + test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID_IPC]; + if (rte_intr_disable(&test_intr_handle) == 0) { + printf("unexpectedly disable a specific intr_handle " + "successfully\n"); + return -1; + } + /* check with valid handler and its type */ test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_CASE1]; if (rte_intr_disable(&test_intr_handle) < 0) { @@ -424,7 +445,7 @@ test_interrupt(void) printf("Check valid alarm interrupt full path\n"); if (test_interrupt_full_path_check( - TEST_INTERRUPT_HANDLE_VALID_DEV_EVENT) < 0) { + TEST_INTERRUPT_HANDLE_VALID_IPC) < 0) { printf("failure occurred during checking valid alarm " "interrupt full path\n"); goto out; @@ -548,6 +569,12 @@ test_interrupt(void) rte_intr_callback_unregister(&test_intr_handle, test_interrupt_callback_1, (void *)-1); + test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID_IPC]; + rte_intr_callback_unregister(&test_intr_handle, + test_interrupt_callback, (void *)-1); + rte_intr_callback_unregister(&test_intr_handle, + test_interrupt_callback_1, (void *)-1); + rte_delay_ms(2 * TEST_INTERRUPT_CHECK_INTERVAL); /* deinit */ test_interrupt_deinit(); -- 2.17.1