From patchwork Thu Apr 2 17:19:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 67668 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 20587A0562; Thu, 2 Apr 2020 19:20:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2A9AC1BF6D; Thu, 2 Apr 2020 19:20:12 +0200 (CEST) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id F36431BECB for ; Thu, 2 Apr 2020 19:20:09 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id t4so1566665plq.12 for ; Thu, 02 Apr 2020 10:20:09 -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=WOoBkVa4caNZLFoqQs8rTBhk4L5yWAR7OIx+1YexLi8=; b=XvupP6Iv+IiPzem5eLyG0Mk7GG8aLa7hc/BhQznBid8jVvpf8ynETSPLAQqq3vRJ/J ZfjBxfR3arY7BoFI7LEO3ZDoPVPDiQlDP4bkxfDUbpHiLb5VpLO44l3PDVozOcAF3V0M d+pK0KsdWbCVzz+xZhMfr3EWsDf2SnOFXxNjjsO/eErL8TLTZukbFNmCOe2+A8NTGGTZ n/pAh+uAlAchz8VgZ3I5IrYN5rQ3Dpkp5+EgTgPh3CgeSCmlxQ8GmqbEjVFqCOEDVVlf 6oBOELqNq4561ruBRpCzog4Bb7rYXNPzyziGnqQiM+er0krOnoVeatBDp4tIk8vsvKOu blJg== 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=WOoBkVa4caNZLFoqQs8rTBhk4L5yWAR7OIx+1YexLi8=; b=eP1qMdqy9QzWGijhR+3Kjoi1kguYGb0CtSaaNA4aZQkaykvunA8EnSUNy8vQ1ebcKl +a3m6IxZYfc2H02DWJU2TL/GrfmEcuXVO1a8h5zd3VOOl/jYOpexzmJ/oyX3SvMglI3z gab/Wvygqk4JfGmGaXJO3ZHlDoLMPti2Z6xX47GALgS43qU2Lpw+zETv3+rl9kohqUaA S0eErFqaiha2XN0sv9Hz0UD18Lug9KueEN9OIhGnPONdhHN4ihGrVp4eypY1LPQ9pWGC avtSiy38jjHd8NgYtKDb0HMdeXeoo+81eCq1dxgKu7Wr4RMZwTJsaSlG7mpko5eGj0cd xC/Q== X-Gm-Message-State: AGi0PubzdMzI/vA1xfHAdcvaJ3xMbG4AIZWbze7I3mRBubaiEL21dIVv U+9d+ppM+Eupv7ElWk2xOnqLcbaU1Z8KXA== X-Google-Smtp-Source: APiQypKWvtU4rNRQ/6S8HB3zFUkCHtSAVOCf65isNVt3PNq8su6STicQAELrM0Jjk43JacKUYh6k+w== X-Received: by 2002:a17:90a:1b6b:: with SMTP id q98mr4917395pjq.107.1585848008654; Thu, 02 Apr 2020 10:20:08 -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.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 10:20:07 -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:52 -0700 Message-Id: <20200402171953.13356-6-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 Subject: [dpdk-dev] [PATCH v3 5/6] examples/l3fwd-power: make applicaton aware of port ownership 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..186d6ac8e271 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_owner_get(portid, NULL) == 0) { + printf("port %u is already in use\n", portid); + return -1; + } } return 0; }