From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 82AE4A054F; Mon, 15 Mar 2021 08:18:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 148064068B; Mon, 15 Mar 2021 08:18:18 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 4EB6F4003C for ; Mon, 15 Mar 2021 08:18:16 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 72E537F463; Mon, 15 Mar 2021 10:18:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 72E537F463 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1615792695; bh=vFuqbiJ8anbFLf1qm88qe+jlMwbElWWmSuFu9GhhBGs=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=LFH1Cabg/f6tVEBMlnHPzuJrj0gWkQV3N26vAosBeODu8x6/LS9ffTWyc1bSnqM8E pKNvizcishSoNb8C1gHFM8D24vWhsxXBw5i/T1DbqInnL+XoRGa69NdY2mPLIqWM1E u/ob6lbt97NWVorjYGqqQQ1hAExRFk5HA6icUSjw= To: Thomas Monjalon , dev@dpdk.org Cc: Ori Kam , Ajit Khaparde , Somnath Kotur , Chas Williams , "Min Hu (Connor)" , Rahul Lakkireddy , Hemant Agrawal , Sachin Saxena , Jeff Guo , Haiyue Wang , John Daley , Hyong Youb Kim , Gaetan Rivet , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , Yisen Zhuang , Lijun Ou , Beilei Xing , Jingjing Wu , Qiming Yang , Qi Zhang , Rosen Xu , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Liron Himi , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , Rasesh Mody , Shahed Shaikh , Jasvinder Singh , Cristian Dumitrescu , Keith Wiles , Jiawen Wu , Jian Wang , Ferruh Yigit References: <20210311221742.3750589-1-thomas@monjalon.net> <20210312174645.162801-1-thomas@monjalon.net> <20210312174645.162801-2-thomas@monjalon.net> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: Date: Mon, 15 Mar 2021 10:18:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210312174645.162801-2-thomas@monjalon.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 1/2] ethdev: replace callback getting filter operations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 3/12/21 8:46 PM, Thomas Monjalon wrote: > Since rte_flow is the only API for filtering operations, > the legacy driver interface filter_ctrl was too much complicated > for the simple task of getting the struct rte_flow_ops. > > The filter type RTE_ETH_FILTER_GENERIC and > the filter operarion RTE_ETH_FILTER_GET are removed. > The new driver callback flow_ops_get replaces filter_ctrl. > > Signed-off-by: Thomas Monjalon [snip] > diff --git a/lib/librte_ethdev/rte_eth_ctrl.h b/lib/librte_ethdev/rte_eth_ctrl.h > index 8a50dbfef9..42652f9cce 100644 > --- a/lib/librte_ethdev/rte_eth_ctrl.h > +++ b/lib/librte_ethdev/rte_eth_ctrl.h > @@ -339,7 +339,7 @@ struct rte_eth_fdir_action { > }; > > /** > - * A structure used to define the flow director filter entry by filter_ctrl API. > + * A structure used to define the flow director filter entry. > */ > struct rte_eth_fdir_filter { > uint32_t soft_id; > diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c > index 241af6c4ca..1a896e3e64 100644 > --- a/lib/librte_ethdev/rte_flow.c > +++ b/lib/librte_ethdev/rte_flow.c > @@ -255,18 +255,19 @@ rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error) > > if (unlikely(!rte_eth_dev_is_valid_port(port_id))) > code = ENODEV; > - else if (unlikely(!dev->dev_ops->filter_ctrl || > - dev->dev_ops->filter_ctrl(dev, > - RTE_ETH_FILTER_GENERIC, > - RTE_ETH_FILTER_GET, > - &ops) || > - !ops)) > - code = ENOSYS; > + else if (unlikely(dev->dev_ops->flow_ops_get == NULL)) > + code = ENOTSUP; > else > - return ops; > - rte_flow_error_set(error, code, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > - NULL, rte_strerror(code)); > - return NULL; > + code = dev->dev_ops->flow_ops_get(dev, &ops); > + if (code == 0 && ops == NULL) > + code = EACCES; It looks something new. I think it should be mentioned in flow_ops_get type documentation (similar to eth_promiscuous_enable_t) and rte_flow_validate() etc functions return values description. > + > + if (code != 0) { > + rte_flow_error_set(error, code, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > + NULL, rte_strerror(code)); > + return NULL; > + } > + return ops; > } > > /* Check whether a flow rule can be created on a given port. */ [snip]