From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5B89DA0559; Mon, 16 Mar 2020 17:10:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CAC531C10F; Mon, 16 Mar 2020 17:09:46 +0100 (CET) Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by dpdk.org (Postfix) with ESMTP id CF9D71C0CF for ; Mon, 16 Mar 2020 17:09:42 +0100 (CET) Received: by mail-pj1-f68.google.com with SMTP id o23so2841369pjp.0 for ; Mon, 16 Mar 2020 09:09:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XYfNI96F6gHQpFsgkLxPWY5bFlXABCzGNODbwuRb38w=; b=hU5gf3L4BIp0wz6BI2CtKd92J7gb9oiqOW/Hol43PqqHFkDUkxRAP3mFIYdIbNJbXl rraT3b7CzjEU81l6bjmHoB4Vb1Eb3tcG6rfXjCToUo62sBPaFHJFqXb/4RDFdVR6sJlK cR4A0mcfEvZZj4NO5uS8MIDwar/bqwT2BI38acGFEyqVGm2OjMCtfNKsJhHGz4KQMrLt rsNTcr+n+Fjpi7bxGHKOBwVuLuuXQhnFiJkytG2qWSRNrP6h8EuW/s212oA/CXiT5B// pBm0gaKghe+GQR2ju79bSiEprlPWVwqhEPuZKPg1eVcrDs5cFHG8LxOM4JTdEHUJFSVW wjSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XYfNI96F6gHQpFsgkLxPWY5bFlXABCzGNODbwuRb38w=; b=tDNPv1dc6oAhz4plTXS9wfDjNPloqOOV/GWa/s2qnva6lXqIpzNTzvFs5Ki7qacGed Utd1D67/xUv+dilpbAuFjmARR3+w0geHv+xl+sX4qO8BAiobeNLD+qtKTFvwRrHd6Dk4 qBr9vtVDDoZJcRN9PCFyhcILO0jFaEkf7oe5CuTFVuwKF+ypVrt+ZdjLoTZzdAuO3Hnr 1RqYEGleoCw5zo7Mtb4BoKYZ8ZelVv7m47Cimx0gFTiRkwKgkTkjqjShithkZbHaXWKS XSITPxtjRo4qFV0UpcF8arqF7hWROyHQ1m/DMuQLEwflJYB8TQDqcSKjAMd9gHj96haa F3Gw== X-Gm-Message-State: ANhLgQ1Qpu5KCF2ZpXfdaLPMrQGeCfaQezOmmN4xAG37rJU6HcIfB/9P +ulMMKD0pY0QtPk4mqYLXr3xKjQXJxE= X-Google-Smtp-Source: ADFU+vtCz05rstY91lz4960JYgQprLZpIWqXXjksLw5awHKz5WuGheAQr31L9C3eWL4A3fcOoZExpQ== X-Received: by 2002:a17:902:169:: with SMTP id 96mr15511053plb.140.1584374981098; Mon, 16 Mar 2020 09:09:41 -0700 (PDT) Received: from hermes.corp.microsoft.com (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id w17sm361952pfi.59.2020.03.16.09.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 09:09:40 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , matan@mellanox.com, stable@dpdk.org Date: Mon, 16 Mar 2020 09:09:23 -0700 Message-Id: <20200316160923.5335-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200316160923.5335-1-stephen@networkplumber.org> References: <20200312172047.19973-1-stephen@networkplumber.org> <20200316160923.5335-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 6/6] examples/tep_termination: block attempts to use owned ports 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If a ethdev port is in use for a sub device, then it should not be allowed in the portmask of application. Fixes: 5b7ba31148a8 ("ethdev: add port ownership") Cc: matan@mellanox.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- examples/tep_termination/Makefile | 2 ++ examples/tep_termination/main.c | 2 +- examples/tep_termination/meson.build | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile index 645112498d33..f55331fb24c2 100644 --- a/examples/tep_termination/Makefile +++ b/examples/tep_termination/Makefile @@ -26,6 +26,7 @@ CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) +CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -Wno-deprecated-declarations build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build @@ -61,6 +62,7 @@ endif CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -Wno-deprecated-declarations +CFLAGS += -DALLOW_EXPERIMENTAL_API include $(RTE_SDK)/mk/rte.extapp.mk endif diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c index ab956ad7ce96..96c2d934cd09 100644 --- a/examples/tep_termination/main.c +++ b/examples/tep_termination/main.c @@ -507,7 +507,7 @@ check_ports_num(unsigned max_nb_ports) } for (portid = 0; portid < nb_ports; portid++) { - if (!rte_eth_dev_is_valid_port(ports[portid])) { + if (rte_eth_dev_is_owned(portid) != 0) { RTE_LOG(INFO, VHOST_PORT, "\nSpecified port ID(%u) is not valid\n", ports[portid]); diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build index f65d689802a3..ddadf1c2aede 100644 --- a/examples/tep_termination/meson.build +++ b/examples/tep_termination/meson.build @@ -9,6 +9,7 @@ if not is_linux build = false endif +allow_experimental_apis = true deps += ['hash', 'vhost'] cflags += '-Wno-deprecated-declarations' sources = files( -- 2.20.1