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 AEFBAA0562; Thu, 2 Apr 2020 19:20:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8D4A7375B; Thu, 2 Apr 2020 19:20:03 +0200 (CEST) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 4D0D52BAF for ; Thu, 2 Apr 2020 19:20:02 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id q3so2029443pff.13 for ; Thu, 02 Apr 2020 10:20: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=yRapHe59J2SA+D5wIPFQTwZ4nyIlwfNUFxWBe74KLE8=; b=VKV4r4g8nA64tUXuY+kNKmOp1S3mFNbi9LL1kbVglvLbx3okuoZPNYjNsxgJEyJhjE w6m6ol4GFCUbzWYfi8HYNcErrtofVIigWzONre9BS7UkzUJdXTcGGM816vuUxgs+djIR xqlJVAONQL+hHdtWwoQ4RD3dSFxW2vhyE73EVAElW/2N7Ax3OyuHtizAKm6M1g0mWR6W AyPMHLo1/eosZP/fBTM6OL7YeXyo9V7EPOJDZxS7yfY6leiVnlTloKmhtc96mDxcfABi IeKh+umq4GaPf/WlON86Xo5Yjpb1VRWcNxS3j/QpHA5/a7jc7X7Bvl+xYM/8YWr203nS 2IoQ== 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=yRapHe59J2SA+D5wIPFQTwZ4nyIlwfNUFxWBe74KLE8=; b=Sr+wDcDUoJ8r3/PPZRz2AE2N2a0uFGvGE9ewW+DgsQMlIMBmwJt4N3CrHQ3dHZK3+P ARHdGLm7yOnr+w8vbDvdeC5qDlkl84yaStc7zdHqkEaoLrHR5UXr67RehzJ2512Vc105 0GdIgqwfH3tTExjQSXiDkpybr9HxyB/fSzczRdKEuX4w3yl8yCSZvzB4jIjFtT17G5Jn /Om+PIEdbLJY5S6RUUZ7uI6WU/a7nWc/zNB4OrGPAZujPWmtC407WSw2H9mVFnwixCYC 66JBGKZgOMhY97P9w45B6OAOcgGPQqNO9c1JIaYCzmRGQ7iu4JnhOjFsRHdCnuYZnH1Y Njkg== X-Gm-Message-State: AGi0PuZ/F7cnpaO6w4Ud6kcxNxV5pMJn03Gzr85J/8E+jsIcfP31nMi/ gZLrZQPKTy7vXN9RUIqhmcIiZoyiCiX99g== X-Google-Smtp-Source: APiQypKLnPRk8s9RQH+8hsVgiQlzfFUSolskqL+qdfRRpRFz4iBw0g+NbzaN+WhyudkLGo6IM6xQdw== X-Received: by 2002:a63:7706:: with SMTP id s6mr4209977pgc.56.1585848000782; Thu, 02 Apr 2020 10:20:00 -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.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 10:19:59 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 2 Apr 2020 10:19:47 -0700 Message-Id: <20200402171953.13356-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 v3 0/6] checking 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 changes the rte_eth_dev_owner_get function so that it can be used to test for any 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. v3 - use rte_eth_dev_owner_get directly, and change the function return rework port setup in tep_termination example v2 - rename the helper function and use rte_eth_dev_owner_get Stephen Hemminger (6): rte_ethdev: change rte_eth_dev_owner_get to return error if unowned examples/l2fwd-cat: make applicaton aware of port ownership examples/l3fwd: make applicaton aware of port ownership examples/l3fwd-acl: make applicaton aware of port ownership examples/l3fwd-power: make applicaton aware of port ownership examples/tep_termination: rework the port setup logic drivers/net/failsafe/failsafe_eal.c | 4 +- drivers/net/netvsc/hn_vf.c | 11 ++--- 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 | 70 ++++++++++------------------ examples/tep_termination/meson.build | 1 + lib/librte_ethdev/rte_ethdev.c | 4 +- lib/librte_ethdev/rte_ethdev.h | 6 ++- 17 files changed, 69 insertions(+), 56 deletions(-) -- 2.20.1