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 A228CA056D; Thu, 12 Mar 2020 18:20:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 812C41BFA5; Thu, 12 Mar 2020 18:20:56 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by dpdk.org (Postfix) with ESMTP id F1BB83B5 for ; Thu, 12 Mar 2020 18:20:54 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id f15so2818543pjq.2 for ; Thu, 12 Mar 2020 10:20:54 -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:mime-version :content-transfer-encoding; bh=BZuABNN9Jy97LRRrO6t+8mUrfmDsFqdIYxcV7f+QIHo=; b=rg90oEXOR2sJ685V3+RMs/r1suETwpi8SmIQSwWFVhe9MPiFPMUHfAwcyL3V6Q8Cm1 A2B+IkF0QuNyM5oXziYGLdkVibUAH8/rNIi+hyX38OYX7NvBWRgPLbUomKK5ey+OekIg w5M1c/+9E6nPXE1K9DyHafS2sOrWWMjdYLpf/mQyNRSeem8O2BYOvae4kyRoGD3dDWid 4rKCnDcNRds6gRPF0BYjdMTufBqf5CfpNT+6+HKloVvzCu0eOv7dW1GxFTEiOrbyT3EC tgEjNVTh+u9RVm3N8T4gH4PtyKTNWJ9pAvqV4iy1RkQkzfNhHULxaswmlrwb8F/JojuQ eBJQ== 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:mime-version :content-transfer-encoding; bh=BZuABNN9Jy97LRRrO6t+8mUrfmDsFqdIYxcV7f+QIHo=; b=Poea3fDHVK+eYSw2W2qWaGIbujW3skymuKxZ5DcVnfM+OENFqrgdQsgL7hwKdd6+CA dp+iTb7FZ/MDvLC/ck6HH3o+7LOKOdrghZUTlamcs8NjDBpbT7v2RIVuZhS/RYxXP+Pe MUKsqI2IjobIBCFcKnGvaey6nzNpJ3PYPLNEihFBgmnpBMgXuhHvQl7TKPGJp+QMgv6Y Y2bY84UIk9UKKX26bb6nx7EPyzIJqyxDRIRP0WjP1k0U9/938s7xnaPNmfT0J20DP+a9 QMjCQijd+LlBMXqn0m78zZcMfYd/L9aYLzkqT9bW80E7iggeSw4ctjv9yy6zvx3SY8Od mdAg== X-Gm-Message-State: ANhLgQ0wgTvnA3sWKbFEgV49+aiCXD93dQ2L7iCfETLf1hjUXM1f7bFc kAGvnfgRyfKB5wf0Y/rfnYp6CGxsXwk= X-Google-Smtp-Source: ADFU+vtxFj+8ITElmqL+gxI/4TLrT+D5h+/H5hYLVs1gP8CGpe3L3iYko0sN5E/AYiKVZOulH6/TPQ== X-Received: by 2002:a17:902:5996:: with SMTP id p22mr8996237pli.190.1584033653322; Thu, 12 Mar 2020 10:20:53 -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.20.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 10:20:51 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 12 Mar 2020 10:20:40 -0700 Message-Id: <20200312172047.19973-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 0/7] 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 introduces a helper function to check if a port is under ownership. And the follow on patches use that. IMHO this should not be marked as experimental and done as a bug fix back to DPDK 18.11 because then it will get picked up in LTS and users won't run into it on Azure. 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. Stephen Hemminger (7): ethdev: add function to test port ownership 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/vhost: 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 | 4 ++++ examples/l3fwd/meson.build | 1 + examples/tep_termination/Makefile | 2 ++ examples/tep_termination/main.c | 2 +- examples/tep_termination/meson.build | 1 + examples/vhost/main.c | 2 +- lib/librte_ethdev/rte_ethdev.c | 9 +++++++++ lib/librte_ethdev/rte_ethdev.h | 15 +++++++++++++++ lib/librte_ethdev/rte_ethdev_version.map | 3 +++ 17 files changed, 58 insertions(+), 2 deletions(-) -- 2.20.1