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 15A86A0562 for ; Thu, 2 Apr 2020 19:20:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF1321BECB; Thu, 2 Apr 2020 19:20:07 +0200 (CEST) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by dpdk.org (Postfix) with ESMTP id 03DBB1BE96 for ; Thu, 2 Apr 2020 19:20:05 +0200 (CEST) Received: by mail-pg1-f193.google.com with SMTP id 142so2123187pgf.11 for ; Thu, 02 Apr 2020 10:20:04 -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=htzPMTkkQt3wtNYQl5Pc2vBv0EMDeHc+HNJPHQ4h7nQ=; b=ELX+J+lCarPfI0P3qDxrg9s5Or/B3eFiKdVnyK8Jv643cmYRmdnW5WFZ7PZPnZgHou qAru4PuFdBFAb+m9AM0ujoMV7rM9/AHWJ4w0NeDp+kjNevm5IAKuOWGbqwYR9z83ljK+ Zpi4P2PHzPGU7uyFCr8WS/Ivy4vm4naJ3R5/dk8dJ8zminP0thdcwNqnXy9YLAxwkAqH Ydp6XNOi6uFCJI+Zb5FIQ8ZuLHITu7dkh2WNzP7R/Ir4aZdr4MckAKxe1xRqzIo8hI6C PivhD4gYfh12y6yzURoDhestlJ1v07N+mFD1AffGx1x6IAHBStUaeM60pQJfFsmHj1u4 pehg== 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=htzPMTkkQt3wtNYQl5Pc2vBv0EMDeHc+HNJPHQ4h7nQ=; b=OZAgyxnw00R6XY02KnJrOYV0PTIspgT1SpGBE7zPM9NcFNc0hkoolJ5yEJiuZmNudV m3lEOxSKEYLNgX7O2TXgh1zQWzGCzk1sJKYdR+SZvmzgLIGfulHvWL4eq2BRrEOCKeKP i/XOY0qB6lw6oNUJrzQ3RTF4E62lgi9YFkJ8cC7a1ZN80GceBHlKvFGiUKcwLV+hl2B/ G6NEexrBUE+/skHPH3zjRuwxvBLX3i0lEuh5uesrcR4I/2RBR16B4iYbf3I7QrVIz7Ha 899rIa0P/DUqMRmAhEQn55OUuvUl2OLdS7LHa/r8ZABnYHFbW1lzudVO7VFxjtikSyuR cV/Q== X-Gm-Message-State: AGi0PuZH/D4KUkmH0SYDah11SXzsgihGdC1AxZSOcrJoHA3QA+Kn43jj zACg3WbLgaef/YJF+51hH1POBA== X-Google-Smtp-Source: APiQypKoPkgdI6HM5ZY9jGpKNZqz2PnwkZj+pWHE60HFzx3yAF/3w9bbtrh40EG6eInfFUwEPX2Tzg== X-Received: by 2002:aa7:9a8e:: with SMTP id w14mr4113941pfi.113.1585848003935; Thu, 02 Apr 2020 10:20:03 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id y28sm4152347pfp.128.2020.04.02.10.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 10:20:02 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , matan@mellanox.com, stable@dpdk.org Date: Thu, 2 Apr 2020 10:19:49 -0700 Message-Id: <20200402171953.13356-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200402171953.13356-1-stephen@networkplumber.org> References: <20200312172047.19973-1-stephen@networkplumber.org> <20200402171953.13356-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v3 2/6] examples/l2fwd-cat: make applicaton aware of port ownership 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..e370efeaf1f8 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_owner_get(port, NULL) == 0) + 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