From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id 0F9831B238 for ; Tue, 31 Oct 2017 18:46:06 +0100 (CET) Received: by mail-wm0-f45.google.com with SMTP id r196so442214wmf.2 for ; Tue, 31 Oct 2017 10:46:06 -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:in-reply-to; bh=C/gOg+EXm2D6ksOcN2JyL+C8NrtfskB6/7VfADo0HpM=; b=OJIKPXiLul48S6xCqMyJdoD9+9q6vhxcCV6fgkwRL99IHNx8ibCN1uZl600OZmtzni iYB2dBEWAb1hMJSH7tsxk9JayZtywnHYGsbQcFggt07WiBSLYLJ0UTZysrrL8vxJcN7w USrjCa/6ez1vR0zwGBGkjfDxwKV5ZBcWYpSSZrquTXTgXjtWEnGa5vJvxEa3RqOo8yr4 FIUqUp/wox52GDXaQAMq0dyuETRa/W/FoQz+jpFSUde/CTqdL/PA1dKxVkn4zhHCi+wQ eT2I8/NarAXtqrOGMNDmWHtc48vpzVHoKpyRm2adJjlPqRtsVuOv4zZXUVDdK3rg1GLM VbQQ== 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:in-reply-to; bh=C/gOg+EXm2D6ksOcN2JyL+C8NrtfskB6/7VfADo0HpM=; b=hgnUCPqJzzCtQHwF9IVh22X8xX1Keg94FmvRoV35dC+ly+eYcAzlorq/7QWAf3sNWM i46ukzu4t1im0ghqwKZTvvc9WnK6rB4t9W13rI8MvLLYoy23d8zLeRMPC4k4Nf4ArfCO nzPDjB6rVdyB6zCxsDqDHsH08cATHButgtmQUxiaXsG15UvQNhkNGRS1Natn11JXtUk9 dkk4JYtHS7cOl/Os7HvhbpzF7Bn/nuGNFN3vJnXhWYo0u4Zfrb1GxmYVf/gwoCqcF4fC QSNmcr000CRr+XRMg5bTvYDfRb3DJI/O/1eQ3rIeb+qmVGqzw0KfLamWXj2ZR9kZMAAb kOxg== X-Gm-Message-State: AMCzsaX3+s4oh/XUPvU0DQ8FCllU3DA4+rt7i0IhLYEditmwrC8d7dc7 jmrNRPbSiFOghmOwA6U5Idvwhg== X-Google-Smtp-Source: ABhQp+TPb9vc4HRGGxnVP7evy7dWcVsQrFWWlbiiz2kiz5xNKW1DCnZBqS5VC25ZNPORAIl43WrEiQ== X-Received: by 10.80.163.136 with SMTP id s8mr3785866edb.302.1509471966619; Tue, 31 Oct 2017 10:46:06 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id q16sm1687230eda.87.2017.10.31.10.46.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 10:46:05 -0700 (PDT) Date: Tue, 31 Oct 2017 18:45:51 +0100 From: Adrien Mazarguil To: "Zhao1, Wei" Cc: "dev@dpdk.org" Message-ID: <20171031174551.GV26782@6wind.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v2 01/25] ethdev: introduce generic 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: Tue, 31 Oct 2017 17:46:07 -0000 Hi Wei, Sorry for the late answer, see below. On Mon, Oct 23, 2017 at 08:53:49AM +0000, Zhao1, Wei wrote: > +/** > + * RTE_FLOW_ACTION_TYPE_RSS > + * > + * Similar to QUEUE, except RSS is additionally performed on packets to > + * spread them among several queues according to the provided parameters. > + * > + * Note: RSS hash result is normally stored in the hash.rss mbuf field, > + * however it conflicts with the MARK action as they share the same > + * space. When both actions are specified, the RSS hash is discarded > +and > + * PKT_RX_RSS_HASH is not set in ol_flags. MARK has priority. The mbuf > + * structure should eventually evolve to store both. > + * > + * Terminating by default. > + */ > +struct rte_flow_action_rss { > + const struct rte_eth_rss_conf *rss_conf; /**< RSS parameters. */ > + uint16_t num; /**< Number of entries in queue[]. */ > + uint16_t queue[]; /**< Queues indices to use. */ }; > + > > I am plan for moving rss to rte_flow. > May I ask you some question for this struct of rte_flow_action_rss. > 1. why do you use pointer mode for rss_conf, why not use " struct rte_eth_rss_conf rss_conf "? > we need to fill these rss info which get from CLI to this struct, if we use the pointer mode, how can we fill in these info? The original idea was to provide the ability to share a single rss_conf structure between many flow rules and avoid redundant allocations. It's based on the fact applications currently use a single RSS context for everything, they can easily make rss_conf point the global context found in struct rte_eth_dev. Currently the testpmd flow command is incomplete, it doesn't support the configuration of this field and always provides NULL to PMDs instead. This is not documented in the flow API and may crash PMDs. For the time being, a PMD can interpret NULL as a kind of default global rss_conf parameters, as is done in both mlx5 and mlx4 PMDs. That's a problem that needs to be addressed in testpmd. > 2. And also why the" const" is not need? We need a const ?How can we config this parameter? It means the allocation is managed outside of rte_flow, where the data may or may not be const, it's up to the application. The pointer stored in this structure is only a copy. Whether the pointed data remains allocated once the flow rule is created is unspecified. A PMD cannot assume anything and has to copy these parameters if needed later. It's an API issue I'd like to address by embedding the rss_conf parameters directly in rte_flow_action_rss instead of doing so through a pointer. > 3. what is your expect mode for CLI command for rss config? When I type in : > " flow create 0 pattern eth / tcp / end actions rss queues queue 0 /end " > Or " flow create 0 pattern eth / tcp / end actions rss queues {0 1 2} /end " > I get " Bad arguments ". > > So, the right CLI command is ? Basically you need to specify an additional "end" keyword to terminate the queues list (tab completion shows it): flow create 0 ingress pattern eth / tcp / end actions rss queues 0 1 2 end / end There are other design flaws with the RSS action definition: - RSS hash algorithm to use is missing, PMDs must rely on global parameters. - The C99-style flexible queues array is a super pain to manage and is not supported by C++. I want to make it a normal pointer (the same applies to the RAW pattern item). These changes are planned for the next overhaul of rte_flow, I'll submit a RFC for them as soon as I get the chance. -- Adrien Mazarguil 6WIND