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 8E522A0559; Mon, 16 Mar 2020 17:10:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA4721C0D9; Mon, 16 Mar 2020 17:09:44 +0100 (CET) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 8081D1C0C0 for ; Mon, 16 Mar 2020 17:09:40 +0100 (CET) Received: by mail-pg1-f195.google.com with SMTP id a32so9155006pga.4 for ; Mon, 16 Mar 2020 09:09:40 -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=vsYspAECN0QqPihnoLSE2Qafwx6kgZpnLz+EbnKfpCY=; b=14dvVOZeNit7/JGmuoC2rq0yhwDzY2hCDwIXhcuxaE7TrKhxZfpalmJohXTQvWeEe1 En0hdB33VIh1iFVSrw5om8wOpvop5JwRJ9wxaiPsHw80RwsKgQljfTbQeVZO67+ilqcL TDWiqoT9L6WdyLKBJ/nB17nc2iRlSMJ9mAtN38vrlmncsDiFyrqaPQVcbUVES8uxoF8i WzOuksNxfq3i637P8d89RrHMlnhVm6O6rQ8moKZ1fT5thNa9GnfZXukAgoH+785JCzfd WX3lB4KmG5ihdLbmq9F2Wb6fyikQIDAdZjqBHbCYexZhA4su8U4KKMS/wFsxFxptE8rZ HY7A== 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=vsYspAECN0QqPihnoLSE2Qafwx6kgZpnLz+EbnKfpCY=; b=l8J8f5yE3pigVNyxJIyRDL5ezABlc9dF6V8XalwaZcMatrVG6suzGqYmhKb/WrlMa2 Fpt3A2zIrcFyvGEB+9wHPVk9bBP8Xd6ah+gkG5Oxxh3xQc4PH5v2b3LBH1l9N/0ZnMi0 lIxu1ORI2HjVWJeFfc10BKa+7uOvQtJwbH8f4yCYeTZn4BZExCoWv7t9TN/7stN60FdM xGGbDN12d9De5TA4CPSPknaOV2ubfuWmIVx9pXh0Vm+zZkgNw1eszrQGU7U9g6xUrXEq OX9KatwdC5aoYtp+TZL8TTRx/39vl0aCmL41DWtxsqG6QpL4gEKIqH8UQQYacvpkPopE 8rXg== X-Gm-Message-State: ANhLgQ0t04o2PA2ZclFG8Hh99YYRzIMNE0Dy9V5ZiQYZ/pBAnJCWtUiG TlOS4eVKcDtHokqf8EL6aISAfs0j1P0= X-Google-Smtp-Source: ADFU+vv3yd/+iY3e+BBJpnlLjKTnsnNZCsbxBBSvP/BLL5ALqAAB6rLAFxRnG/a3NZPgrujUvATL4g== X-Received: by 2002:aa7:9d0a:: with SMTP id k10mr372617pfp.266.1584374979305; Mon, 16 Mar 2020 09:09:39 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 09:09:38 -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:22 -0700 Message-Id: <20200316160923.5335-6-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 5/6] 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..60f5ddd8fb9e 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(portid)) { + printf("port %u is already in use\n", portid); + return -1; + } } return 0; } -- 2.20.1