From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 604ADA0471 for ; Mon, 17 Jun 2019 08:02:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F5C51BDCA; Mon, 17 Jun 2019 08:02:13 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 47B411BD65 for ; Mon, 17 Jun 2019 08:02:12 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jun 2019 23:02:11 -0700 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jun 2019 23:02:11 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 16 Jun 2019 23:02:11 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 16 Jun 2019 23:02:11 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.104]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.236]) with mapi id 14.03.0439.000; Mon, 17 Jun 2019 14:02:09 +0800 From: "Xing, Beilei" To: "Yang, Qiming" , "dev@dpdk.org" CC: "Yang, Qiming" Thread-Topic: [dpdk-dev] [PATCH v2 2/3] net/ice: add generic flow API Thread-Index: AQHVIPPp55d4vE/1dkSfK7TKIFTKN6afYYzA Date: Mon, 17 Jun 2019 06:02:08 +0000 Message-ID: <94479800C636CB44BD422CB454846E013CDE5B7E@SHSMSX101.ccr.corp.intel.com> References: <1559552722-8970-1-git-send-email-qiming.yang@intel.com> <20190612075029.109914-1-qiming.yang@intel.com> <20190612075029.109914-3-qiming.yang@intel.com> In-Reply-To: <20190612075029.109914-3-qiming.yang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 2/3] net/ice: add 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" ... > + > +static int > +ice_flow_validate(__rte_unused struct rte_eth_dev *dev, > + const struct rte_flow_attr *attr, > + const struct rte_flow_item pattern[], > + const struct rte_flow_action actions[], > + struct rte_flow_error *error) > +{ > + uint64_t inset =3D 0; > + int ret =3D ICE_ERR_NOT_SUPPORTED; > + > + if (!pattern) { > + rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ITEM_NUM, > + NULL, "NULL pattern."); > + return -rte_errno; > + } > + > + if (!actions) { > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ACTION_NUM, > + NULL, "NULL action."); > + return -rte_errno; > + } > + > + if (!attr) { > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ATTR, > + NULL, "NULL attribute."); > + return -rte_errno; > + } > + > + ret =3D ice_flow_valid_attr(attr, error); > + if (!ret) > + return ret; > + > + inset =3D ice_flow_valid_pattern(pattern, error); > + if (!inset) > + return -rte_errno; > + > + ret =3D ice_flow_valid_inset(pattern, inset, error); > + if (ret) > + return ret; > + > + ret =3D ice_flow_valid_action(actions, error); > + if (ret) > + return ret; There're some duplicate work (such as valid action) with patch 1, it's bett= er to optimize it. > + > + return 0; > +} > + >=20