From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id A5CA7532C for ; Mon, 17 Jul 2017 19:15:50 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id b134so876488wma.0 for ; Mon, 17 Jul 2017 10:15:50 -0700 (PDT) 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=uEwng5A6RzbDgBPgavzcnYU3ApbzCxWZlb7rkV4tdCI=; b=y0yVSYrVgUc7h4l3SRp8dAZb1EmkHkaSsbFKWhFzCUAg7HIzqNwnWldFMgW6BXl8cs IyIzBdaBg4ZB5lN9LXa9HzAN2Tf6oIMM+137HbBBcfELOFKLA1EQY/y/sa49aB3AS+sM M6dr8pOpkSEriymEu0OITvJzSHcae30aFxFVqDXDIIs6fNKyptt96Ee2OX6TFd1pellG rnZMcGNZRkBeuYL1HtI5Z9yp7STrbzNlXYKnMEIs59OCahZ1OzJ6p/VcoAYlQg7SMqr4 fpkhng6D2XxFWw1jxiAMJ30y0ZRsU/Dl8QHWyBxHo9R4PrEx9GpOF1870ZmaMiCFZDCQ cDsg== 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=uEwng5A6RzbDgBPgavzcnYU3ApbzCxWZlb7rkV4tdCI=; b=j1EXADsNDF8jdmL1QQtOt6vwMBDn61jWkH1XKl73gZW7GgekgteA5cTe1iWMu0NzcP E8OgNesmeqXDdS5s+RePbdlHGXip9XTuNsnhZhZwkcJCLJ1wu6gG99OY39h4ydwrgWfj uFvuS9wTQ/Zc2mpPWmjSI0a3G0+ABkIvPn8T5PmejSj0ifUEKdhHpCb2xorkEYqhWIpf IZ/9nuSj6KSZjPN3Ta/Y33WBBIP83E3OFOowxSK1QDZX4SptJCKPOsJwJKUVir/NFf3d DyE+Rz4POxXtwugu+cjh0l6atSB/O9zLnX44+t5+r7EvIAsJZEh1GZ8EMit+3O7kvkUy Iprw== X-Gm-Message-State: AIVw111rg/R568vuIaUwg6Rl8Gk4scy+HIn/H+vweQk45oHqFqosVlUA DqxuZCh6KV3/xHqhJYU= X-Received: by 10.28.147.137 with SMTP id v131mr5377571wmd.98.1500311750237; Mon, 17 Jul 2017 10:15:50 -0700 (PDT) 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 i185sm138418wmf.34.2017.07.17.10.15.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 10:15:49 -0700 (PDT) Date: Mon, 17 Jul 2017 19:15:41 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Ferruh Yigit Cc: dev@dpdk.org Message-ID: <20170717171541.GT11154@bidouze.vm.6wind.com> References: <2230acd3-1119-22ab-5456-858d90e9f789@intel.com> <20170717161917.GR11154@bidouze.vm.6wind.com> <972f3812-a24a-4510-fc13-44c104a6aca9@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <972f3812-a24a-4510-fc13-44c104a6aca9@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v10 06/11] net/failsafe: support flow API 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, 17 Jul 2017 17:15:50 -0000 On Mon, Jul 17, 2017 at 05:34:53PM +0100, Ferruh Yigit wrote: > On 7/17/2017 5:19 PM, Gaëtan Rivet wrote: > > On Mon, Jul 17, 2017 at 05:03:46PM +0100, Ferruh Yigit wrote: > >> On 7/15/2017 6:57 PM, Gaetan Rivet wrote: > >>> Signed-off-by: Gaetan Rivet > >>> Acked-by: Olga Shern > >> > >> <...> > >> > >>> + > >>> + flow = fs_flow_allocate(attr, patterns, actions); > >>> + FOREACH_SUBDEV_ST(sdev, i, dev, DEV_ACTIVE) { > >>> + flow->flows[i] = rte_flow_create(PORT_ID(sdev), > >>> + attr, patterns, actions, error); > >> > >> Should SUB_ID(sdev) used here? And in related functions. > >> flow->flows[SUB_ID(sdev)] = ... > >> > > > > The SUB_ID(sdev) is the index in the sub_device array allocated in > > private data for the fail-safe. It is also used for the sub_rte_flow in > > the rte_flow (which sports an array of rte_flow pointers for each > > sub_device). > > I got this part, let me ask another way, is it always guarantied, even > after some hotplug, "i" in FOREACH_SUBDEV_ST(sdev, i, dev, DEV_ACTIVE) > will be same with SUB_ID(sdev) ? > Ah, yes. Sub_device slots are static, allocated once at launch and reserved for only one device corresponding to its declaration. Thus, the PORT_ID() can change, but the SUB_ID() is always the same. > > > > PORT_ID(sdev) is the index in the rte_eth_devices array, meaning that > > the rte_flow_create function is actually called using the public API on > > the port. > > > > This allows to trigger the additional operations usually done within the > > ether API (storing the configuration in the eth_dev_data structure, some > > side management), and following eventual changes automatically from the > > fail-safe level. > > > >>> + if (flow->flows[i] == NULL) { > >>> + ERROR("Failed to create flow on sub_device %d", > >>> + i); > >>> + goto err; > >>> + } > >> <...> > >> > > > -- Gaëtan Rivet 6WIND