From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f182.google.com (mail-wr0-f182.google.com [209.85.128.182]) by dpdk.org (Postfix) with ESMTP id E4C541B014 for ; Mon, 8 Jan 2018 14:30:28 +0100 (CET) Received: by mail-wr0-f182.google.com with SMTP id z48so5016654wrz.6 for ; Mon, 08 Jan 2018 05:30:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=J14i26zYuGkbvs/YqsWNr1QuqMRoNzbwlnTOMnpuTnw=; b=V30AAVm8xKH6V5XNJiYYpl+nGmm66ElDRx1qIedubn4o9K8T69reKSDyCETQiHq0tq Fr8DRFpqlBowOISlVBAqNz2x3AH9uemzyLHDbTrdWc6aDUKK+MsZcJm8RDG1+RFpZh98 Y+MtYt+p2buWE5CPZvIrMhdxPg/cFnR5+4jk8en1c2cJ/6n8Ep+XWUgI+VX2sV41GgU3 OWOo+0+LbIzOdC1fWf2chFA8r8Ol8C4Q4tMeWt4wuEJgyf37nrDweLrneeLGhvz5/7jc VgOU/X07R0KVJsku/8vjpEZCm5yiA5su9bvCUtGfWYdF0F8uJ29bAZqrio8+QMElMNwl Spag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=J14i26zYuGkbvs/YqsWNr1QuqMRoNzbwlnTOMnpuTnw=; b=gnlXfPJIqh2XeTksqtp6BWKmwNtV5aeKhj75gyms8mJwXOhpnj4SH9dznP6+fgDJb9 a9WgA/HXml6j4fuNkPOnWdTGChcqneSpt3w3DqTvEmt9SfstUuqxkySFhs/sY+cFiGYO 5y8BAQ+COnxkpY3dzpOXQPtlRKxy/BpOSl6v9DyJkARPF6jiMNiFLRppi6ch9b/16BaN si1T4VKSkgcouPhyvuU2y/zOGZBLrfVK/2Jf/u1AeCipr/RSwrTn5Mf5/98EjntqyFBx Tr4BWtd1v376jvFidnh5q8+0OpYveb7lf2KjTGK1iZMQhLAynx5UY1osRmnnU4YDKjJf iCFA== X-Gm-Message-State: AKGB3mK7zYKgegWgU4p70RrVqb4GM7gEGTtqG66sr8N3nEAsRJSEtCwx qSM25I2UXhLc5g0k+7ECWULkGA== X-Google-Smtp-Source: ACJfBovYZbFjdClIjRoDAaUaIKOle+5LCir3b+L89nYjom6ZXaxdi2TiXLsN//ZtSVU3PYpAxpdjsg== X-Received: by 10.223.147.39 with SMTP id 36mr11162906wro.63.1515418228418; Mon, 08 Jan 2018 05:30:28 -0800 (PST) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id s86sm12683568wma.29.2018.01.08.05.30.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Jan 2018 05:30:27 -0800 (PST) Date: Mon, 8 Jan 2018 14:30:15 +0100 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Matan Azrad Cc: Thomas Monjalon , Jingjing Wu , "dev@dpdk.org" , Neil Horman , Bruce Richardson , Konstantin Ananyev Message-ID: <20180108133015.an547uygefjz5gj4@bidouze.vm.6wind.com> References: <1511870281-15282-1-git-send-email-matan@mellanox.com> <1515318351-4756-1-git-send-email-matan@mellanox.com> <1515318351-4756-7-git-send-email-matan@mellanox.com> <20180108113946.hcgxvulamjsiepre@bidouze.vm.6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v2 6/6] app/testpmd: adjust ethdev port ownership 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: Mon, 08 Jan 2018 13:30:29 -0000 On Mon, Jan 08, 2018 at 12:30:19PM +0000, Matan Azrad wrote: > > > From: Gaëtan Rivet, Monday, January 8, 2018 1:40 PM > > Hi Matan, > > > > On Sun, Jan 07, 2018 at 09:45:51AM +0000, Matan Azrad wrote: > > > Testpmd should not use ethdev ports which are managed by other DPDK > > > entities. > > > > > > Set Testpmd ownership to each port which is not used by other entity > > > and prevent any usage of ethdev ports which are not owned by Testpmd. > > > > > > > This patch should not be necessary. > > > > Ideally, your API evolution should not impact the default case. As such, the > > default iterator RTE_ETH_FOREACH_DEV should still be used in testpmd. > > > Why? We want to adjust testpmd to the port ownership. > This adjustment should be seamless for existing application. > > RTE_ETH_FOREACH_DEV should call RTE_ETH_FOREACH_DEV_OWNED_BY, > > with the default owner (meaning that it would thus iterate on the > > application-owned set of device). > > > > It will break the API (we already talked about it). > There is not any default owner: > Any DPDK entity includes applications must to allocate an owner ID and use it to own the ports they wants to use. > The application can include more than 1 owner depends on the user needs. > Each DPDK entity which can synchronize all its port usage can be a valid DPDK entity for the ownership mechanism. > That's the point of my remark: you did not include a default owner. I think there should be one, and that all ports should pertain to this default owner by default when created. This would not prevent a user or application from adding new owners specific to their use and specialize ports if need be. However, for other applications that do not care for this specialization, they should run with the current API and avoid the ports that are configured by other third parties. I'm thinking about applications already written that would be used with fail-safe ports: they would use RTE_ETH_FOREACH_DEV, and would thus iterate over every ports, including those owned by the fail-safe, unless they start following the new API. This is unnecessary: adding a default owner for all created ports and redefining RTE_ETH_FOREACH_DEV as follow #define RTE_ETH_FOREACH_DEV(i) RTE_ETH_FOREACH_DEV_OWNED_BY(i, RTE_ETH_DEFAULT_OWNER) Is simple enough and will simplify the work of DPDK users. Moreover, it would make fail-safe compatible with all applications using RTE_ETH_FOREACH_DEV without additional evolution. It would actually make any code using your API supported by those same applications, which I think would help its adoption. > > This new API should avoid breaking the current code as much as possible. > > > Yes, but there is a real big problem in testpmd regarding ownership issue - it must be changed. > The previous testpmd thought any port is for it in many places in the code. > Sure, then update the code with RTE_ETH_FOREACH_DEV(). > Please see a lot of discussions about port ownership in the previous version. You did not address this remark in the previous thread. I'm thus reiterating it with the new version of your patchset. -- Gaëtan Rivet 6WIND