From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 39D2E376C for ; Mon, 17 Jul 2017 18:34:58 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2017 09:34:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,375,1496127600"; d="scan'208";a="108963815" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.249.74.32]) ([10.249.74.32]) by orsmga004.jf.intel.com with ESMTP; 17 Jul 2017 09:34:55 -0700 To: =?UTF-8?Q?Ga=c3=abtan_Rivet?= Cc: dev@dpdk.org References: <2230acd3-1119-22ab-5456-858d90e9f789@intel.com> <20170717161917.GR11154@bidouze.vm.6wind.com> From: Ferruh Yigit Message-ID: <972f3812-a24a-4510-fc13-44c104a6aca9@intel.com> Date: Mon, 17 Jul 2017 17:34:53 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170717161917.GR11154@bidouze.vm.6wind.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit 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 16:34:59 -0000 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) ? > > 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; >>> + } >> <...> >> >