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 A588EA0547; Fri, 12 Mar 2021 09:25:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 27A20160842; Fri, 12 Mar 2021 09:25:58 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 231F54067E for ; Fri, 12 Mar 2021 09:25:56 +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 693507F4DA; Fri, 12 Mar 2021 11:25:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 693507F4DA DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1615537555; bh=YooFRL7U7RHN+nq+sLDfYvJ8VtkmgxlV9yOFKdOB9QY=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=HiNJdcvU1BoyhtZuaVGXu38Piw5vU78tNlEiTHCziBeCRCM2D4c3nhVePNYirRLiB M0FeZrQ6W+mZqV2YkItJ5wcywXDWkSrwiPCROPYzGc8Wwq3+ALmGHhFnXp6N3muQbc SeGgifVw9GXb8SZi32gay/f9dZvpzdkhWcyl1dwU= To: Thomas Monjalon , "Wang, Haiyue" Cc: "dev@dpdk.org" , Ori Kam , Ajit Khaparde , Somnath Kotur , Chas Williams , "Min Hu (Connor)" , Rahul Lakkireddy , Hemant Agrawal , Sachin Saxena , "Guo, Jia" , "Daley, John" , Hyong Youb Kim , Gaetan Rivet , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , Yisen Zhuang , Lijun Ou , "Xing, Beilei" , "Wu, Jingjing" , "Yang, Qiming" , "Zhang, Qi Z" , "Xu, Rosen" , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Liron Himi , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , Rasesh Mody , Shahed Shaikh , "Singh, Jasvinder" , "Dumitrescu, Cristian" , "Wiles, Keith" , Jiawen Wu , Jian Wang , "Yigit, Ferruh" References: <20210311221742.3750589-1-thomas@monjalon.net> <20210311221742.3750589-2-thomas@monjalon.net> <323108562.jUxrqk0L7m@thomas> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: Date: Fri, 12 Mar 2021 11:25:55 +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: <323108562.jUxrqk0L7m@thomas> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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" On 3/12/21 11:22 AM, Thomas Monjalon wrote: > 12/03/2021 02:44, Wang, Haiyue: >> From: Thomas Monjalon >>> -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 */ >>> >> >> How about to change the return type to "const struct rte_flow_ops *" directly ? >> >> typedef const struct rte_flow_ops * (*eth_flow_ops_get_t)(struct rte_eth_dev *dev); > > Not sure. > Returning an int may allow different error codes. > Any opinions? > I would keep int return value. There is no point to optimize it (make it simpler). It is called in just one place where int return value may be used/forwarded (see my review notes).