From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it1-f182.google.com (mail-it1-f182.google.com [209.85.166.182]) by dpdk.org (Postfix) with ESMTP id 2AD3B5B2A for ; Fri, 2 Nov 2018 05:00:53 +0100 (CET) Received: by mail-it1-f182.google.com with SMTP id i191-v6so1506387iti.5 for ; Thu, 01 Nov 2018 21:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=OzMMzuXqjRMCU/AdFbNAsbhvvusUvbn8ETXqndycUZ8=; b=Bx+3tfQJGXjzFHqHX6LCUHpsmrsH6DVtNIVO9eJXkrTUVMUGlUFtyVl5rTlbuXEuZH Pnh2B2lbWqvItu/RG3eG84gAmsaZtxXhRHiuPqQx2N8iI7dG6ht12qd89iB4a54KUYXD 2FEzKUtfC1hWl/ar1zc1nOqQVjyTi1ZkTuq5Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=OzMMzuXqjRMCU/AdFbNAsbhvvusUvbn8ETXqndycUZ8=; b=DxX1Un8k2uISpdDc+1H0eQT1IxOT1FeutFjW7NOr5MaZYezM8RDHx9//Q0/XbrBRkm i3dK8y/eSSHTeamxkAsRn3jgA6ko/8P9u3Z8f4nN8vQX0zv88RdEz8GUUaQOyLU+LrsM JxmqzPKvRsVlSGQvLA0ZfldjY60qsI0rvaWEymjvO8iJqvPzbq25rxh/aLmLeQ9Zn8BR cX00Zgu9kaTuT/78xgfbgq83pJ8usxKiURDDEX53pzH5zAF9taoFai+hDo77twW+WiMw O8wv+uKGjqqlDoSnd1Dj+ZQEec5EwNk7OlDc3XjRg7/dr1uoDp1npe4h0qVd5Qvt12J+ uD0g== X-Gm-Message-State: AGRZ1gJ9JbL2nAk0B8ntMfCc4+NCSHrqqyrY1R451QSdh7S/YA5btqpx r2aJPvTA1jntOnv4TnJJHPzhC1wUYhrW5Rgtm+BG5psB9KA= X-Google-Smtp-Source: AJdET5erCkHlKAoax1owqJK4RidDYii09Dv/28kdjEQnG0JQt3xbwd17llI243HY9Ir6XXVljhthBhBsTms/F7Xm/sw= X-Received: by 2002:a24:940f:: with SMTP id j15-v6mr32509ite.34.1541131252136; Thu, 01 Nov 2018 21:00:52 -0700 (PDT) MIME-Version: 1.0 From: Somnath Kotur Date: Fri, 2 Nov 2018 09:30:44 +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 04:00:53 -0000 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