From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 733F5C2BB1D for ; Mon, 16 Mar 2020 16:09:35 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 084FE20679 for ; Mon, 16 Mar 2020 16:09:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=networkplumber-org.20150623.gappssmtp.com header.i=@networkplumber-org.20150623.gappssmtp.com header.b="zAAW8RTJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 084FE20679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=networkplumber.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3D0561C06A; Mon, 16 Mar 2020 17:09:34 +0100 (CET) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by dpdk.org (Postfix) with ESMTP id E348D1C068 for ; Mon, 16 Mar 2020 17:09:32 +0100 (CET) Received: by mail-pg1-f176.google.com with SMTP id z72so165212pgz.3 for ; Mon, 16 Mar 2020 09:09:32 -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=IhN8clZP+XeFk0Nbh4MVNt4aY9E7lFzGT9awMYoW9rQ=; b=zAAW8RTJAF+rCBIe+cdpfTexXq+Xaxh2ckMgtvfKcmVzWdGR5AMchoN1+KUy704/xd 9F7dApJ9yuCBqYuc1Hz+lpLHDXtzLUgCCkOTM9ANabT9QjRvK7oJB1BSaVO56/zx+f1/ 8G/Td5kdzyJNqi5HC7kUP0EVzX0pisDFCRFoeRCD8RUKxqqD36TxUMLDhaJy/aITXf90 uAZMyFG9kBkkAecTxBQMZzm5QhfHTZfMvRq2UCF72QpAW8eY7Cr4woeBNGGWhiLYVgxy N/4JV1paoX4uwxfG3dAVj/O6fenfP6M3VCd2Ili6ZYO9GuNSsaJeAu8tH5cx+FBZYC9f sUEA== 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=IhN8clZP+XeFk0Nbh4MVNt4aY9E7lFzGT9awMYoW9rQ=; b=OdW+Pza74S0NMA0Mdj8f5Rysakp+6glCPvzgOKfwO98ibAEMi9ItK6BtZTICZHLsHm XNcY+fuB8ohVYs9M0KTn9WLdfFYJyo128XdA9XkTbf6gPuLYFbQSbYEZDFQIX80N0coP zsMQGT6Y8Aal4n8ZxUHiNrI0rXPAQbGV3eDvX4GPtjqD3EIO2eWi+HkdWjvwKerk4tya 3LCk6TT2clutG4vBsII+oW3OnBUnFgMdaI8gzqoiUZFmgqhwTaLRVdH4vRKuuJUvzIgV ZPVEzwi4s7ztOZsfQrI1GEGbXT3g29mB5oV7u3EDGTOcAb7EtD3XQthHkcfk+bw7+/I0 pX8Q== X-Gm-Message-State: ANhLgQ2+UvHnpF9Y1S8QsAsC0f5zwuF04vtHIkBwlMUXK8tEK9u5eAyl oAZ6SzIp7CxhP6uKWYDWBxeLpWAieMg= X-Google-Smtp-Source: ADFU+vsn4Cysfk4KLhqB4jPVbBc9O9a1X3rt16W/07/+Ea/D9pmr4YNpo01MtR03c/GZvM+3dGoGBQ== X-Received: by 2002:a63:7c54:: with SMTP id l20mr591731pgn.158.1584374971412; Mon, 16 Mar 2020 09:09:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 09:09:30 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 16 Mar 2020 09:09:17 -0700 Message-Id: <20200316160923.5335-1-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 v2 0/6] check for owned ports in portmask 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" The failsafe, bonding, and netvsc PMD use eth dev port ownership to control sub devices. These sub devices are hidden in the normal iteration over ports but some applications use a direct port mask. In these cases, user may still (incorrectly) try to directly use the sub devices. This patch set introduces a helper function to check if a port is under ownership. And the follow on patches use that. An alternative proposed in earlier discussion is to have each application try and own the port. But this solution would be more invasive, and does not handle the case if secondary process exits prematurely without releasing ownership. It makes more sense to keep the concept of ownership as strictly part of the device model and not part of the application layer. v2 - rename the helper function and use rte_eth_dev_owner_get Stephen Hemminger (6): rte_ethdev: add function to check if device is owned examples/l2fwd-cat: block attempts to use owned ports examples/l3fwd: block attempts to use owned ports examples/l3fwd-acl: block attempts to use owned ports examples/l3fwd-power: block attempts to use owned ports examples/tep_termination: block attempts to use owned ports examples/l2fwd-cat/Makefile | 2 ++ examples/l2fwd-cat/l2fwd-cat.c | 3 +++ examples/l2fwd-cat/meson.build | 1 + examples/l3fwd-acl/Makefile | 3 +++ examples/l3fwd-acl/main.c | 4 ++++ examples/l3fwd-acl/meson.build | 1 + examples/l3fwd-power/main.c | 4 ++++ examples/l3fwd/Makefile | 3 +++ examples/l3fwd/main.c | 5 +++++ examples/l3fwd/meson.build | 1 + examples/tep_termination/Makefile | 2 ++ examples/tep_termination/main.c | 2 +- examples/tep_termination/meson.build | 1 + lib/librte_ethdev/rte_ethdev.c | 12 ++++++++++++ lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++ lib/librte_ethdev/rte_ethdev_version.map | 3 +++ 16 files changed, 59 insertions(+), 1 deletion(-) -- 2.20.1