From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1039CC31E44 for ; Mon, 17 Jun 2019 05:50:33 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 9593C2189F for ; Mon, 17 Jun 2019 05:50:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9593C2189F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3E97B1BDCD; Mon, 17 Jun 2019 07:50:31 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 5540D1BDCA for ; Mon, 17 Jun 2019 07:50:29 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jun 2019 22:50:28 -0700 X-ExtLoop1: 1 Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga007.jf.intel.com with ESMTP; 16 Jun 2019 22:50:27 -0700 Received: from fmsmsx163.amr.corp.intel.com (10.18.125.72) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 16 Jun 2019 22:50:27 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx163.amr.corp.intel.com (10.18.125.72) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 16 Jun 2019 22:50:27 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.104]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.246]) with mapi id 14.03.0439.000; Mon, 17 Jun 2019 13:50:25 +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/1dkSfK7TKIFTKN6afWxEw Date: Mon, 17 Jun 2019 05:50:24 +0000 Message-ID: <94479800C636CB44BD422CB454846E013CDE5B52@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" > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiming Yang > Sent: Wednesday, June 12, 2019 3:50 PM > To: dev@dpdk.org > Cc: Yang, Qiming > Subject: [dpdk-dev] [PATCH v2 2/3] net/ice: add generic flow API >=20 > This patch adds ice_flow_create, ice_flow_destroy, ice_flow_flush and > ice_flow_validate support, these are going to used to handle all the gene= ric > filters. >=20 'going to' can be removed. > Signed-off-by: Qiming Yang > --- > drivers/net/ice/Makefile | 1 + > drivers/net/ice/ice_ethdev.c | 44 +++ > drivers/net/ice/ice_ethdev.h | 7 +- > drivers/net/ice/ice_generic_flow.c | 567 > +++++++++++++++++++++++++++++++++++++ > drivers/net/ice/ice_generic_flow.h | 404 ++++++++++++++++++++++++++ > 5 files changed, 1022 insertions(+), 1 deletion(-) create mode 100644 > drivers/net/ice/ice_generic_flow.c > create mode 100644 drivers/net/ice/ice_generic_flow.h >=20 > diff --git a/drivers/net/ice/Makefile b/drivers/net/ice/Makefile index > b10d826..32abeb6 100644 > --- a/drivers/net/ice/Makefile > +++ b/drivers/net/ice/Makefile > @@ -79,5 +79,6 @@ endif > ifeq ($(CC_AVX2_SUPPORT), 1) > SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=3D ice_rxtx_vec_avx2.c endif > +SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=3D ice_generic_flow.c >=20 It should be added in meson.build, too. > include $(RTE_SDK)/mk/rte.lib.mk > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c = index > bdbceb4..cf6bb1d 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -15,6 +15,7 @@ ... >=20 > +extern const struct rte_flow_ops ice_flow_ops; > + > /* Struct to store flow created. */ > struct rte_flow { > TAILQ_ENTRY(rte_flow) node; > -void *rule; > + void *rule; > }; Why not change it in patch 1? >=20 > +TAILQ_HEAD(ice_flow_list, rte_flow); > + > struct ice_pf { > struct ice_adapter *adapter; /* The adapter this PF associate to */ > struct ice_vsi *main_vsi; /* pointer to main VSI structure */ @@ - > 265,6 +269,7 @@ struct ice_pf { > struct ice_eth_stats internal_stats; > bool offset_loaded; > bool adapter_stopped; > + struct ice_flow_list flow_list; > }; >=20 > /** > diff --git a/drivers/net/ice/ice_generic_flow.c > b/drivers/net/ice/ice_generic_flow.c > new file mode 100644 > index 0000000..4fb50b2 > --- /dev/null > +++ b/drivers/net/ice/ice_generic_flow.c ... > + > +static int ice_flow_valid_action(const struct rte_flow_action *actions, > + struct rte_flow_error *error) { > + switch (actions->type) { > + case RTE_FLOW_ACTION_TYPE_QUEUE: > + break; > + case RTE_FLOW_ACTION_TYPE_DROP: > + break; > + default: > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ACTION, actions, > + "Invalid action."); > + return -rte_errno; > + } > + > + return 0; > +} Do we need a supported array for action? > + > +static int > +ice_flow_validate(__rte_unused struct rte_eth_dev *dev, ...