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 89C72A0559 for ; Mon, 16 Mar 2020 17:09:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6A8F01C0B7; Mon, 16 Mar 2020 17:09:37 +0100 (CET) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by dpdk.org (Postfix) with ESMTP id 407121C07B for ; Mon, 16 Mar 2020 17:09:35 +0100 (CET) Received: by mail-pj1-f44.google.com with SMTP id ca13so8961916pjb.2 for ; Mon, 16 Mar 2020 09:09:35 -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=f+MbdW/FtJHj8vDiIFxI4P8Rzfgur6Lyr/rXrmSd1WE=; b=r3cx85r74XFMOqfp30/3RNnxO2+wx545K0Ae4Zvbyj2hRujbGjOJDsmt0BfDcEXIDR sYXCJLgN/dhYyGLjPDEBZuLG+4S1L6fCAxxvZ6qdaQoMQj8S+esLp5C9/BBWNklcklzi 6yk5m2V8Bkr45joqa7KGvBI3suBOCO1O9QKJRNRq7macM+9A0R1uUeq4DgMIieOeRdvy UupJNxT2+kbCEpkCCuWjHeAld0rqst6x+Ycpso0mUHnSMjAyiYHZy5e2zNOKYNygH7+D uuXoplzblkHDjtwz+pmS23U9YbRbmkPV83gqHpOwKCYg8bp5Yhj/eRVPlhNmJOpWhwxd DW9g== 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=f+MbdW/FtJHj8vDiIFxI4P8Rzfgur6Lyr/rXrmSd1WE=; b=TmGTaOnaKRZ0gs1aukHHUzwolkVrR74wtv1AcyAz2MZPuHH67nRI1J4HWfF0bbZ/+V gIIK7aqnoa8oK2yFSimeEi9sdvBsBvZpgMKmGjEfHSYS2jxwB+c3bAyF7O930UYHcD+j qVK3OwyJ22+trhLAQ1eR3KtoT8qxqZANA+J+dsW3P8cqf3bdg8ckSJIhJBAlgJLMcPCx 7Tz0WDkkWnkAcDiu+wZXLhN2VMohHOhwhsmeGT1r8VA9m9WrllWigRAZTdFxB5sYfpnZ O3Hfgh5q+k5hKMByqviE5ltf/RZyfKcyJ/x+92t/dTYOM843HCP+7KAQWwCSrKAMRkR5 Pdng== X-Gm-Message-State: ANhLgQ1nFL7i4xIicE1ZjHI3wd2lQqRpVi0FKYaforYFYF3lSN2HCe75 r68vzrA2KC5yvCFXvVVNsNCQNA4rHS0= X-Google-Smtp-Source: ADFU+vuy4d/Q8Eb5nIylnisotbNgL9gnVpWO9zxmqOX/uVAnD/54aZmK/ivAAg4vC2VUJbVLTF+19g== X-Received: by 2002:a17:902:4b:: with SMTP id 69mr15199752pla.97.1584374974422; Mon, 16 Mar 2020 09:09:34 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 09:09:33 -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:19 -0700 Message-Id: <20200316160923.5335-3-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-stable] [PATCH v2 2/6] 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..e89b3568bc86 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(portid)) + 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