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 B481BA0559 for ; Mon, 16 Mar 2020 17:09:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 36DC61C0B7; Mon, 16 Mar 2020 17:09:41 +0100 (CET) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by dpdk.org (Postfix) with ESMTP id 0284E1C0B3 for ; Mon, 16 Mar 2020 17:09:37 +0100 (CET) Received: by mail-pl1-f175.google.com with SMTP id b22so8198437pls.12 for ; Mon, 16 Mar 2020 09:09:36 -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=JAMQv4YIUkehN2zt4AP+yvBCaOmB28IIJXnYvpbLWW0=; b=Y+vvIm447w7VVzokA21zLSJCJlbfst3rS1hpjinTFd79Xk1aSTX8jkk1YT7uAUIvqq U++P0/0WzZJCpJDiAzo1DW/L+JPeN9ZEjj9dQ/V8mVN/SuA0XzEOEFk4ghIh3xnVJqfd z4NvkSmd1/Dk++9skhD/nJB9aVv2iIFqAr7QtFeFwfG50LC4LXiIICJKJZ4jVytsV/wK WTTsS+iRdC8m368Gb29hnVt3Dz6kiSat8gn3hn6fgIiAoukJQkfW5JTw8qk0n+mWhtNv 8jenKoN97W8bZo5zZPD/XBvCywz0aP2uRLElKMdS+xqXJuPsCF7w/Husfdjy0Q4Lbxeb HTDg== 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=JAMQv4YIUkehN2zt4AP+yvBCaOmB28IIJXnYvpbLWW0=; b=bl+9M7tPoy2YinZ4yofXE9/WLWKlWy81Xehb1ghrPm+se8XNdEoHBBZmslSVgFP2xl AvZ+nRz4itKlmsRqncsf3UTstnySJVWj2YdkGIP1w1Wn/PNRDtv10lNR3v7CjFu7xYt3 z5EdoFvDMIUoEOqDckOtFW4ZXApGR2b9iakccICshGp16s2rX87A0G58y4uPh9TqUDBK BQAoX7Exe6+bRPYxECzoKGYEm5aoNkLt03BLCKNMrf53TnEccBXhiZSwKFHSVSCMQRo7 aFMIwRY20lWDZlZlkymIASIn/2Rov8GUzzHqpX1TZRwtMLuYUEv7gllhg27qj/v9/jE9 HY6g== X-Gm-Message-State: ANhLgQ0MjpkBXWaNNXEtLvCsjuiFjmGZk28QDy0HTPL8S8/RMsDRKkRY /yKw9+Ro5EUNkLvkN1GXUtIELFTDdV4= X-Google-Smtp-Source: ADFU+vs+Km1gWi+6oWb9iAu/kg7GcIKJAMDndyezQ+alJbuQTBx+1AzeoXM7gLY5wH1p6c0bJlJLgA== X-Received: by 2002:a17:902:d681:: with SMTP id v1mr27350777ply.151.1584374976012; Mon, 16 Mar 2020 09:09:36 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 09:09:34 -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:20 -0700 Message-Id: <20200316160923.5335-4-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 3/6] examples/l3fwd: 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 l3fwd. Fixes: 5b7ba31148a8 ("ethdev: add port ownership") Cc: matan@mellanox.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- examples/l3fwd/Makefile | 3 +++ examples/l3fwd/main.c | 5 +++++ examples/l3fwd/meson.build | 1 + 3 files changed, 9 insertions(+) diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile index 59a110d12a49..59cd00abe6e9 100644 --- a/examples/l3fwd/Makefile +++ b/examples/l3fwd/Makefile @@ -25,6 +25,8 @@ CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) +CFLAGS += -DALLOW_EXPERIMENTAL_API + build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) @@ -50,6 +52,7 @@ RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.conf include $(RTE_SDK)/mk/rte.vars.mk +CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -I$(SRCDIR) CFLAGS += -O3 $(USER_FLAGS) CFLAGS += $(WERROR_FLAGS) diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index dda430d68a20..ab717e3bfd2e 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -221,6 +221,11 @@ 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/meson.build b/examples/l3fwd/meson.build index ebed3b518c4b..7d72b1b365ae 100644 --- a/examples/l3fwd/meson.build +++ b/examples/l3fwd/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 += ['hash', 'lpm', 'eventdev'] sources = files( 'l3fwd_em.c', 'l3fwd_lpm.c', 'l3fwd_event.c', -- 2.20.1