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 BAED9A0547; Fri, 12 Mar 2021 09:26:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A58CE160842; Fri, 12 Mar 2021 09:26:43 +0100 (CET) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by mails.dpdk.org (Postfix) with ESMTP id 5D1AE4067E for ; Fri, 12 Mar 2021 09:26:42 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 8D309580487; Fri, 12 Mar 2021 03:26:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 12 Mar 2021 03:26:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm3; bh= WdYzmPNKOR+WvhICwFikbW4I3V9bqlAkqsGEjCSpXpU=; b=XGyn1236r/X2iVxd YKb8qJt2d3JsJ/LXYvFgkM/9jWkxyEb9xeyIOkR076oW68NKr5hzhuyAbTO8RW3G bIcMntsDNXZ8Eu16aDpvsw/rOkfdGw0KjWNGDZpwrlBtcfcXxQoeWAZlDDDYSF90 5c4aKLtlz80WZExCUqFSPRr1rlTmNftfPZRKMDbiKk+Ual0wrvEq8mfMB1uHpAsV t7YVnTkkrD4+81ifYTy2lmY5NPBEL49002OC9+orptfx6O8tcMkdmvcuY0S9+PjB jANwRehNPt4C914FG4RWdMUMcNHQiyMDnp3xCcFqCcj2EKK3LNCzUpB6AyAHTE0f dhSrGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=WdYzmPNKOR+WvhICwFikbW4I3V9bqlAkqsGEjCSpX pU=; b=p2tswprhypWtP6nIYtF5dKvYS+HdAYmu04n41zSTzgdtGAapBFzGkRl/t 9EKyGHQDdx9MGrCSgrNRr+4u7ONdBncyDZvMqmJCkpbyjRQ67I8nxbzQ6pvPr5JH Sot0imb37aEPyC9lZjC1mVWkY68CjR4MVzgl6A8Cpuu3R0JdOlbJV9muct/edQrU sasiWqbyCZb/ZBWzOhVPI8suxCYf/0lttM4/vrWo+heUcVLKB7x4IqhSpPiCa8sW 6I1A+T2Wf3W3wY9BM5g6HGEJV9xH5LYUhmyjb4YUEy/KiftTYXJb1/brNcL10Ecb byoJVxJszakZ17Q5uGmr8MOOWUtZw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddvuddguddukecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 322F11080069; Fri, 12 Mar 2021 03:26:36 -0500 (EST) From: Thomas Monjalon To: Andrew Rybchenko Cc: dev@dpdk.org, 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 Date: Fri, 12 Mar 2021 09:26:34 +0100 Message-ID: <1725251.lkmGk7NIn2@thomas> In-Reply-To: References: <20210311221742.3750589-1-thomas@monjalon.net> <20210311221742.3750589-2-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 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" 12/03/2021 08:09, Andrew Rybchenko: > On 3/12/21 1:17 AM, 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 > > A couple of minor notes below. Other than that: > > Reviewed-by: Andrew Rybchenko > > [snip] > > > diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst > > index 7405a9864f..1260539a21 100644 > > --- a/doc/guides/rel_notes/release_20_11.rst > > +++ b/doc/guides/rel_notes/release_20_11.rst > > @@ -571,7 +571,7 @@ API Changes > > a TC is greater than 256. > > > > * ethdev: Removed the legacy filter API, including > > - ``rte_eth_dev_filter_supported()`` and ``rte_eth_dev_filter_ctrl()``. > > + ``rte_eth_dev_filter_supported()`` and ``rte_eth_dev_flow_ops_get()``. > > Mass substitution is dangerous. I guess this one is not > intended. > > > > > * ethdev: Removed the legacy L2 tunnel configuration API, including > > ``rte_eth_dev_l2_tunnel_eth_type_conf()`` and > > diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst > > index cea5c8746d..f7deeac34b 100644 > > --- a/doc/guides/rel_notes/release_2_2.rst > > +++ b/doc/guides/rel_notes/release_2_2.rst > > @@ -501,7 +501,7 @@ API Changes > > ----------- > > > > * The deprecated flow director API is removed. > > - It was replaced by ``rte_eth_dev_filter_ctrl()``. > > + It was replaced by ``rte_eth_dev_flow_ops_get()``. > > As well as this one. Oops, good catch, sorry I did not double check this part. [...] > > -typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev, > > - enum rte_filter_type filter_type, > > - enum rte_filter_op filter_op, > > - void *arg); > > -/**< @internal Take operations to assigned filter type on an Ethernet device */ > > +struct rte_flow_ops; > > +typedef int (*eth_flow_ops_get_t)(struct rte_eth_dev *dev, > > + const struct rte_flow_ops **ops); > > +/**< @internal Get flow operations */ > > I'm OK with the callback prototype. I think there is no point > to optimize it and make ops a return value. It is called in > just one place. Nothing to optimize. OK > > --- a/lib/librte_ethdev/rte_flow.c > > +++ b/lib/librte_ethdev/rte_flow.c > > @@ -255,12 +255,9 @@ 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)) > > + else if (unlikely(!dev->dev_ops->flow_ops_get || > > + dev->dev_ops->flow_ops_get(dev, &ops) || > > If the callback return error code, may be it should be used > and forwarded here? > > > + ops == NULL)) > > code = ENOSYS; Yes you are right. Strange that it was not already forwarded.