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 DD1B9A04AA; Tue, 8 Sep 2020 09:52:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D2F01BE0C; Tue, 8 Sep 2020 09:52:58 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9DDCE1B9B7 for ; Tue, 8 Sep 2020 09:52:55 +0200 (CEST) IronPort-SDR: lDCdy4DujXyQmf8J9xXYU7ytQiY+6dV32vw6XJtIXiBkJcFGdOoUlHUYF7V74ZiJ8EzPgKnxBV MKzeWIu2sHiQ== X-IronPort-AV: E=McAfee;i="6000,8403,9737"; a="219649380" X-IronPort-AV: E=Sophos;i="5.76,405,1592895600"; d="scan'208";a="219649380" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2020 00:52:54 -0700 IronPort-SDR: CYadPddgjNSr8MaOjAgx1IK5r6e70AuRFHepYhOJgEHEu14/BIpeH3rfsKbKM3t2vMdtihRQ7e OfzmCBHpDGmA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,405,1592895600"; d="scan'208";a="377439306" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga001.jf.intel.com with ESMTP; 08 Sep 2020 00:52:53 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 8 Sep 2020 00:52:52 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 8 Sep 2020 00:52:52 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 8 Sep 2020 00:52:52 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.177) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 8 Sep 2020 00:52:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SN2mgKr5H3SK3fMbaMdRtZMsNe4c5zLBSrdZ4Ei89rMxT8yzuq3f4LsokTl2F3E83utPXwL9Q3/1Ns9X3K1MfTZW3JiD8tdWpdXBhO+r9ezRSo1sR7CYx1X6+oq5aUo++InaYuvK1EeHqWX5ARa9HNk/x0D9saWJYge2cZkyoTWnhx3Vi2B6jKv9Y7G6qPsP5I9ebCj8eBs5nPH/j4+kz+3q71eb18TL5vn7+CPa69e1U7S8+Gt7QpvWJGr44hsXOaFGuPzC71MJVGihkx2w8TKATY+P+WfUFz3ltrYdLqKTfHQYuIKvLRbpqZ22ZrwGKy/CvIX6kJPUM/CinBY8Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qCa55gfDvnPgsF9oSZDU3V8ariwh5Oo7wnm1bcqwfYo=; b=AlLcVxZ49tQet6sCIzVawxiUDC9MHZZbzJlB0gQtGqXOy2aVWixHvQJizTEmvCZ4HNiTQytafgW0RNZxDGtVUZ6+iItbbFsD5KBBVs8605+wYTfS71BNFj+XZTn1j2nnS8F97KcbGG+SeMdmSc5hAIRG9KVDtv9/HK2ewLD4k/3rUkHqMA7xH2El/L69Pjw+DyxgFLJauundmQl10EyPVFKHvu/uoA7QWY2KxfDr3Y1ctXI1ga3PfcEtfuFvN5/TQWz2ZzU/KmWpCEJPkS8lBmuF+4bYYrstGNBmf6Ctda1b3+2xqTQCHq1s0zUsuhmhLfiS8d3OvGZBUKwwI/L6Ng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qCa55gfDvnPgsF9oSZDU3V8ariwh5Oo7wnm1bcqwfYo=; b=d2FUeck7ElkOUhbc6i5i2WgKp4k/4GdOA+Fn8D0mRYki5mWiezp6SIYasGHLavhJvBnOEGAjlKQlU8///ip7oYvGAUAxfwrkm4UOlwgfSSPB3BlG8EtM1X4F+2YxzvcsqjPXmBoTIXYl4PyFe/nF2P10E5e6fKoq3IHOphFUUh0= Received: from BN6PR11MB0017.namprd11.prod.outlook.com (2603:10b6:405:6c::34) by BN7PR11MB2867.namprd11.prod.outlook.com (2603:10b6:406:b9::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15; Tue, 8 Sep 2020 07:52:49 +0000 Received: from BN6PR11MB0017.namprd11.prod.outlook.com ([fe80::e41f:999f:5492:5175]) by BN6PR11MB0017.namprd11.prod.outlook.com ([fe80::e41f:999f:5492:5175%6]) with mapi id 15.20.3305.026; Tue, 8 Sep 2020 07:52:49 +0000 From: "Yang, Qiming" To: "Jiang, JunyuX" , "dev@dpdk.org" CC: "Zhang, Qi Z" , "Sun, GuinanX" Thread-Topic: [PATCH v2 2/5] net/ice: add flow director enabled switch value Thread-Index: AQHWhPkC1i7rBgQiqUC2ModxprLBq6leX0Ag Date: Tue, 8 Sep 2020 07:52:48 +0000 Message-ID: References: <20200826075501.50052-1-guinanx.sun@intel.com> <20200907091711.5980-1-junyux.jiang@intel.com> <20200907091711.5980-3-junyux.jiang@intel.com> In-Reply-To: <20200907091711.5980-3-junyux.jiang@intel.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.46] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2eb10158-44fc-45a3-8f20-08d853cc2e86 x-ms-traffictypediagnostic: BN7PR11MB2867: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:113; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Dw4vJI5jp4ZHoAHqHVRZj+CMlq3cpAd8Mnjj8OrmTmLRontYn/2RKPtQlvgAhE8hpJ+74HuLNZYtOSfWJ/xEmaMBHckcvUvprxcQXY9wdxLpctltzE74Fwhq4F1FBv9dTYyYGJnwBS/RogcW70c1FDJ4LjL5eoBUR2Cp+O5HMo5o+A7JAULWm6ULSzBNQQSHK3y6KkJCaRBEkkbgqVwD+jntFCF2f5P6LQeywbFquGt1CWKCDKbft2TwkaMjhDtzYdS2UEZD3T+1f0lhtEbHw7sHGgfPGUiD6yt4zUNdAh+lW3TbYjqrBSZPfU7RgcJQ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB0017.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39860400002)(346002)(136003)(396003)(376002)(6506007)(53546011)(55016002)(52536014)(26005)(186003)(7696005)(71200400001)(8676002)(83380400001)(8936002)(5660300002)(4326008)(9686003)(110136005)(54906003)(107886003)(316002)(64756008)(66556008)(66476007)(66446008)(66946007)(2906002)(86362001)(76116006)(478600001)(33656002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: RcOFkXeAaZVMDkbYstiinquP/2H980KBv6M/oLFDokyfZSGt008ph2eU7QH5xWY3YAXhf2M5fi2l1I24mBs/2uPP9QGtxQ5oDBmZ1YA3sWHVcj21vE1LBGwsBDGeIk5JEqHxqUVExsDfJuatPE3fRlwn3OpgYvXwTxTVGQkuUY3kozdqoUrGIsDW53RqbqEcoHcUoBrDrIetVAUx+RJO1JsHZwHP6QtC+yuqfvPVcoQSJoKoGdTHh0cGPXnDD5UeBGb2CFKx52U0yLS7yOzU2Y5Mve3qk6/VPsJ7xtGw8efo8Eg0Xosos2gzwpXDJLX9saWlPWHgAUp6J0KBwfR3cB0g1i6SrA2c/Wvk6YbfsMYItPMWy9fR4XI8FbUmoK5wabFhDry6VIqU+fZva8r7vy7CkdtG7XRbGyC3iXGKR0Gqnsnmb7xre3ejXtyYv5SCGQHDxD05r4K7aRmtJEI7R7RxEOl8NqrcyC356IO6BQphdsSFbeWT7AtJE0iePhIaGulWXHzf+P/YvWWmPJ+rWezi7O6mIsq7CWbiubbrJCRA38e53B/ISTxrUK4HXxFt7rbQ+Q4hPNO50zdzoMSWLvVRrQpckeOkyw5kjRRJCBRsTdmEHF3/hhwiiMyTwSRm+YRCwH8ud3OoDrwR7bkMXA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB0017.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2eb10158-44fc-45a3-8f20-08d853cc2e86 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Sep 2020 07:52:48.9990 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vD/IHQhhDX5daEckUNh6O63/E1A6yNzfQjNsa5RGpAmZEm6F1nm4WElJxaCH5lIc3/CtDlDm0HHO/ozc24cGww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2867 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 2/5] net/ice: add flow director enabled switch value 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: Jiang, JunyuX > Sent: Monday, September 7, 2020 17:17 > To: dev@dpdk.org > Cc: Zhang, Qi Z ; Yang, Qiming > ; Sun, GuinanX > Subject: [PATCH v2 2/5] net/ice: add flow director enabled switch value >=20 > From: Guinan Sun >=20 > The commit adds fdir_enabled flag into ice_adapter structure to identify = if > fdir id is active. Rx data path can be benefit if fdir id parsing is not = needed, Don't use abbreviation and check your grammar. > especially in vector path. >=20 > Signed-off-by: Guinan Sun > --- > drivers/net/ice/ice_ethdev.h | 2 ++ > drivers/net/ice/ice_fdir_filter.c | 9 ++++++++- > drivers/net/ice/ice_rxtx.h | 30 ++++++++++++++++++++++++++++++ > 3 files changed, 40 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h > index 393dfeab1..df0d65d8d 100644 > --- a/drivers/net/ice/ice_ethdev.h > +++ b/drivers/net/ice/ice_ethdev.h > @@ -285,6 +285,7 @@ struct ice_fdir_filter_conf { > struct rte_flow_action_count act_count; >=20 > uint64_t input_set; > + uint32_t mark_flag; > }; >=20 > #define ICE_MAX_FDIR_FILTER_NUM (1024 * 16) > @@ -464,6 +465,7 @@ struct ice_adapter { > bool is_safe_mode; > struct ice_devargs devargs; > enum ice_pkg_type active_pkg_type; /* loaded ddp package type */ > + uint16_t fdir_ref_cnt; > }; >=20 > struct ice_vsi_vlan_pvid_info { > diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir= _filter.c > index 745d7291a..e496c4d0a 100644 > --- a/drivers/net/ice/ice_fdir_filter.c > +++ b/drivers/net/ice/ice_fdir_filter.c > @@ -1329,6 +1329,9 @@ ice_fdir_create_filter(struct ice_adapter *ad, > goto free_counter; > } >=20 > + if (filter->mark_flag =3D=3D 1) > + ice_fdir_rx_proc_enable(ad, 1); > + > rte_memcpy(entry, filter, sizeof(*entry)); > ret =3D ice_fdir_entry_insert(pf, entry, &key); > if (ret) { > @@ -1401,6 +1404,10 @@ ice_fdir_destroy_filter(struct ice_adapter *ad, > } >=20 > ice_fdir_cnt_update(pf, filter->input.flow_type, is_tun, false); > + > + if (filter->mark_flag =3D=3D 1) > + ice_fdir_rx_proc_enable(ad, 0); > + > flow->rule =3D NULL; >=20 > rte_free(filter); > @@ -1573,7 +1580,7 @@ ice_fdir_parse_action(struct ice_adapter *ad, > break; > case RTE_FLOW_ACTION_TYPE_MARK: > mark_num++; > - > + filter->mark_flag =3D 1; > mark_spec =3D actions->conf; > filter->input.fltr_id =3D mark_spec->id; > filter->input.fdid_prio =3D > ICE_FXD_FLTR_QW1_FDID_PRI_ONE; diff --git a/drivers/net/ice/ice_rxtx.h > b/drivers/net/ice/ice_rxtx.h index e21ba152d..69d6e0b8b 100644 > --- a/drivers/net/ice/ice_rxtx.h > +++ b/drivers/net/ice/ice_rxtx.h > @@ -70,6 +70,7 @@ struct ice_rx_queue { >=20 > uint8_t port_id; /* device port ID */ > uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */ > + uint8_t fdir_enabled; /* 0 if FDIR disabled, 1 when enabled */ > uint16_t queue_id; /* RX queue index */ > uint16_t reg_idx; /* RX queue register index */ > uint8_t drop_en; /* if not 0, set register bit */ @@ -245,4 +246,33 > @@ uint16_t ice_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf > **tx_pkts, int ice_fdir_programming(struct ice_pf *pf, struct ice_fltr_d= esc > *fdir_desc); int ice_tx_done_cleanup(void *txq, uint32_t free_cnt); >=20 > +#define FDIR_PROC_ENABLE_PER_QUEUE(ad, on) do { \ > + int i; \ > + for (i =3D 0; i < (ad)->eth_dev->data->nb_rx_queues; i++) { \ > + struct ice_rx_queue *rxq =3D (ad)->eth_dev->data- > >rx_queues[i]; \ > + if (!rxq) \ > + continue; \ > + rxq->fdir_enabled =3D on; \ > + } \ > + PMD_DRV_LOG(DEBUG, "FDIR processing on RX set to %d", on); \ } > while > +(0) > + > +/* Enable/disable flow director Rx processing in data path. */ static Wha't do you mean ' flow director Rx processing '? > +inline void ice_fdir_rx_proc_enable(struct ice_adapter *ad, bool on) { > + if (on) { > + /* enable flow director processing */ > + FDIR_PROC_ENABLE_PER_QUEUE(ad, on); > + ad->fdir_ref_cnt++; > + } else { > + if (ad->fdir_ref_cnt >=3D 1) { > + ad->fdir_ref_cnt--; > + > + if (ad->fdir_ref_cnt =3D=3D 0) > + FDIR_PROC_ENABLE_PER_QUEUE(ad, on); > + } > + } > +} > + > #endif /* _ICE_RXTX_H_ */ > -- > 2.17.1