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 E65B0A057C; Thu, 26 Mar 2020 07:57:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ADE3F374C; Thu, 26 Mar 2020 07:57:44 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id D2C632BAE for ; Thu, 26 Mar 2020 07:57:42 +0100 (CET) IronPort-SDR: wlRUGf51DY/C67TmH/f69brFEDsp+Jq1z3URvVU8N5nm3IcdApcb8pqPZTLA0JzFrsckKX1LyF R0Vv0cD5m87A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 23:57:41 -0700 IronPort-SDR: mgRidXiEp0tH2Cj2hoF6OKR5Wbees/fhNw9FeC3xtfXjklh8rw/hkuZxs+KB9tE9jvLgqwAeod h2kXTt2ZbbRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,307,1580803200"; d="scan'208";a="393880433" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 25 Mar 2020 23:57:41 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Mar 2020 23:57:41 -0700 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) 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, 26 Mar 2020 14:57:39 +0800 Received: from shsmsx603.ccr.corp.intel.com ([10.109.6.143]) by SHSMSX603.ccr.corp.intel.com ([10.109.6.143]) with mapi id 15.01.1713.004; Thu, 26 Mar 2020 14:57:39 +0800 From: "Wu, Jingjing" To: "Rong, Leyi" , "Zhang, Qi Z" , "Ye, Xiaolong" CC: "dev@dpdk.org" , "Rong, Leyi" Thread-Topic: [dpdk-dev] [PATCH 07/12] net/iavf: add flow director enabled switch value Thread-Index: AQHV+2jQYcd1497VDkOUklK9IJQd7qhagEaQ Date: Thu, 26 Mar 2020 06:57:38 +0000 Message-ID: References: <20200316074603.10998-1-leyi.rong@intel.com> <20200316074603.10998-8-leyi.rong@intel.com> In-Reply-To: <20200316074603.10998-8-leyi.rong@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 07/12] net/iavf: 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: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Leyi Rong Sent: Monday, March 16, 2020 3:46 PM To: Zhang, Qi Z ; Ye, Xiaolong Cc: dev@dpdk.org; Rong, Leyi Subject: [dpdk-dev] [PATCH 07/12] net/iavf: add flow director enabled switc= h value The commit adds fdir_enabled flag into iavf_adapter structure to identify i= f fdir id is active. Rx data path can be benefit if fdir id parsing is not = needed, especially in vector path. Signed-off-by: Leyi Rong --- drivers/net/iavf/iavf.h | 1 + drivers/net/iavf/iavf_rxtx.h | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index 4fe152= 37a..1918a67f1 100644 --- a/drivers/net/iavf/iavf.h +++ b/drivers/net/iavf/iavf.h @@ -142,6 +142,7 @@ struct iavf_adapter { bool tx_vec_allowed; const uint32_t *ptype_tbl; bool stopped; + uint8_t fdir_enabled; }; =20 /* IAVF_DEV_PRIVATE_TO */ diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h in= dex c85207dae..5548d1adb 100644 --- a/drivers/net/iavf/iavf_rxtx.h +++ b/drivers/net/iavf/iavf_rxtx.h @@ -281,6 +281,32 @@ void iavf_dump_tx_descriptor(const struct iavf_tx_queu= e *txq, tx_desc->cmd_type_offset_bsz); } =20 +/* Enable/disable flow director Rx processing in data path. */ static=20 +inline void iavf_fdir_rx_proc_enable(struct iavf_adapter *ad, bool on)=20 +{ + static uint32_t ref_cnt; + + if (on) { + /* enable flow director processing */ + if (ref_cnt++ =3D=3D 0) { + ad->fdir_enabled =3D on; + PMD_DRV_LOG(DEBUG, + "FDIR processing on RX set to %d", on); + } + } else { + if (ref_cnt >=3D 1) { + ref_cnt--; + + if (ref_cnt =3D=3D 0) { + ad->fdir_enabled =3D on; + PMD_DRV_LOG(DEBUG, + "FDIR processing on RX set to %d", on); + } + } + } +} + fdir_enabled is used for fast path. To avoid competition, how about to make= it in queue granularity? #ifdef RTE_LIBRTE_IAVF_DEBUG_DUMP_DESC #define IAVF_DUMP_RX_DESC(rxq, desc, rx_id) \ iavf_dump_rx_descriptor(rxq, desc, rx_id) -- 2.17.1