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 BA78FA056D; Thu, 12 Mar 2020 18:22:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DB8981C00D; Thu, 12 Mar 2020 18:21:08 +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 8C75F1C05C for ; Thu, 12 Mar 2020 18:21:05 +0100 (CET) Received: by mail-pf1-f196.google.com with SMTP id x2so3213759pfn.9 for ; Thu, 12 Mar 2020 10:21:05 -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=1BC7na9ni6lsFj/t0z5LAszdbPkH3GmqR/57AiFGHOw=; b=hQ9P/YhRKfwBvJwnP3CbNYLtz3f2fqBKC4SfrIj5OoxZhPgTqRDqbyiTucbA1AGrhr 8F313h21zvneCaQBVoWZgnCOHS3J7XhUCOc0MkRRe7X3D4ifDN1EHZIP1qCeAc31F73H /SB4K1a2FbFqz0iMVVU1FAcDKYaJLOtLcsIpF5KTCoKuMms34BBzwNdwEd5h1964yoJS 3DIRA+usQeqWvv6GoHQFuybf4mNis5CZCT8suKXDc7AKRwAOLr50ODqPI8o3T5DJVP5h odYyLPPWgURwiaTYw8TeP92kJACK4gEGsDdp5LzbPlylneWYDUu9NRIR6lUzgeWUs3ww RgWQ== 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=1BC7na9ni6lsFj/t0z5LAszdbPkH3GmqR/57AiFGHOw=; b=G++6ntRNqZnNlxunw50x9b1CNoDs9XK6VFJyA5OFogvQIQAPgDBIedomJZT/Yks6f5 CvO0jaEiuFhyNONdiuSX7oiv/6v13gB0czQBR60UmSVIzDHXECt+m/Zbmqqpk22mg+ri r+iAwDBvOlIFluaUDorDOKIBflO7HNK/TrqS2VFvKKvDFmRjTwy/0FlpsHNfkxlsdv0u Aq2NzxobmTHKNCU0hI560Y4wFwPPqkxzlXupfOu4D8+ps5MGgT4vqJX6U9PLx4xiu9bl pSjMVdyP4wH9Xd0JS/A4/haw6CYi9228HOehldotVTOQ8Ot98zklCGEvp8tFD+b49n3/ qyhw== X-Gm-Message-State: ANhLgQ1onYuSMI77D3H34HN1tE2UfQtdd00Jb5VkUdkVNlEhI/gCcarZ hbUykX/RWyoDZUEi39Wg8KzEBPq/5t8= X-Google-Smtp-Source: ADFU+vsDHP1TO39dyYVk6d81yKTucaM18WlbA6MNv+pdkA2EtolcOEBNQHBOUyD53w/c7oZnAwtwag== X-Received: by 2002:a63:715b:: with SMTP id b27mr8840787pgn.275.1584033664198; Thu, 12 Mar 2020 10:21:04 -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.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 10:21:03 -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:47 -0700 Message-Id: <20200312172047.19973-8-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 7/7] examples/vhost: 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 application. Fixes: 5b7ba31148a8 ("ethdev: add port ownership") Cc: matan@mellanox.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- examples/vhost/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index ab649bf147e1..d759581f1904 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -669,7 +669,7 @@ static unsigned check_ports_num(unsigned nb_ports) } for (portid = 0; portid < num_ports; portid ++) { - if (!rte_eth_dev_is_valid_port(ports[portid])) { + if (!rte_eth_dev_is_owned_by(portid, RTE_ETH_DEV_NO_OWNER)) { RTE_LOG(INFO, VHOST_PORT, "\nSpecified port ID(%u) is not valid\n", ports[portid]); -- 2.20.1