From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id B3C642BB1 for ; Tue, 18 Apr 2017 14:18:00 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id r190so12994332wme.1 for ; Tue, 18 Apr 2017 05:18:00 -0700 (PDT) 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:in-reply-to :references; bh=YN2yJps3UK9OMEYRAi/Pu7c31oz9Jmmjf78RrP86Q2k=; b=Dh6TvSVb1+/D1zee4hTAFNVhiLOvimfSdTwvVwYHQJ9lcYYoGX+HiI689y+QyQRtR8 dN0cqSVpmRhJWvm7AsiZ1K/yg3yxpE8ZfOvbDwdCFk4HW6AdMhqAJGrs8lFiJvEyx0qs vUFMvUcFZSAnZ24VCz86iCgDi/UIFzz0nVnJ3J9bwNpxXkI+BA8VCi678oPB+LZ26m2y vevnV47VGkNygDVbZvY2BpHAR2bx9eFSulgFQUVlai+CrVJ8K7pRfjmZbum5E57xyXQI wbNZBnRIjTcweLQ0bsjiey15WyrUdoiCOfYliQP5ZvymEl9Tm/+InSvKJwx+5+QtGMHe 476w== 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:in-reply-to:references; bh=YN2yJps3UK9OMEYRAi/Pu7c31oz9Jmmjf78RrP86Q2k=; b=d2IuGVRu8NCMlgUsPVtTDLSwzREoKfmS8cYTekkz9aoruflERSeXWYT5AlcCpdfqCM vcE0uPP+tiW9Q9FTOb5p/u83ELZ3hJsdsoFqagowM04Oa+RQ6CfznvQVEMW52RkhTUDX AQiCwftyx36JaPVsTe/uPH0OIvUIdBKzX3FcL35pvQKftsQ0ysacl7UIBO68B3aEcmCF N06NHsW4zLpGacGjl+Z62tf9HKx/5DEbaqgFwsOu60oxISmUo5hPmKZlnvtwnqsj6C2e yBd4GaFYki+tcHQ5Mrl13lNleT5zNxb0/o/krryJtqBWPOgxak42fCp90cVC2GXjG46S LFaQ== X-Gm-Message-State: AN3rC/7zkESaqMWx9U11Y24VfZf07mi8vm/M3eNp7ucj6gOeQUN5hByZ CS5OD6hE9xcUXrmHJrQ= X-Received: by 10.28.132.16 with SMTP id g16mr13365618wmd.87.1492517879812; Tue, 18 Apr 2017 05:17:59 -0700 (PDT) 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 u23sm4266024wmu.16.2017.04.18.05.17.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Apr 2017 05:17:58 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Date: Tue, 18 Apr 2017 14:17:41 +0200 Message-Id: <83bfe3fd6dc1f7696049bf8d8d1ef20370c92242.1492517222.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 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: Tue, 18 Apr 2017 12:18:01 -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 c36bcf8..c79c349 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -200,6 +200,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 @@ -568,6 +569,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 }, }; @@ -998,6 +1000,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 221f0e9..5f94393 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -271,6 +271,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 @@ -1746,6 +1751,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; } } @@ -1929,6 +1937,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 642796e..62f89e6 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -305,6 +305,7 @@ extern uint8_t no_flush_rx; /**