From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3DFAAA0562; Tue, 31 Mar 2020 07:20:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 22E801C02A; Tue, 31 Mar 2020 07:20:48 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id ED8CB1BFC1 for ; Tue, 31 Mar 2020 07:20:35 +0200 (CEST) IronPort-SDR: zoaniPTwVpXfAsubcflWNdE2EPuif04TXfQf4yAHbgViZoI10oklY6j1jsJ90r6V5NSpxNmUxs 7lB+7JAmhKIw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2020 22:20:35 -0700 IronPort-SDR: tP5q9+RX0XnhpVw1m9oMTGA6BpTM2iLeuWmNCtlTQ52qUBdyMVj/81rYYi4l4Pe1P7j/XM5vGk doV77ZUXFmVQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="252118381" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga006.jf.intel.com with ESMTP; 30 Mar 2020 22:20:35 -0700 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 30 Mar 2020 22:20:34 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX603.ccr.corp.intel.com (10.109.6.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 31 Mar 2020 13:20:32 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Tue, 31 Mar 2020 13:20:32 +0800 From: "Cao, Yahui" To: "Su, Simei" , "Ye, Xiaolong" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "Wu, Jingjing" Thread-Topic: [PATCH 5/5] net/iavf: add support for FDIR mark action Thread-Index: AQHV/Og5xobhBq+sGEW60/7LOD4QD6hiPQZQ Date: Tue, 31 Mar 2020 05:20:32 +0000 Message-ID: <31a3b9a8e92642d1998cd1dac2cb2247@intel.com> References: <1584510121-377747-1-git-send-email-simei.su@intel.com> <1584510121-377747-6-git-send-email-simei.su@intel.com> In-Reply-To: <1584510121-377747-6-git-send-email-simei.su@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 5/5] net/iavf: add support for FDIR mark action 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: Su, Simei > Sent: Wednesday, March 18, 2020 1:42 PM > To: Ye, Xiaolong ; Zhang, Qi Z > Cc: dev@dpdk.org; Cao, Yahui ; Wu, Jingjing > ; Su, Simei > Subject: [PATCH 5/5] net/iavf: add support for FDIR mark action >=20 > This patch enables mark action support and takes mark only case into > consideration. >=20 > Signed-off-by: Simei Su > --- > drivers/net/iavf/iavf.h | 1 + > drivers/net/iavf/iavf_fdir.c | 46 > +++++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 46 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index > 62a3eb8..178d481 100644 > --- a/drivers/net/iavf/iavf.h > +++ b/drivers/net/iavf/iavf.h > @@ -103,6 +103,7 @@ struct iavf_fdir_conf { > struct virtchnl_fdir_fltr input; > uint64_t input_set; > uint32_t flow_id; > + uint32_t mark_flag; > }; >=20 > struct iavf_fdir_info { > diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c = index > 8d49c28..a03bc09 100644 > --- a/drivers/net/iavf/iavf_fdir.c > +++ b/drivers/net/iavf/iavf_fdir.c > @@ -18,6 +18,7 @@ > #include "iavf.h" > #include "iavf_generic_flow.h" > #include "virtchnl.h" > +#include "iavf_rxtx.h" >=20 > #define IAVF_FDIR_MAX_QREGION_SIZE 128 >=20 > @@ -171,6 +172,9 @@ > goto free_entry; > } >=20 > + if (filter->mark_flag =3D=3D 1) > + iavf_fdir_rx_proc_enable(ad, 1); > + > rte_memcpy(rule, filter, sizeof(*rule)); > flow->rule =3D rule; >=20 > @@ -199,6 +203,9 @@ > return -rte_errno; > } >=20 > + if (filter->mark_flag =3D=3D 1) > + iavf_fdir_rx_proc_enable(ad, 0); > + > flow->rule =3D NULL; > rte_free(filter); >=20 > @@ -297,7 +304,9 @@ > struct iavf_fdir_conf *filter) > { > const struct rte_flow_action_queue *act_q; > + const struct rte_flow_action_mark *mark_spec =3D NULL; > uint32_t dest_num =3D 0; > + uint32_t mark_num =3D 0; > int ret; >=20 > int number =3D 0; > @@ -367,6 +376,20 @@ > filter->input.rule_cfg.action_set.count =3D ++number; > break; >=20 > + case RTE_FLOW_ACTION_TYPE_MARK: > + mark_num++; > + > + filter->mark_flag =3D 1; > + mark_spec =3D actions->conf; > + filter_action =3D &filter->input.rule_cfg. > + action_set.actions[number]; > + > + filter_action->type =3D VIRTCHNL_FDIR_ACT_MARK; > + filter_action->mark_id =3D mark_spec->id; > + > + filter->input.rule_cfg.action_set.count =3D ++number; > + break; > + > default: > rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ACTION, > actions, @@ -375,13 +398,34 @@ > } > } >=20 > - if (dest_num =3D=3D 0 || dest_num >=3D 2) { > + if (dest_num >=3D 2) { > rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ACTION, actions, > "Unsupported action combination"); > return -rte_errno; > } >=20 > + if (mark_num >=3D 2) { > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ACTION, actions, > + "Too many mark actions"); > + return -rte_errno; > + } > + > + if (dest_num + mark_num =3D=3D 0) { > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ACTION, actions, > + "Emtpy action"); > + return -rte_errno; > + } > + > + /* Mark only is equal to mark + passthru. */ > + if (dest_num =3D=3D 0) { > + filter_action =3D &filter->input.rule_cfg. > + action_set.actions[number]; > + filter_action->type =3D VIRTCHNL_FDIR_ACT_PASSTHRU; [Cao, Yahui] =20 Miss "filter->input.rule_cfg.action_set.count =3D ++number;" here > + } > + > return 0; > } >=20 > -- > 1.8.3.1