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 B64A1A056D; Thu, 12 Mar 2020 18:21:21 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E8D741C020; Thu, 12 Mar 2020 18:20:59 +0100 (CET) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id CC50A1BFC9 for ; Thu, 12 Mar 2020 18:20:57 +0100 (CET) Received: by mail-pf1-f194.google.com with SMTP id 2so3564863pfg.12 for ; Thu, 12 Mar 2020 10:20:57 -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=U7e/5Y/lTfLIR9b/60JddEwk2/u+doTPe+XZD609+BU=; b=WLDPSGs7DrqdYahb63xLoqm6msI/qo5kCqy4kFJBB130m6PhAmU8fOE9COz8AyPRdt FsddlXB7/h74QsePAjB6k7FD1Xa/Xtq/zMMUbbryhuQA1K14cTctFUztTLmZZKUSyP46 GnSAQMAOwdKrcG1Qd3A68K+DnWFuzHzRkQ8RmnPurmu0Z4o8oJiIj7ou916A00UTBnAO V1Czu1p0/sAsuZmE57DtMJtZ8of5YiET9zVNrenJLnaxjEfOi7/Jo+u64RgcWnly0rOM tJDRm3jsV3GIkprl76ha078a1xRd3ooTkmfokZbBCYGa6o0nqUvW9mIVpWIOgc/R/Plv ORcw== 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=U7e/5Y/lTfLIR9b/60JddEwk2/u+doTPe+XZD609+BU=; b=n3isiyAhx5bpJxqC7cnW8WhYL2ruHlVyRuN46ehUQPEn6z8iq9656IAKUzM1nnMQSq 4M/vG+/tRut+TjezNDQzZxKOWM25BZt0Y9iwH7vuq3wS1zN3Gw326Kfik0nhOmrr4QGG mG3iE9Ra1uhhSoOGjRByjGHO4C/F3wPYzQqwN4bVUlARaq70NBulhED6JxTE/AlZ5eMz l9C+qKykXhGkBsZJDq7ILTckaR2pg118MkZnaoEbA49m5c2kqTCufAMuXTPBv4o6r1HX 723gj5H/jGkV4sKCiPY/x/TDoLCDnx7G0zrIJSPX6lXlRORFHgKl2eUHL6NFoI+8FuWV oqzg== X-Gm-Message-State: ANhLgQ2fM9GfYbOz4PHuWQBMMMDU/2lGOwob8Yk0MxI3e7kfjV1p4DTH AadHmvJdlcVp6NMhF+NKVOEvgme27GU= X-Google-Smtp-Source: ADFU+vvhJSzV2VH+cAIF9/qyAUG8j2P8PZGZyeLTLcz++tigyzJlItCBSWkrbxWvKfllp4BAkOD4FQ== X-Received: by 2002:a62:bd14:: with SMTP id a20mr2253575pff.86.1584033656452; Thu, 12 Mar 2020 10:20:56 -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.20.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 10:20:55 -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:42 -0700 Message-Id: <20200312172047.19973-3-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 2/7] examples/l2fwd-cat: 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/l2fwd-cat/Makefile | 2 ++ examples/l2fwd-cat/l2fwd-cat.c | 3 +++ examples/l2fwd-cat/meson.build | 1 + 3 files changed, 6 insertions(+) diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile index b0e53c37e8d8..aa19347c1545 100644 --- a/examples/l2fwd-cat/Makefile +++ b/examples/l2fwd-cat/Makefile @@ -20,6 +20,7 @@ static: build/$(APP)-static PKGCONF ?= pkg-config PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) @@ -65,6 +66,7 @@ endif EXTRA_CFLAGS += -O3 -g -Wfatal-errors +CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -I$(PQOS_INSTALL_PATH)/../include LDLIBS += -L$(PQOS_INSTALL_PATH) diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c index 6838f288c621..c1c59b2d81f2 100644 --- a/examples/l2fwd-cat/l2fwd-cat.c +++ b/examples/l2fwd-cat/l2fwd-cat.c @@ -42,6 +42,9 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) if (!rte_eth_dev_is_valid_port(port)) return -1; + if (!rte_eth_dev_is_owned_by(portid, RTE_ETH_DEV_NO_OWNER)) { + return -1; + /* Configure the Ethernet device. */ retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval != 0) diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build index 4e2777a03358..5c062c1354e3 100644 --- a/examples/l2fwd-cat/meson.build +++ b/examples/l2fwd-cat/meson.build @@ -6,6 +6,7 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' +allow_experimental_apis = true pqos = cc.find_library('pqos', required: false) build = pqos.found() ext_deps += pqos -- 2.20.1