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 96E90A056D; Thu, 12 Mar 2020 18:22:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 569711C07C; Thu, 12 Mar 2020 18:21:06 +0100 (CET) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 5F1941C036 for ; Thu, 12 Mar 2020 18:21:02 +0100 (CET) Received: by mail-pf1-f196.google.com with SMTP id x2so3213666pfn.9 for ; Thu, 12 Mar 2020 10:21:02 -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=NSbxM1vchD+NHe5eMTr/oEXrivU0x2mi9+eBV5zkU+k=; b=qDJr+RwKX4J7VF53nVrmlyfBg5Z2AimwjLEkp3OWs0GiyrWZNxcxd3yjQ1kbdZEkA7 muGNxTLpBsd4o7xwSy27c+e8dZh519YLFQbU2wUXFJuLTt+lj37P7PaJJl4RQg0AXjye dtAZw/exeFTgax8cdpUDHQ2Kbd/oS1zbvgAdUlflkM7YEHldlqBpxzVGHbi4yuDAlZeG DjmlAQzfyxzkuNkE9rV4BghQMcNfY//Jk12rcdu1vn/TJUehIQbafoeNd3i+eP/cKNLy KGOGS76Y2EOdZk40QYT/5vYevDlzeKD8N3HlWY2sb0hqPL0qz/BqhlwqhJtam5ipEUI9 EfpQ== 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=NSbxM1vchD+NHe5eMTr/oEXrivU0x2mi9+eBV5zkU+k=; b=Y/FUt3XuRaDPH5SHmYyusR7xruuWhSnY8dakeLaFMP4ZQKH3hRGZpm4Z08WBU/O4ch AjRzvKon5LpzJgmlJMKQV47DA2Brrwf7hnE6faozjOo/s7sBAJ9TPyhreP9p/PzUgR2l IRXHbXfkaaSmh0n3vAlUzdKtOE/sf0HsBJzsJCyVpK2s4fvkBd3MMoULYdHf779/hKlM aKrcmgLCybCfS5R8V6M5BlrygL7Gb+ZcmFIkRXiFF2GQysqvzzbRi5h9h3lZFMLEzsf8 MQs0qS+kHte70HeglMOAJt2Ne8DwvgGsaLcJhlbO3onKdkE5dE6JNIL81N5j21pW0JX0 FIwA== X-Gm-Message-State: ANhLgQ3zMJTWxJhyQMsmXQ5D6isK3rMHfTUfmnZql8ETEvwBr6VOTBK0 ZXnX8bEHsHtGkME6tjC4q4ggIbP75Io= X-Google-Smtp-Source: ADFU+vvDNNHXI0wSNwgll97i1/R9fANFsrLZQ2kaTJcViy7qov30UV+x0VkmVoJijsswucVrM07+mg== X-Received: by 2002:a63:5847:: with SMTP id i7mr8681666pgm.127.1584033661122; Thu, 12 Mar 2020 10:21:01 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 10:21:00 -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:45 -0700 Message-Id: <20200312172047.19973-6-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 5/7] examples/l3fwd-power: 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 l3fwd. Fixes: 5b7ba31148a8 ("ethdev: add port ownership") Cc: matan@mellanox.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- examples/l3fwd-power/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index c7fe0ec03495..3a8a7277cb0a 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -1396,6 +1396,10 @@ check_port_config(void) 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; } -- 2.20.1