From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id 21112F8C0 for ; Fri, 3 Mar 2017 16:40:38 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id n11so18289173wma.1 for ; Fri, 03 Mar 2017 07:40:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=J08FmE9MS4kuklYnz2WxsTmaOQVPjSRK4ZB2CC5Os6U=; b=PtoB3ImI2fvUOI2iE2AWgLtHVMAdxgqzqpMDDKBbYqs79HP0SKlWOon3+6rbQQIat8 +PZUZO78ehLYbePmAIVn7gZWkHM8qQZ2laWq+HReouzaO66yj7G4aAvwDLdY1KQckK7w exa6qFRQT8cAbDHtow79pA3hKEyGmTgw/qwFGFlQJ/57OYfiZypJi32FyPqWnPdNhtW0 wsyk1FyFu0/uw8q9skiNc1X88tE9fLCe+SmoSRhjoqhEYw1SNKnyKnyyMnPKHay3qFZV 8jRfdpqLhDyhvi5VLV9fl2SXUlznBFtP4MUHrY2UzQjt14hhYVbo6AjAdGp7pkQA7uEc d9sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=J08FmE9MS4kuklYnz2WxsTmaOQVPjSRK4ZB2CC5Os6U=; b=kGbEXru8xCEFDvCypdL3sbZ7e0XP+S6oPuz7D65sHxgJ9PdaQysL1Vaj+zavcrfihm dgydwm2ZllEAsevHPM1vmihwtXIgJZD5VoFbFDAWmWv863AoNJGuipahcJc3d8Jua4OV Ffj4NNdjxAtSCuEJIf+qxR7BC+UoRVwtD3XKBeK6xyA2ccXCZ/3Q3vlivOQSPMWvHREr MC0mqDNYbrDB+CPa6Wwk+GNs63vucWoIvHYHorMD79B1CaFew+R6owAeDoV5s5osjSgz O6T10N3Mi5+zhm3pHJ5RIE1rRoqX41eKQvUSFVwVjLJ5eqSKIZILUgr2LxxPQykPZMSe 7dcg== X-Gm-Message-State: AMke39n+3W8Omycj1pUHP/5IkQDaip7e+qd28yP9eEssVWzN0n9BiE//V/r7gXpJgcuMSgbg X-Received: by 10.28.137.208 with SMTP id l199mr3458351wmd.65.1488555637680; Fri, 03 Mar 2017 07:40:37 -0800 (PST) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id i15sm3486899wmf.21.2017.03.03.07.40.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Mar 2017 07:40:37 -0800 (PST) From: Gaetan Rivet To: dev@dpdk.org Date: Fri, 3 Mar 2017 16:40:22 +0100 Message-Id: <86771d40d43a0c31423c184b6a368315954e5029.1488550971.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH 4/5] app/testpmd: request link status interrupt 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, 03 Mar 2017 15:40:38 -0000 For drivers supporting the LSC event, enable it. This allows to test LSC event support. Add the --no-lsc-interrupt parameter to explicitly disable the link status change interrupt. Signed-off-by: Gaetan Rivet --- app/test-pmd/parameters.c | 4 ++++ app/test-pmd/testpmd.c | 13 +++++++++++++ app/test-pmd/testpmd.h | 1 + 3 files changed, 18 insertions(+) diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 67d8bf2..89231be 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -196,6 +196,7 @@ usage(char* progname) " or total packet length.\n"); printf(" --disable-link-check: disable check on link status when " "starting/stopping ports.\n"); + printf(" --no-lsc-interrupt: disable link status change interrupt.\n"); } #ifdef RTE_LIBRTE_CMDLINE @@ -561,6 +562,7 @@ launch_args_parse(int argc, char** argv) { "no-flush-rx", 0, 0, 0 }, { "txpkts", 1, 0, 0 }, { "disable-link-check", 0, 0, 0 }, + { "no-lsc-interrupt", 0, 0, 0 }, { 0, 0, 0, 0 }, }; @@ -978,6 +980,8 @@ launch_args_parse(int argc, char** argv) no_flush_rx = 1; if (!strcmp(lgopts[opt_idx].name, "disable-link-check")) no_link_check = 1; + if (!strcmp(lgopts[opt_idx].name, "no-lsc-interrupt")) + lsc_interrupt = 0; break; case 'h': diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index f2b67d5..8bd1285 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -263,6 +263,11 @@ uint8_t no_flush_rx = 0; /* flush by default */ uint8_t no_link_check = 0; /* check by default */ /* + * Enable link status change notification + */ +uint8_t lsc_interrupt = 1; /* enabled by default */ + +/* * NIC bypass mode configuration options. */ #ifdef RTE_NIC_BYPASS @@ -1698,6 +1703,9 @@ check_all_ports_link_status(uint32_t port_mask) if (all_ports_up == 1 || count == (MAX_CHECK_TIME - 1)) { print_flag = 1; } + + if (lsc_interrupt) + break; } } @@ -1892,6 +1900,11 @@ init_port_config(void) #ifdef RTE_NIC_BYPASS rte_eth_dev_bypass_init(pid); #endif + + if (lsc_interrupt && + (rte_eth_devices[pid].data->dev_flags & + RTE_ETH_DEV_INTR_LSC)) + port->dev_conf.intr_conf.lsc = 1; } } diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index e1e4939..77fa7ee 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -305,6 +305,7 @@ extern uint8_t no_flush_rx; /**