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 E94A2A0559; Mon, 16 Mar 2020 17:10:16 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E6A9E1C0D1; Mon, 16 Mar 2020 17:09:42 +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 EA1E01C0B9 for ; Mon, 16 Mar 2020 17:09:38 +0100 (CET) Received: by mail-pf1-f195.google.com with SMTP id z65so10186158pfz.8 for ; Mon, 16 Mar 2020 09:09:38 -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=zYCvvLvN3i9tQ/IqBdZwCKMS+M4pJS/Ts8k1AGYthvU=; b=yoivseXGx/d7wkf4GANSAsYfWGa1n5oc+i+A+Ou6di+dB/Vu6RaF5/Lb8kSMBaC4tR Ah5Zdm32jmFqoG7YC23k9lzuycGjQh+oJ1p69F+5uGM5thZ0WUuXDzkrBZQ1pPrVPuSk 44ggV4/DWGaXnFiaFdzOs79T9WPGoXt7V7XDhfUWnOBr6zEsJJ9nF9KagO2OQ66xcITz IZhH+XRRpkzW/+9dklReRIpmGVEa0IKejXnln83Qj+CfjU05n9rYEiKayWNKiFelnGqy s0cs6IfLAiO2XRmyOXIwgEPZuavPN6qWTfsjubAECYhvylExtRj+SL8/g1moL8ZksPu1 TR+Q== 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=zYCvvLvN3i9tQ/IqBdZwCKMS+M4pJS/Ts8k1AGYthvU=; b=nDCCwwU2SNZcjvDdjGGSIhTdAYQiFhr5BbZXLSdChMpR0SjGcqMjcIWl64d/pPRbPs OAVSjfbjMDBq6uBpD2h2IAB+Q2w94Vqj4ALsYLRexGPJvu7LY+Zbv4qTqeqog97cLs6D x80xJszdpmTkWSvorlejwxGVVfmh5XUhzNY9nKCs+3yjqz6rmd2z3BO1UauYlvSLWX5L taapE4Mp4n/Dj9v4fkSidQIBhTOXjX8XNR4nTX+qKpwP0i8yPsBXhdtyDSWWInVS402v 0952d1uZ0Xz7be4Gdfd5peUlZwZTggp2a/J/KxkBuhCfdwTdpWjy6f6NA2Yk0BsDTxBR 9LcA== X-Gm-Message-State: ANhLgQ3pzSpm/D6dEqU+JyRk7MGXGD2cBE2Xy+3j/n2Lo/k6aYHFnpuO yJbUYQ9qtzuNUA7Jl3xSI8KvWEgBcGM= X-Google-Smtp-Source: ADFU+vvs7ng+cq6CarW5S1OPcWwTaCvYuAoV3b4NMI+R5eQM3aoZ3qn8f7gx19QQKc5pNkCEYxBN9w== X-Received: by 2002:aa7:9481:: with SMTP id z1mr310782pfk.185.1584374977643; Mon, 16 Mar 2020 09:09:37 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 09:09:36 -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:21 -0700 Message-Id: <20200316160923.5335-5-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-dev] [PATCH v2 4/6] 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..d9bee9ade323 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(portid)) { + 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