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 3FFE7A056D for ; Thu, 12 Mar 2020 18:21:01 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C3F1D1C014; Thu, 12 Mar 2020 18:20:59 +0100 (CET) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id 4B82D1BFC9 for ; Thu, 12 Mar 2020 18:20:57 +0100 (CET) Received: by mail-pf1-f195.google.com with SMTP id n7so3596084pfn.0 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=lhXzJjs18ofsqlvZCrB5DqHqHPJbxs7k++1hh/omBWSwFSN9KfDH5Jz9DcUefKuPTO 5cPmTjsm3Ql7XQ+dIEJTAL3JXYcz/jR77QVWZKDdnvEnV7gmIvMeUYTb9ieGYAo04Js6 6TeZemS+pq7OyqSG1hCA3T2PZelJ+44DZTyp+zwjdsm5va1nNJgAO63IcbMASSDrVPcE PY4DcHaNBoMkpK4/jWbFYAGIB0l9TZCM5dKdxcpbVwIoDmrs4j0NyumTga0tsyiWdSSl fSIx++6FUoYTpPEE0sf/f5DczS9x5PTzcRbCkjt5JT6kT2w6MKZOoUce28WWY44nD0ON C92w== X-Gm-Message-State: ANhLgQ2jZMLN4box3wwI6LkSCNXjJ5wFnSEery4xAKGvvx+W80/M2TJk WUcleVjYbJV7wego0Pu2nXsPduyZqWw= 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-stable] [PATCH 2/7] examples/l2fwd-cat: block attempts to use owned ports X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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