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 30957A056D; Thu, 12 Mar 2020 18:21:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CCAB71C06A; Thu, 12 Mar 2020 18:21:04 +0100 (CET) Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by dpdk.org (Postfix) with ESMTP id 0532F1C029 for ; Thu, 12 Mar 2020 18:21:01 +0100 (CET) Received: by mail-pj1-f66.google.com with SMTP id mj6so2675715pjb.5 for ; Thu, 12 Mar 2020 10:21:00 -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=A0RlVzqxRogxunr7e0lWuxuL/H7L9Lu2gzHgdRoemtM=; b=zO9u+dTAFbRuG0uhtCjQa4JeYKTng0I1juKrHrRM4z9qjTaNbZ7YI+TXUvpyspdbWz O+MEm7JQgSvJfssskbD7AjmcWUzR52iWcVk33Ylf2GQuC3TDgwzo/iq7xEhJkaV1jN0P N/Y3T0Lmvfz2+inF0IqnghHFIwrmWFGloriF7YIsAVkADWRO1ICti8qZmgKqoIJtqW3F MfIpnGUxGfj1meDZ/XNotjJ5uVNkOIemRAw/LSscBubPKqK3Ms4UuQF4iRBgIJizL61i KIT6j4NlnMRPlodY1CgkQKQSHvVnzycNBd8+orhqotDVztqq1ZFJ4r+ykJICV5L0s9e8 SHtA== 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=A0RlVzqxRogxunr7e0lWuxuL/H7L9Lu2gzHgdRoemtM=; b=h3V3KkY8mxR6aolXppiFcTFzZnSCdqLNAh6MYjZzpSGO14KropZp4uZUGUU0eZaQEi Oq+z8b+5Mwb4IPMHcc39zDYRm+5zATEe/WIqAhU+jhMinv3VLe2YzUETRe84JGViVxRF yg9RGu19Q8PTLWIFuFC3F0LXQFr81FerZOn/grh3rcUR6hSFeDxzATfj0T0Z2SaiIzi4 k2srPelUeXqk+DqakUiKp24NqsfVPnv2XxMxeyE2LfR+ngOkMhCtyZ6b1Y+Z/pqBFp+/ HR0xt9pVQWR9tRCKijcDyj4QkdvpdbemFbdGc4Bn1PZrS7eNAIn+uDR6b3nl6ersXS2i rqhw== X-Gm-Message-State: ANhLgQ0QGjbmG6+0lk2cdnF2K55zxhhVEy/6C3QlFQpDqtaz55In0W9c Mkwybu0kHIT7IlrI3DGg5ip0pMAsvRg= X-Google-Smtp-Source: ADFU+vtwxuppTAhly+DzWE2xqOrTCPBqvc1u0pvzs3BsQQC/QgmRS/6IXB9q4/leQbKdqQaT+HAfZA== X-Received: by 2002:a17:90b:4c83:: with SMTP id my3mr5252342pjb.142.1584033659640; Thu, 12 Mar 2020 10:20:59 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 10:20:58 -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:44 -0700 Message-Id: <20200312172047.19973-5-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 4/7] examples/l3fwd-acl: 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/l3fwd-acl/Makefile | 3 +++ examples/l3fwd-acl/main.c | 4 ++++ examples/l3fwd-acl/meson.build | 1 + 3 files changed, 8 insertions(+) diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile index d9909584b1c6..ff14b4fdd593 100644 --- a/examples/l3fwd-acl/Makefile +++ b/examples/l3fwd-acl/Makefile @@ -20,7 +20,9 @@ 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) @@ -51,6 +53,7 @@ include $(RTE_SDK)/mk/rte.vars.mk CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API # workaround for a gcc bug with noreturn attribute # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index fa92a2829740..695121bb7bb5 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -1470,6 +1470,10 @@ check_port_config(void) printf("port %u is not present on the board\n", portid); return -1; } + if (!rte_eth_dev_is_owned_by(portid, RTE_ETH_DEV_NO_OWNER)) { + printf("port %u is already in use\n", portid); + return -1; + } } return 0; } diff --git a/examples/l3fwd-acl/meson.build b/examples/l3fwd-acl/meson.build index 7096e00c1073..6fa468b3aa9c 100644 --- a/examples/l3fwd-acl/meson.build +++ b/examples/l3fwd-acl/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 deps += ['acl', 'lpm', 'hash'] sources = files( 'main.c' -- 2.20.1