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 3C455A0559; Tue, 17 Mar 2020 09:18:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9BA601BE51; Tue, 17 Mar 2020 09:18:28 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2050.outbound.protection.outlook.com [40.107.22.50]) by dpdk.org (Postfix) with ESMTP id ABF912B9E for ; Tue, 17 Mar 2020 09:18:27 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OjwH8awWgkpKaokqVxh/cVXrkeReVZpWpSOW7pkByFYhxeZJcyf5s/9UuW8CA5glbUlYwDHLv43dGZCnr4igPzK/HSTZvHFU1e9NM3Sp6c7O0bnxYtdf8/VJjuasLrqHJ4xQId7MHHIVl/nWKosSQxGU1H+2BYzMFTjwJV818u8EIFdzVor8k/MRN66KAD72gDM6pLZQeZWUzZUtoHpu8AD57h49/n5UxfG3yKpy4H0ID6Rq6XlmkhGlYXWaK2FKUmQX+9hF3SN0V22KWsPOVm3lX+OcAQqUiyHWgysJjCLysWMMgX8k4oh4cN/Qn7zEUmH0gSBIfhcnX1i24uKMYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WGu4BISqlAAk+43pWhpvbpdWUbARAy75ZZQwVDro6sg=; b=U7jnZaQiBn5goTpUzg9aObNY9nnF64DJAmqa0ZGKL92jOiWzBQn1sXSbI3NCLB5rR8oJMU/4OtpCVfN2ghMSi+5GL0NUw7Exj8vDJ8/PEpssSh4sD1ER/LPyGeSbCJAlLniCTwHtY39JgQRek7usbL3XnHjVoWp9c/a7jGRPEwI5rVbkjvAuKUtexcvaeLgcHGlWeg6gr9zq65w6KqSksEe1QS1uBor4tGn1/IrHypZcw98ushZTvIoc1GmLhbdss2YrvhtZOjWVlnCuGBuERrvxOCezlu4b+vgLyjYuRaC7Uk4sTFSe7oBcfqaTA/SQLxGPH4Zuim6crvuNTH3R5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WGu4BISqlAAk+43pWhpvbpdWUbARAy75ZZQwVDro6sg=; b=KDbgDNgoMMMZ6qdpfJQel+I/u8cY1F3nF7HIO03F+V9SfhVwZy+leM0zAPn2XxTWQ3x50A40v+n54Kxg+GbyGIhUr5y4JVaGLbOzHPwv7Xsp/g0axEhYnBqUg4f7OO4MI4qON6cSZozT8Nt/1j8PkrWCtOCBQ+7L/EOG6vJp/NE= Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com (52.133.39.139) by AM0PR0502MB3619.eurprd05.prod.outlook.com (52.133.46.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.22; Tue, 17 Mar 2020 08:18:27 +0000 Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::a564:a117:9022:1fee]) by AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::a564:a117:9022:1fee%7]) with mapi id 15.20.2814.019; Tue, 17 Mar 2020 08:18:27 +0000 From: Matan Azrad To: Stephen Hemminger , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 0/6] check for owned ports in portmask Thread-Index: AQHV+61LEemAvhqLgku47dKeUkxvCqhMcWiA Date: Tue, 17 Mar 2020 08:18:26 +0000 Message-ID: References: <20200312172047.19973-1-stephen@networkplumber.org> <20200316160923.5335-1-stephen@networkplumber.org> In-Reply-To: <20200316160923.5335-1-stephen@networkplumber.org> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [77.125.85.240] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: fbfb2eeb-d5ec-4785-3a3b-08d7ca4bc4e7 x-ms-traffictypediagnostic: AM0PR0502MB3619: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0345CFD558 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(136003)(366004)(376002)(346002)(396003)(199004)(478600001)(71200400001)(66946007)(55016002)(66476007)(76116006)(64756008)(66556008)(66446008)(9686003)(5660300002)(2906002)(81156014)(8676002)(8936002)(81166006)(52536014)(316002)(110136005)(33656002)(86362001)(6506007)(26005)(7696005)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3619; H:AM0PR0502MB4019.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3fauMRCmP4WRhJGkyh0uYcPMFgjgBTtR2SfVoBBDxcV9EdZIrMsvEcnNQjt2zvnTbYVSW9VTB3nr9kLFPX2KO8SrGRJDCNakboubj+M8w8kNmkFwOo3HRqLnwweSQ1ZFVIbirYbIor1GSK0+O+60/cCnqiUdM+s7AktmybqzEueUVEd8lmlOwlaIT4/NRh8cAwmwZLj4Pi33qJzV0Ur1hWLiSOZIPzwf7y9diMmGAUs1L+eScrqSiOVF7xxZ9PaVPXwvSHH0OxGChKwXp2UQspOLk/cu+zDiR4uQvx5jSaMSfwU0n0u/vmewyJBBtl37LARli4AbtmARXTeHN4q8YQckK7Hvdpka3toav8UfFaDlkdzFAb0fScC2hkx9fjxxxJShwESf8nI3PEo79i1C24DkbdfCObUlow0B3ee/httQQw5THOOAD3FSHo2WS6v0 x-ms-exchange-antispam-messagedata: mQCID/KhNZflJOmg6zM931OoCtRJ49dFZwKq5dhezKTrfAxWtXZ5OnuAOanABdJiwJW3gLS7oxwatgzLeXNOsqCfioy0cI0lJaUVvLEothvErfmfY1IEtPJjFP/xkmynTzZyzbqef4PQdjTox6BzCg== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbfb2eeb-d5ec-4785-3a3b-08d7ca4bc4e7 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Mar 2020 08:18:27.0121 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: P/ZjSXWhY+8o+o5h5u+jS5VAOTpfmcORI+jmJqE8RqxhcirEQyrvxN9eq6DhUyAV8CEmLe9jS0jDf1jiLfr3Dg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3619 Subject: Re: [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" From: Stephen Hemminger > The failsafe, bonding, and netvsc PMD use eth dev port ownership to contr= ol > sub devices. These sub devices are hidden in the normal iteration over po= rts > but some applications use a direct port mask. In these cases, user may s= till > (incorrectly) try to directly use the sub devices. >=20 > This patch set introduces a helper function to check if a port is under > ownership. And the follow on patches use that. >=20 > 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 strict= ly > part of the device model and not part of the application layer. >=20 > v2 - rename the helper function and use rte_eth_dev_owner_get Series-acked-by: Matan Azrad > 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 >=20 > 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(-) >=20 > -- > 2.20.1