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 7E24CA04DB; Thu, 15 Oct 2020 07:11:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0CDDB1BCE1; Thu, 15 Oct 2020 07:11:02 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 3B1931BC27 for ; Thu, 15 Oct 2020 07:11:00 +0200 (CEST) IronPort-SDR: 3yL+t9+EfaEKbwiy+kv0mUcOsv1FO7Rac5otN0YyfXbWMEx0NsY1smCs3RCEDFDas5Ll/QO2KF Ps79dSYUHsDA== X-IronPort-AV: E=McAfee;i="6000,8403,9774"; a="166381270" X-IronPort-AV: E=Sophos;i="5.77,377,1596524400"; d="scan'208";a="166381270" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 22:10:58 -0700 IronPort-SDR: ehJT6WNo/wfQdkBnbciavV52K1gcCEoWa4WL14CC6sI5JXeuf9UjyzCNyiAIeO92E7J1PquL2K CcMlnDV4TyyA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,377,1596524400"; d="scan'208";a="521704873" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga005.fm.intel.com with ESMTP; 14 Oct 2020 22:10:58 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 14 Oct 2020 22:10:57 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX601.ccr.corp.intel.com (10.109.6.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 15 Oct 2020 13:10:55 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Thu, 15 Oct 2020 13:10:55 +0800 From: "Zhang, Qi Z" To: "Su, Simei" , "Yang, Qiming" CC: "dev@dpdk.org" , "Wang, Haiyue" , "Xing, Beilei" , "Ding, Xuan" Thread-Topic: [PATCH v3 3/3] net/ice: support ACL filter in DCF Thread-Index: AQHWogiyJN8Z96bMEE64MdqvpxiiGKmYHAQw Date: Thu, 15 Oct 2020 05:10:55 +0000 Message-ID: References: <20200929015632.109364-1-simei.su@intel.com> <20201014085415.177872-1-simei.su@intel.com> <20201014085415.177872-4-simei.su@intel.com> In-Reply-To: <20201014085415.177872-4-simei.su@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows 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 v3 3/3] net/ice: support ACL filter in DCF 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" some minor captures > -----Original Message----- > From: Su, Simei > Sent: Wednesday, October 14, 2020 4:54 PM > To: Zhang, Qi Z ; Yang, Qiming > Cc: dev@dpdk.org; Wang, Haiyue ; Xing, Beilei > ; Ding, Xuan ; Su, Simei > > Subject: [PATCH v3 3/3] net/ice: support ACL filter in DCF >=20 > Add ice_acl_create_filter to create a rule and ice_acl_destroy_filter to = destroy a > rule. If a flow is matched by ACL filter, filter rule will be set to HW. = Currently > IPV4/IPV4_UDP/IPV4_TCP/IPV4_SCTP pattern and drop action are supported. >=20 > Signed-off-by: Simei Su > Signed-off-by: Xuan Ding > --- > doc/guides/rel_notes/release_20_11.rst | 6 + > drivers/net/ice/ice_acl_filter.c | 1034 > ++++++++++++++++++++++++++++++++ > drivers/net/ice/ice_ethdev.h | 17 + > drivers/net/ice/ice_generic_flow.c | 2 + > drivers/net/ice/meson.build | 3 +- > 5 files changed, 1061 insertions(+), 1 deletion(-) create mode 100644 > drivers/net/ice/ice_acl_filter.c >=20 > diff --git a/doc/guides/rel_notes/release_20_11.rst > b/doc/guides/rel_notes/release_20_11.rst > index e8ae4d4..6cf1ef8 100644 > --- a/doc/guides/rel_notes/release_20_11.rst > +++ b/doc/guides/rel_notes/release_20_11.rst ... > +#define MAX_ACL_SLOTS_ID 2048 > + > +#define ICE_ACL_INSET_ETH_IPV4 ( \ > + ICE_INSET_SMAC | ICE_INSET_DMAC | \ > + ICE_INSET_IPV4_SRC | ICE_INSET_IPV4_DST) #define > +ICE_ACL_INSET_ETH_IPV4_UDP ( \ > + ICE_INSET_SMAC | ICE_INSET_DMAC | \ > + ICE_INSET_IPV4_SRC | ICE_INSET_IPV4_DST | \ > + ICE_INSET_UDP_SRC_PORT | ICE_INSET_UDP_DST_PORT)=20 Better to reuse ICE_ACL_INSET_ETH_IPV4 in ICE_ACL_INSET_ETH_IPV4_UDP ... > +static void > +acl_prof_helper_function(struct ice_hw *hw, struct ice_flow_seg_info *se= g, The function is always used before ice_add_prof, so better rename to acl_ad= d_prof_prepare. > + bool is_l4, uint16_t src_port, uint16_t dst_port) { > + uint16_t val_loc, mask_loc; > + > + ret =3D ice_acl_parse_action(ad, actions, error, filter); > + if (ret) > + goto error; > + > + if (meta) > + *meta =3D filter; > + > +error: > + rte_free(item); > + return ret; > +} > + .... >=20 > +struct ice_acl_conf { > + struct ice_fdir_fltr input; > + uint64_t input_set; > +}; > + > +/** > + * A structure used to define fields of ACL related info. > + */ > +struct ice_acl_info { > + struct ice_acl_conf conf; > +}; > + > struct ice_pf { > struct ice_adapter *adapter; /* The adapter this PF associate to */ > struct ice_vsi *main_vsi; /* pointer to main VSI structure */ @@ -421,6 > +435,7 @@ struct ice_pf { > uint16_t fdir_nb_qps; /* The number of queue pairs of Flow Director */ > uint16_t fdir_qp_offset; > struct ice_fdir_info fdir; /* flow director info */ > + struct ice_acl_info acl; /* ACL info */ > struct ice_hash_ctx hash_ctx; > uint16_t hw_prof_cnt[ICE_FLTR_PTYPE_MAX][ICE_FD_HW_SEG_MAX]; > uint16_t fdir_fltr_cnt[ICE_FLTR_PTYPE_MAX][ICE_FD_HW_SEG_MAX]; > @@ -440,6 +455,8 @@ struct ice_pf { > uint64_t old_rx_bytes; > uint64_t old_tx_bytes; > uint64_t supported_rxdid; /* bitmap for supported RXDID */ > + struct rte_bitmap *slots; > + uint64_t hw_entry_id[MAX_ACL_ENTRIES]; Can we move above 2 fields into ice_acl_info? > }; >=20 >