From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it1-f178.google.com (mail-it1-f178.google.com [209.85.166.178]) by dpdk.org (Postfix) with ESMTP id EFA597CDA for ; Fri, 2 Nov 2018 07:08:21 +0100 (CET) Received: by mail-it1-f178.google.com with SMTP id e74-v6so1789397ita.2 for ; Thu, 01 Nov 2018 23:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=0cQ1je96hj/NbL7QPCYgahbLxOc3LMcjSQhPFBO5QT8=; b=Rf4JGIGH4zWeKUME9k3wBUFH3dBa4uwhtNvekd6E38ZnlmDpVQfdPEsFIS5gHU/OdK 6Ly+VPmaojSHbJ147Nh9FIuw+GaOHHj/S5vY2rTALqu0/5RJlGc0ZoERvUyoYPCU/LyX +5fLQ21IRzduxsPROhQx05r/GF6nm4JpyTi+M= 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; bh=0cQ1je96hj/NbL7QPCYgahbLxOc3LMcjSQhPFBO5QT8=; b=EB4aDzLPJ8q7XhLnphIprn7Am3BjNw9k0YIOpgfzrqim4fO145ydsC8S/wzVvtpwW4 9fFBCjjSgKCmTvGbodqcqYVroz0sD5BKgWf7bx3q15QDG+AyK6j/b7PrAZJDwXGb0PaN jfK6I/AHRc8YeT7/gt3QrR4I1vnE29Jk4ZhZXU+WVN42ur5FcEwL/jU9BLMJsIwyRaPz vnGLvRlQDfPRfMSA/kYEj0yhDMPuPLyWPEgloqn3n0JZleGrYXCynvSUcaHSZ8v5FL8j 9vx6v7/J+AEwkCrKqmunurMDcphEP/uekUGeogD9pKwqJjhiYDM/qp/9zZRZgRpUbUV8 ftKQ== X-Gm-Message-State: AGRZ1gJHekQMlBatdzdNwboRxRQkZUwjZqPAt4RAh6k5HVZK0nSF0qFq KIymTqRropeAgm5ywYsQCIjxtyf/vLm0QDuWlEdmAOqr X-Google-Smtp-Source: AJdET5cG44q9Q6Oo+33/IR065yjozX8HEWqmfGfa/E6YKHCDIpLJIA9Yxy1DB+qibwTdcpkYbZLSIpdmCa6OUXeehFI= X-Received: by 2002:a24:3a03:: with SMTP id m3-v6mr38965itm.87.1541138900675; Thu, 01 Nov 2018 23:08:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Somnath Kotur Date: Fri, 2 Nov 2018 11:38:12 +0530 Message-ID: To: dev Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] Question about rte_manage_timer() and eal_intr_handle_interrupts 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, 02 Nov 2018 06:08:22 -0000 On Fri, Nov 2, 2018 at 9:30 AM Somnath Kotur wrote: > Hello, > I'm trying to launch a thread - lcore_mainloop( from > examples/timer/main.c ) that runs rte_manage_timer() every 2s from testpmd > to ensure the timers i've registered in my driver are checked for expiry ( > i even tried putting this thread in my driver as well, no difference in > results) and i see that while this thread is running, i somehow seem to > stop getting interrupts ..infact i don't even > see eal_intr_process_interrupts () being called. > > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index ca4e1a4..a8d71d6 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -71,6 +71,8 @@ > #include > #include > #include > +#include > +#include > #include > #include > #ifdef RTE_LIBRTE_IXGBE_PMD > @@ -2524,6 +2526,30 @@ signal_handler(int signum) > } > } > > +static int > +lcore_mainloop(__attribute__((unused)) void *arg) > +{ > + uint64_t prev_tsc = 0, cur_tsc, diff_tsc; > + unsigned int lcore_id; > + > + lcore_id = rte_lcore_id(); > + printf("Starting mainloop on core %u\n", lcore_id); > + > + while (f_quit == 0) { > + cur_tsc = rte_rdtsc(); > + diff_tsc = cur_tsc - prev_tsc; > + /* Schedule every 2 seconds */ > + if (diff_tsc > rte_get_timer_hz() * 2) { > + rte_timer_manage(); > + prev_tsc = cur_tsc; > + } else > + sleep(1); > + } > + return 0; > +} > + > int > main(int argc, char** argv) > { > @@ -2627,6 +2653,7 @@ main(int argc, char** argv) > if (strlen(cmdline_filename) != 0) > cmdline_read_from_file(cmdline_filename); > > + rte_eal_remote_launch(lcore_mainloop, NULL, 3); > if (interactive == 1) { > if (auto_start) { > printf("Start automatic packet forwarding\n"); > > > My testpmd cmdline is like so: > > testpmd -c 0xff -n 3 -- -i portmask=0x3 --nb-cores=3 --rxq=1 --txq=1 > > Any idea what could be the problem ? Is this something that is expected or > am i doing something wrong ? > > Thanks > Som >