From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0045.outbound.protection.outlook.com [104.47.2.45]) by dpdk.org (Postfix) with ESMTP id A5372271 for ; Sat, 20 Jan 2018 22:24:42 +0100 (CET) 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; bh=LYMj0p9uNFzn/14GS4tXDF0kn+pYKjHYDXq3sUeu95Y=; b=ZqsZ7dnf9177jcZBvifsltS5Y8fkWHoF7KsehyePseHLFRf55013wLU6vMFpTSyhA9iA+Dtb6qTDPNflFXO8nG8K5aRoJ/VsPt5vghYXW+iidmLL4z0BPJkrGmjAM6uoQu9SvHGTAOhOOptSv7NMOs0BKQ7Sr0QWEEJ1IeQ2oCk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR0502MB3804.eurprd05.prod.outlook.com (2603:10a6:7:86::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Sat, 20 Jan 2018 21:24:40 +0000 From: Matan Azrad To: Thomas Monjalon , Gaetan Rivet , Jingjing Wu Cc: dev@dpdk.org, Neil Horman , Bruce Richardson , Konstantin Ananyev Date: Sat, 20 Jan 2018 21:24:21 +0000 Message-Id: <1516483468-9048-1-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516293317-30748-1-git-send-email-matan@mellanox.com> References: <1516293317-30748-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: HE1PR0402CA0047.eurprd04.prod.outlook.com (2603:10a6:7:7c::36) To HE1PR0502MB3804.eurprd05.prod.outlook.com (2603:10a6:7:86::30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e072bef3-eac1-43fe-2807-08d5604c37ca X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:HE1PR0502MB3804; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 3:0p4gW+Yu2TSwoaGVGbMapjgrEYRwCgh/amlXlOpNLd7cYVTBu+9/PNJir4LCLHIT9QteW2sw31lpOx0hGuijslx3Zra1yqJcgrdfntTeCo+UT6cR4xNqn2us78yxeBLM/vdphd9BY0rIL1Tcmywwrp/Re7R9Mco6dm1utXsXg6mYQ/VoXfbqkNLMBbRVR4nuvs050fxy8Ao0/LAMOMg14g0zz9XmpzSANaVyNk4sPo83PPce7uIk9JDJZKILMxI7; 25:H3pblLZ7/AWdqjcYx33Y2Hj6/KVs2IGM2k/OnKMkp+SZPmj2fYjoTSdpg9jMVZ3UoDSKvV5fO1+/6vA5SuePXEEPLqTXLISv9Jg7+7qckee7SSlDb/8LXf5sv4usBhtwjxjF3/dJ81C5hgFIEdj00ikpS99g8iAcxV8Ax2vIkWJWSKqQII8yqbWTUbgvedDlzCM/RdyomRCkPIVVFo7Z6SBUvC9mOoeu7VCCp2zwGSawN8VpxTCdj11ryf8ffNvAoYjv9aR3LTI4K3VK/jHjWxq7I7wqbzu1bmWulG9MgL6Ygslj7myW8by7qDnZ9qwAV5S+K+gmjzO7Bvk/V7nJDg==; 31:PjLg+sIeARYgbZEtLHrp0WYZ6XLMHwqZhLMZhx+D/SKkSnIDeMBwcm8IiJOzKoAjzX9yF3kVeTlucH8gu6Str+rSUOj59KxBHa1rPqbbksBYJ+8YnQspVCI9LbTlEe74iObTiCB9KWkwWzoz8elnxiTbvcGtLpdPAKJ2qzLcn6NhBg6+wGr4+cjacuYyZNIangIfKofYOElshRuvUyhFP+WvyiAKN4h6EfcLTbxYkzs= X-MS-TrafficTypeDiagnostic: HE1PR0502MB3804: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 20:Ii5jO+CusBDQu6SE3+gQX1VosFxmHHM7FuFtm5f2w4Q6TId8VqvJihvFVG3As5anQuvu+uAAUHdL+Uj430qk3FLlQzHQwwVeETQN3WjsBP3aswQDcB8AG7pbIF5uPR9Kpea+PDqhkKyAJDnonZqK5CkIQuwX6uM7b4HlYAWx7Im/bKyqpYk0QkqSHyNK5V5VqnsPeJoTXRmT/X8Wp3NACtZ9ZG79yYYsssOAoTbo3/03nOWcAmMrc5sbFcjEpeTimIQRJkCWZJrJKVEM46ToVuFRSj3ctVtcUeR6fY2sm7333A67YKOnG9+qdaNlH3r6VLz+gpx8IGQYlF7lLqgw9WdsmWGV861ircJNlzVx02y+mZCtNBpxfx1UGqRxclU9SERzqIQ1oktlCSh49vsx4ALglFjGQ7IfxB8LL1SwW39itsqzF6JJWteOTj3qFmYU7kZ2D41qIW65KXIaYnCK1VF+9CPjAnL5m6wc2rpjByFZhyvLtL3uscihC5YR8SZF; 4:WN326nyHjIykbPXFU/im8WBmr0MWcx9leN/8Qx6PI1PK1+gihc4vy3NiSJPPOJ6nmc0TxSsrEZ5X5qbh/muQ7TCY8TIUDTLw3CHYrYzIYx9HBgkN5cmAqRTFmMraieTgAecyJFaDsz9kNx7GcYvvO+1dcBB/WyCJc/3pimKdM5hM8Gz2M0dDUmi0XK9FOSVT2y6PO7ZaMnKtJ0G3qVnKLX+oEaIWXgL6oQWB4e2oC3JnOJJPRoFg46XbeDb/P9KByZu8DESNjzCiVDCuMDEk6x3wmavC6AByjuN4t2Nb6vUV9mq14FQ2Zl6B0FiNvtRj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(60795455431006); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(3231023)(2400081)(944501161)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041288)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:HE1PR0502MB3804; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR0502MB3804; X-Forefront-PRVS: 0558D3C5AC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(396003)(376002)(366004)(346002)(199004)(189003)(97736004)(53936002)(26005)(8676002)(305945005)(66066001)(2950100002)(6666003)(69596002)(86362001)(55016002)(68736007)(50466002)(4720700003)(21086003)(48376002)(6116002)(50226002)(478600001)(25786009)(36756003)(2906002)(5660300001)(4326008)(47776003)(110136005)(52116002)(54906003)(33026002)(105586002)(8936002)(81166006)(386003)(7736002)(106356001)(316002)(59450400001)(81156014)(16526018)(7696005)(51416003)(76176011)(3846002)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0502MB3804; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0502MB3804; 23:M69TZekuYUmUeb2vLYcYnzGVfFWoGML7RQdNLpS?= =?us-ascii?Q?x1FmLpLYB0BhLI3aVxbxTb5i4G+wJhVbLgluYKUQCdneLeTJ+eYT1YXFDfO6?= =?us-ascii?Q?r0iG0U/EY/IdRIxIc9kY4fYP7KBJaAqGDYHSVwfrztBZQW12f049Bf668we6?= =?us-ascii?Q?4Z4hbUUhxZ9dcETT1cdSn8ZOtSycE5mzHhecwlSDT+P0qmozvvC/PGAHlx56?= =?us-ascii?Q?rQ4b0I6fUmaGqvaKsubp17Bjjwdl0FVSXkM51bPJchLBRqLJiktPBrEaCtMs?= =?us-ascii?Q?0MVOv2kYNA2BIsH5QKGWyn/LO8spIzCUnb/7fWb6uT+Mie0WDs0p4FS5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9L?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 6:CBlj/7J4EiKaLNDNx5FNEE0QSR9C/PmGTaHFMGN3cuhZWmaCh34wnuTzYU1LoJB5hIPv27/CB5W+jVZX2quUvYoWRaKskSVuxelWjATSlAsJk+w1B+jdYPGmNYw1YDpOd1yOlpwi1cRXEayCXZaQ1Hn0+5hw6h55m7CkqcyT6g3IkfMSMCbMjVAHRcgg0wm4zajoP280hs/jbJokBNhU+n/R+7jdBfT8hVgk0yo6NnVQS20Hy+v9bz+SKt6LPnnpHkrQvNLaM+BGW6RkTKamPFEGOERwCfmeicYRfahxhxqTOLbwUPd/FYHHNzxqWbxYUvlLxLWipDsL3SDG76hIdp3mpPumgkdANVDKsFlbQQE=; 5:INByzFc89tEfB/s+53EadeUe7PwSNyWQkoY2FayvmrKRWDpGaCWSGw+SD3t1A7W8xDYVSdTxTKLrt6JlJ947FBK2El1Eip7dFrBxqpWzWnQJxpCG2QsaQfSParYGD/NPcCvnwPb2WR4mxgO31w/rk88QnJOsHAcpRKdiTLxtHNo=; 24:UPFFcCdQ5bdIZOwp1vQqmImIApiP8pGAkHT/vVTJYaemect/ltrRc7psJOiC6tK1svPdEWkg3rcnJ7VTFDVVKRYVYX72FntfizKTiQjaIJc=; 7:oBnKAYDqEztWqRjaRBk4wPH7JAYGXkJZCYkI0z6d8D5GM7N+HzT8X6+9SJSYxh4olYREkQiQ54II7B8i1ksf5mZ9c+KdbTraLzFw85KB52Zd8nm9Umm9QRPHyLAA4He0xbJin7TL9+YMcdpe7mATt83KFV52dkSOrf3w44wUUiDh2kHib0egLwX1LObI4FG3ROxikYZPgLjGj1UL6S+oYgsPhreGxNIRCUpK7A2Tfz5WeDQqLIYwHVGwlNf2J7jf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2018 21:24:40.0382 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e072bef3-eac1-43fe-2807-08d5604c37ca X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0502MB3804 Subject: [dpdk-dev] [PATCH v4 0/7] Port ownership and syncronization 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: , X-List-Received-Date: Sat, 20 Jan 2018 21:24:42 -0000 Add ownership mechanism to DPDK Ethernet devices to avoid multiple management of a device by different DPDK entities. The port ownership mechanism is a good point to redefine the synchronization rules in ethdev: 1. The port allocation and port release synchronization will be managed by ethdev. 2. The port usage synchronization will be managed by the port owner. 3. The port ownership synchronization will be managed by ethdev. 4. DPDK entity which want to use a port safely must take ownership before. V2: Synchronize ethdev port creation. Synchronize port ownership mechanism. Rename owner remove API to rte_eth_dev_owner_unset. Remove "ethdev: free a port by a dedicated API" patch - passed to another series. Add "ethdev: fix port data reset timing" patch. Cahnge owner get API to return int value and to pass copy of the owner structure. Adjust testpmd to the improved owner get API. Adjust documentations. V3: Change RTE_ETH_FOREACH_DEV iterator to skip owned ports(Gaetan suggestion). Prevent goto in set\unset APIs by adding internal API - this also adds reuse of code(Konstantin suggestion). Group all the shared processes variables in one struct to allow easy allocation of it(Konstantin suggestion). Take owner name truncation as warning and not as error(Konstantin suggestion). Mark the new APIs as EXPERIMENTAL. Rebase on top of master_net_mlx. Rebase on top of "[PATCH v6 0/6] Fail-safe\ethdev: fix removal handling lack" series. Rebase on top of "[PATCH v5 0/8] Introduce virtual driver for Hyper-V/Azure platforms" . Add "ethdev: fix used portid allocation" patch suggested y Konstantin. v4: Share => shared in ethdev patches(Thomas suggestion). Rephase some code comments(Thomas suggestion). Fix compilation issue caused by wrong rebase with "fix used portid allocation" patch. Add assert check for the correct port state to above fix patch. Matan Azrad (7): ethdev: fix port data reset timing ethdev: fix used portid allocation ethdev: add port ownership ethdev: synchronize port allocation net/failsafe: free an eth port by a dedicated API net/failsafe: use ownership mechanism to own ports app/testpmd: adjust ethdev port ownership app/test-pmd/cmdline.c | 89 +++++------- app/test-pmd/cmdline_flow.c | 2 +- app/test-pmd/config.c | 37 ++--- app/test-pmd/parameters.c | 4 +- app/test-pmd/testpmd.c | 63 +++++--- app/test-pmd/testpmd.h | 3 + doc/guides/prog_guide/poll_mode_drv.rst | 14 +- drivers/net/failsafe/failsafe.c | 7 + drivers/net/failsafe/failsafe_eal.c | 6 + drivers/net/failsafe/failsafe_ether.c | 2 +- drivers/net/failsafe/failsafe_private.h | 2 + lib/librte_ether/rte_ethdev.c | 245 +++++++++++++++++++++++++++----- lib/librte_ether/rte_ethdev.h | 115 ++++++++++++++- lib/librte_ether/rte_ethdev_version.map | 6 + 14 files changed, 458 insertions(+), 137 deletions(-) -- 1.8.3.1