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 4242BA056D; Thu, 12 Mar 2020 18:22:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 886751C0AB; Thu, 12 Mar 2020 18:21:07 +0100 (CET) Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by dpdk.org (Postfix) with ESMTP id 043881C066 for ; Thu, 12 Mar 2020 18:21:04 +0100 (CET) Received: by mail-pj1-f67.google.com with SMTP id mq3so2930576pjb.0 for ; Thu, 12 Mar 2020 10:21:03 -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=Ge4blt7351q3kY/MQA5F1nD+Om5sRlhumnyhz6o/IrQ=; b=F6SbVjofpu/QF81pwufLUJgxsghL9GdXmFmIMAmShXbbpFzDY+J9EHTfn90iaYZhuz lDHuq8VsXQKeBjT8B8n4EgRnj8iubKptcDD91xa5j/iAlHUbYLLPdnV9XCx/GAlOeFqM cITckFa3XVUwfFkjMrFlxy5d3skJSb/qGPszHlH97an352PVShKNNHwFDACnAeV5P5pl I27Rs6w7qr0uu/86ailRR7YLesEjaFtWzjwEBRBujToiCOrFinaB2DgmZShcuSI9vwNB uNmDHrsiTTFOYWmV4Qle2IBL0tRoXKbk8wm7GTOqwoYnwv9jvb01pyq+F3jFw9g0XrVf Ax/A== 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=Ge4blt7351q3kY/MQA5F1nD+Om5sRlhumnyhz6o/IrQ=; b=rWwh+l/eV4FVF0QMYW8fY4CPpP+VnC/HofDl0tLuBYMui09XSBz0xIZcQUs9dZii2Z jyszuufIuRBFMXSdBGERrVXnifqcg6tFLEC2weNnHNhApJTBhWiMmrzhsh/fNLPwiTkb s4GsE95JhcICiqeY0t2KtXkOT4zS/JK5pX2LOKQBowqPEix2RP3VNKDluxfV28is6qlw WO7nS/iThMCBPRafBtSdMOSgmRlIUe0/uLvz3cGKXt9xFbkWuo8dmdhNFLb1WHbhNi7B 19wPbKWswXYtLBBl+DxdHEuk+wJ5wURmXOZtYfOG/HirU5Bi+YvPcDEqDoaY2qdxlJ9G Q0ow== X-Gm-Message-State: ANhLgQ03Gerfirgr00mYlx84ZoXT+ueF/RbUzwToDDn5bumK08ClzbtK vaGj7T1kYxO3gpi4jQNWTqVFCrQYFLU= X-Google-Smtp-Source: ADFU+vu5RZ2mHUoapnJ4jrG81udjY1L1DAzpapeE1JgPXlM7nrc79xeKM7PeRd/nwnpP1sdnXYEpBA== X-Received: by 2002:a17:90a:c301:: with SMTP id g1mr4989829pjt.88.1584033662644; Thu, 12 Mar 2020 10:21:02 -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 v1sm9447511pjy.35.2020.03.12.10.21.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 10:21:01 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , matan@mellanox.com, stable@dpdk.org Date: Thu, 12 Mar 2020 10:20:46 -0700 Message-Id: <20200312172047.19973-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200312172047.19973-1-stephen@networkplumber.org> References: <20200312172047.19973-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 6/7] 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..928cd226d25a 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_by(portid, RTE_ETH_DEV_NO_OWNER)) { 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