From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 50E3C3253 for ; Mon, 17 Jul 2017 18:19:27 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id w126so80943493wme.0 for ; Mon, 17 Jul 2017 09:19:27 -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=Emi2Cnxh64rNG9+XdPBdQ6d400777dDQpavZP3Tu2Mc=; b=aNG9GbV/cz2MurvvdcsTGV+yH0demK7O3OWFiynG7kj11H5gQivEFD/xaRZMJEAGVX vG183ytKUoCyhE5Hz50ZtBOzM9uCDzwYFWi3oBZwmZudll/FQKvBi8lamI25Y+4L0Qpj av/VAfZtiZmV6Il7WgJZzTQ0zZkIj4ziaWK94mphJvbRN5ihEI2drNlZsaDz9ovwhcDp yIMGUczFNrTc6YAG2NLMTeb+Ie9b5nARkg6GnXE7xesh1LAIAy3Tp06A10rSpZqkShts rT11CllItfxqq4ajGBeTCDLrmeyBrEiaCfLTva0koTeY8sqcBkl1ee72cERuSDBeT17n kPaQ== 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=Emi2Cnxh64rNG9+XdPBdQ6d400777dDQpavZP3Tu2Mc=; b=XJyrbO+Kou2YW1kzlvXL+so34ne7OVbQnX0BJudwTtYITLFpcDpRAiFl+4SoaHdPcH 8Dt2L6Onse7QKGvNbyYor6P5TjbXEpAJuPDqZ1MLqHwDk+SOuwueGaNhYYghvEEVwc2t lx2t48VVDv7sY+Nas+4UOuCJK7TRO3Zl6vs5UqYmCCKOuwqE0chC7zekKBPO2ChUOpxC rWIW1kWEZ+dPThVMhUsDHA97Lm2m1rpQSL9ZHRTy1k8sdKAYVYRQbx8g32F981YEwXL8 xvcXb/SCH6DsBUBE6L28AG+Fpq4b6rpe1QZRug2Tlrx48uC8wf2QtblYuHOxYcJJpbOw LF7w== X-Gm-Message-State: AIVw111DfJ+NReznYDw7WDB3A49QaDJO0xUKd4nCOhGyZn6szR4k+4ZA pMln4Os2EZAQ/nZq X-Received: by 10.28.103.132 with SMTP id b126mr5250490wmc.10.1500308366893; Mon, 17 Jul 2017 09:19:26 -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 u135sm28628wmu.12.2017.07.17.09.19.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 09:19:26 -0700 (PDT) Date: Mon, 17 Jul 2017 18:19:17 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Ferruh Yigit Cc: dev@dpdk.org Message-ID: <20170717161917.GR11154@bidouze.vm.6wind.com> References: <2230acd3-1119-22ab-5456-858d90e9f789@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2230acd3-1119-22ab-5456-858d90e9f789@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 16:19:27 -0000 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). 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